Home
last modified time | relevance | path

Searched refs:from (Results 1 – 25 of 161) sorted by relevance

1234567

/libcore/ojluni/src/test/java/time/test/java/time/format/
DTestDateTimeFormatter.java112 assertGoodErrorDate(DayOfWeek::from, "DayOfWeek"); in test_parse_errorMessage()
113 assertGoodErrorDate(Month::from, "Month"); in test_parse_errorMessage()
114 assertGoodErrorDate(YearMonth::from, "YearMonth"); in test_parse_errorMessage()
115 assertGoodErrorDate(MonthDay::from, "MonthDay"); in test_parse_errorMessage()
116 assertGoodErrorDate(LocalDate::from, "LocalDate"); in test_parse_errorMessage()
117 assertGoodErrorDate(LocalTime::from, "LocalTime"); in test_parse_errorMessage()
118 assertGoodErrorDate(LocalDateTime::from, "LocalDateTime"); in test_parse_errorMessage()
119 assertGoodErrorDate(OffsetTime::from, "OffsetTime"); in test_parse_errorMessage()
120 assertGoodErrorDate(OffsetDateTime::from, "OffsetDateTime"); in test_parse_errorMessage()
121 assertGoodErrorDate(ZonedDateTime::from, "ZonedDateTime"); in test_parse_errorMessage()
[all …]
DTestDateTimeParsing.java139 assertEquals(ZonedDateTime.from(actual), expected); in test_parse_instantZones_ZDT()
145 assertEquals(LocalDateTime.from(actual), expected.toLocalDateTime()); in test_parse_instantZones_LDT()
151 assertEquals(Instant.from(actual), expected.toInstant()); in test_parse_instantZones_Instant()
178 ZonedDateTime.from(actual); in test_parse_instantNoZone_ZDT()
184 LocalDateTime.from(actual); in test_parse_instantNoZone_LDT()
190 assertEquals(Instant.from(actual), expected); in test_parse_instantNoZone_Instant()
/libcore/ojluni/src/test/java/nio/file/attribute/
DFileTimeTest.java127 FileTime ft = FileTime.from(value, unit); in main()
136 FileTime ft = FileTime.from(value, unit); in main()
144 ft = FileTime.from(value, unit); in main()
159 FileTime ft = FileTime.from(instant); in main()
165 ft = FileTime.from(instant); in main()
171 ft = FileTime.from(nanos, NANOSECONDS); in main()
175 if (!ft.equals(FileTime.from(instant))) { in main()
215 FileTime.from(0L, null); in main()
219 FileTime.from(null); in main()
233 FileTime.from(Instant.MAX).toMillis()); in main()
[all …]
/libcore/ojluni/src/main/java/java/lang/invoke/
DTransformers.java707 private static void throwWrongMethodTypeException(MethodType from, MethodType to) { in throwWrongMethodTypeException() argument
708 throw new WrongMethodTypeException("Cannot convert " + from + " to " + to); in throwWrongMethodTypeException()
1805 Class<?> from = target.type().rtype(); in explicitCastReturnValue() local
1811 if (from == void.class) { in explicitCastReturnValue()
1831 private static void badCast(final Class<?> from, final Class<?> to) { in badCast() argument
1832 throw new ClassCastException("Cannot cast " + from.getName() + " to " + to.getName()); in badCast()
1844 final Class<?> from) { in readPrimitiveAsByte() argument
1845 if (from == byte.class) { in readPrimitiveAsByte()
1847 } else if (from == char.class) { in readPrimitiveAsByte()
1849 } else if (from == short.class) { in readPrimitiveAsByte()
[all …]
/libcore/ojluni/src/main/java/java/util/stream/
DStreams.java65 private int from; field in Streams.RangeIntSpliterator
72 RangeIntSpliterator(int from, int upTo, boolean closed) { in RangeIntSpliterator() argument
73 this(from, upTo, closed ? 1 : 0); in RangeIntSpliterator()
76 private RangeIntSpliterator(int from, int upTo, int last) { in RangeIntSpliterator() argument
77 this.from = from; in RangeIntSpliterator()
86 final int i = from; in tryAdvance()
88 from++; in tryAdvance()
104 int i = from; in forEachRemaining()
107 from = upTo; in forEachRemaining()
121 return ((long) upTo) - from + last; in estimateSize()
[all …]
DNode.java122 default Node<T> truncate(long from, long to, IntFunction<T[]> generator) { in truncate() argument
123 if (from == 0 && to == count()) in truncate()
126 long size = to - from; in truncate()
129 for (int i = 0; i < from && spliterator.tryAdvance(e -> { }); i++) { } in truncate()
254 T_NODE truncate(long from, long to, IntFunction<T[]> generator); in truncate() argument
357 default Node.OfInt truncate(long from, long to, IntFunction<Integer[]> generator) { in truncate() argument
358 if (from == 0 && to == count()) in truncate()
360 long size = to - from; in truncate()
364 for (int i = 0; i < from && spliterator.tryAdvance((IntConsumer) e -> { }); i++) { } in truncate()
430 default Node.OfLong truncate(long from, long to, IntFunction<Long[]> generator) { in truncate() argument
[all …]
/libcore/luni/src/test/java/libcore/java/util/
DDateTest.java108 assertEquals(new Date(millis), Date.from(Instant.ofEpochMilli(millis))); in check_convertFromAndToInstant_milliseconds()
129 Date.from(Instant.ofEpochSecond(minSecond)); in test_convertFromInstant_secondsAndNanos()
132 Date.from(Instant.ofEpochSecond(minSecond - 1, 192000000)); in test_convertFromInstant_secondsAndNanos()
138 Date.from(Instant.ofEpochSecond(maxSecond, 0)); in test_convertFromInstant_secondsAndNanos()
141 Date.from(Instant.ofEpochSecond(maxSecond, 807999999)); in test_convertFromInstant_secondsAndNanos()
148 Date.from(instant); in assertArithmeticOverflowDateFrom()
177 assertEquals(date, Date.from(instant)); in check_convertToInstantAndBack()
/libcore/tools/upstream/src/main/java/libcore/
DCopyUpstreamFiles.java64 private void copyFile(Path from, Path to) throws IOException { in copyFile() argument
65 if (!from.toFile().canRead()) { in copyFile()
66 throw new IOException("Error reading " + from); in copyFile()
75 Files.copy(from, to); in copyFile()
/libcore/ojluni/src/test/java/time/tck/java/time/format/
DTCKDateTimeFormatter.java180 base.parse("2012-6-30-321", LocalDate::from); // wrong day-of-year in test_resolverFields_selectOneDateResolveYMD()
185 LocalDate parsed = f.parse("2012-6-30-321", LocalDate::from); // ignored day-of-year in test_resolverFields_selectOneDateResolveYMD()
199 base.parse("2012-6-30-321", LocalDate::from); // wrong month/day-of-month in test_resolverFields_selectOneDateResolveYD()
204 LocalDate parsed = f.parse("2012-6-30-321", LocalDate::from); // ignored month/day-of-month in test_resolverFields_selectOneDateResolveYD()
215 base.parse("2012-321-1", LocalDate::from); // wrong day-of-week in test_resolverFields_ignoreCrossCheck()
220 LocalDate parsed = f.parse("2012-321-1", LocalDate::from); // ignored wrong day-of-week in test_resolverFields_ignoreCrossCheck()
472 assertEquals(result.query(LocalDate::from), LocalDate.of(2012, 6, 30)); in test_parse_CharSequence_resolved()
510 assertEquals(result.query(LocalDate::from), LocalDate.of(2012, 6, 30)); in test_parse_CharSequence_ParsePosition_resolved()
549 LocalDate result = DATE_FORMATTER.parse("ONE2012 07 27", LocalDate::from); in test_parse_Query_String()
555 … LocalDate result = DATE_FORMATTER.parse(new StringBuilder("ONE2012 07 27"), LocalDate::from); in test_parse_Query_CharSequence()
[all …]
DTCKInstantPrinterParser.java228 assertEquals(f.parse(input, Instant::from), expected); in test_parse_digitsMinusOne()
238 assertEquals(f.parse(input, Instant::from), expected); in test_parse_digitsNine()
243 f.parse(input, Instant::from); in test_parse_digitsNine()
257 assertEquals(parsed.query(Instant::from), expected); in test_parse_endOfDay()
269 assertEquals(parsed.query(Instant::from), expected); in test_parse_leapSecond()
/libcore/luni/src/test/java/libcore/java/time/chrono/
DThaiBuddhistChronologyTest.java86 ThaiBuddhistDate.from(LocalDate.of(2000, 2, 1)), //February of a leap year in test_ThaiBuddhistDate_range()
87 ThaiBuddhistDate.from(LocalDate.of(2001, 2, 1)), //February of a non-leap year in test_ThaiBuddhistDate_range()
95 assertEquals(LocalDate.from(date).range(ChronoField.DAY_OF_MONTH), in test_ThaiBuddhistDate_range()
97 assertEquals(LocalDate.from(date).range(ChronoField.DAY_OF_YEAR), in test_ThaiBuddhistDate_range()
99 assertEquals(LocalDate.from(date).range(ChronoField.ALIGNED_WEEK_OF_MONTH), in test_ThaiBuddhistDate_range()
DMinguoChronologyTest.java84 MinguoDate.from(LocalDate.of(2000, 2, 1)), //February of a leap year in test_MinguoDate_range()
85 MinguoDate.from(LocalDate.of(2001, 2, 1)), //February of a non-leap year in test_MinguoDate_range()
93 assertEquals(LocalDate.from(date).range(ChronoField.DAY_OF_MONTH), in test_MinguoDate_range()
95 assertEquals(LocalDate.from(date).range(ChronoField.DAY_OF_YEAR), in test_MinguoDate_range()
97 assertEquals(LocalDate.from(date).range(ChronoField.ALIGNED_WEEK_OF_MONTH), in test_MinguoDate_range()
DJapaneseChronologyTest.java75 assertEquals(JapaneseEra.MEIJI, JapaneseDate.from(LocalDate.of(1873, 1, 1)).getEra()); in test_JapaneseDate_getEra()
76 assertEquals(JapaneseEra.TAISHO, JapaneseDate.from(LocalDate.of(1913, 1, 1)).getEra()); in test_JapaneseDate_getEra()
77 assertEquals(JapaneseEra.SHOWA, JapaneseDate.from(LocalDate.of(1927, 1, 1)).getEra()); in test_JapaneseDate_getEra()
78 assertEquals(JapaneseEra.HEISEI, JapaneseDate.from(LocalDate.of(1990, 1, 1)).getEra()); in test_JapaneseDate_getEra()
/libcore/ojluni/src/main/java/java/util/
DArrays.java3365 public static <T> T[] copyOfRange(T[] original, int from, int to) { in copyOfRange() argument
3366 return copyOfRange(original, from, to, (Class<? extends T[]>) original.getClass()); in copyOfRange()
3402 …public static <T,U> T[] copyOfRange(U[] original, int from, int to, Class<? extends T[]> newType) { in copyOfRange() argument
3403 int newLength = to - from; in copyOfRange()
3405 throw new IllegalArgumentException(from + " > " + to); in copyOfRange()
3410 System.arraycopy(original, from, copy, 0, in copyOfRange()
3411 Math.min(original.length - from, newLength)); in copyOfRange()
3441 public static byte[] copyOfRange(byte[] original, int from, int to) { in copyOfRange() argument
3442 int newLength = to - from; in copyOfRange()
3444 throw new IllegalArgumentException(from + " > " + to); in copyOfRange()
[all …]
DJumboEnumSet.java54 void addRange(E from, E to) { in addRange() argument
55 int fromIndex = from.ordinal() >>> 6; in addRange()
59 elements[fromIndex] = (-1L >>> (from.ordinal() - to.ordinal() - 1)) in addRange()
60 << from.ordinal(); in addRange()
62 elements[fromIndex] = (-1L << from.ordinal()); in addRange()
67 size = to.ordinal() - from.ordinal() + 1; in addRange()
DEnumSet.java358 public static <E extends Enum<E>> EnumSet<E> range(E from, E to) { in range() argument
359 if (from.compareTo(to) > 0) in range()
360 throw new IllegalArgumentException(from + " > " + to); in range()
361 EnumSet<E> result = noneOf(from.getDeclaringClass()); in range()
362 result.addRange(from, to); in range()
370 abstract void addRange(E from, E to); in addRange() argument
DRegularEnumSet.java48 void addRange(E from, E to) { in addRange() argument
49 elements = (-1L >>> (from.ordinal() - to.ordinal() - 1)) << from.ordinal(); in addRange()
/libcore/dom/src/test/java/
DREADME1 all classes under org.w3c.domts are from the official w3c test suite.
2 Level 1 Core tests and Level 2 Core tests from
/libcore/ojluni/src/main/java/sun/reflect/misc/
DReflectUtil.java191 public static boolean needsPackageAccessCheck(ClassLoader from, ClassLoader to) { in needsPackageAccessCheck() argument
192 if (from == null || from == to) in needsPackageAccessCheck()
198 return !isAncestor(from, to); in needsPackageAccessCheck()
/libcore/ojluni/src/main/java/java/time/zone/
DIcuZoneRulesProvider.java135 TimeZoneRule from = transition.getFrom(); in generateZoneRules() local
138 if (from.getRawOffset() != to.getRawOffset()) { in generateZoneRules()
141 millisToOffset(from.getRawOffset()), in generateZoneRules()
145 int fromTotalOffset = from.getRawOffset() + from.getDSTSavings(); in generateZoneRules()
159 preLastDstSavings = from.getDSTSavings(); in generateZoneRules()
/libcore/ojluni/src/main/java/java/time/
DMonth.java211 public static Month from(TemporalAccessor temporal) { in from() method in Month
216 if (IsoChronology.INSTANCE.equals(Chronology.from(temporal)) == false) { in from()
217 temporal = LocalDate.from(temporal); in from()
609 if (Chronology.from(temporal).equals(IsoChronology.INSTANCE) == false) { in adjustInto()
DMonthDay.java261 public static MonthDay from(TemporalAccessor temporal) { in from() method in MonthDay
266 if (IsoChronology.INSTANCE.equals(Chronology.from(temporal)) == false) { in from()
267 temporal = LocalDate.from(temporal); in from()
303 return formatter.parse(text, MonthDay::from); in parse()
622 if (Chronology.from(temporal).equals(IsoChronology.INSTANCE) == false) { in adjustInto()
/libcore/ojluni/src/main/java/java/time/chrono/
DChronology.java177 static Chronology from(TemporalAccessor temporal) { in from() method
472 return date(temporal).atTime(LocalTime.from(temporal)); in localDateTime()
504 ZoneId zone = ZoneId.from(temporal); in zonedDateTime()
506 Instant instant = Instant.from(temporal); in zonedDateTime()
/libcore/ojluni/annotations/hiddenapi/java/util/
DArrays.java499 public static <T> T[] copyOfRange(T[] original, int from, int to) { in copyOfRange() argument
504 U[] original, int from, int to, java.lang.Class<? extends T[]> newType) { in copyOfRange() argument
508 public static byte[] copyOfRange(byte[] original, int from, int to) { in copyOfRange() argument
512 public static short[] copyOfRange(short[] original, int from, int to) { in copyOfRange() argument
516 public static int[] copyOfRange(int[] original, int from, int to) { in copyOfRange() argument
520 public static long[] copyOfRange(long[] original, int from, int to) { in copyOfRange() argument
524 public static char[] copyOfRange(char[] original, int from, int to) { in copyOfRange() argument
528 public static float[] copyOfRange(float[] original, int from, int to) { in copyOfRange() argument
532 public static double[] copyOfRange(double[] original, int from, int to) { in copyOfRange() argument
536 public static boolean[] copyOfRange(boolean[] original, int from, int to) { in copyOfRange() argument
/libcore/luni/src/test/java/libcore/java/lang/
DProcessBuilderTest.java352 Redirect a = Redirect.from(file); in testRedirect_hashCodeDependsOnFile()
353 Redirect b = Redirect.from(otherFile); in testRedirect_hashCodeDependsOnFile()
370 assertSymmetricEquals(Redirect.from(fileB), Redirect.from(fileB2)); in testRedirect_equals()
377 Redirect.from(fileA), in testRedirect_equals()
380 Redirect.from(fileB), in testRedirect_equals()
403 assertRedirectFileAndType(file, Type.READ, Redirect.from(file)); in testRedirect_fileAndType()
419 assertRedirects(Redirect.from(file), PIPE, PIPE, new ProcessBuilder().redirectInput(file)); in testRedirect_setAndGet()
422 assertRedirects(Redirect.from(file), INHERIT, Redirect.to(file), in testRedirect_setAndGet()

1234567