Unnamed: 0 int64 0 305k | body stringlengths 7 52.9k | name stringlengths 1 185 |
|---|---|---|
55,600 | double (boolean flag, int x, double y) { double result = flag ? x : y; return result; } | intOrDoubleAsDouble |
55,601 | long (int x1, int x2) { return x1 | ((long) x2 << 32); } | foo |
55,602 | byte (List<Byte> xs) { return xs.get(0).byteValue(); } | testByte |
55,603 | short (List<Short> xs) { return xs.get(0).shortValue(); } | testShort |
55,604 | int (List<Integer> xs) { return xs.get(0).intValue(); } | testInt |
55,605 | long (List<Long> xs) { return xs.get(0).longValue(); } | testLong |
55,606 | float (List<Float> xs) { return xs.get(0).floatValue(); } | testFloat |
55,607 | double (List<Double> xs) { return xs.get(0).doubleValue(); } | testDouble |
55,608 | int (int x) { return x - '0'; } | foo |
55,609 | String () { return string; } | toString |
55,610 | void (String[] args) { int notNull = 0; Integer[] a1 = new Integer[2]; a1[0] = null; a1[1] = notNull; System.out.println(a1[0]); System.out.println(a1[1]); Integer[] a2 = new Integer[2]; a2[0] = nullable(); a2[1] = notNull; System.out.println(a2[0]); System.out.println(a2[1]); Integer[] a3 = new Integer[] { null, nulla... | main |
55,611 | Integer () { return System.getProperty("user.home").length() > 20 ? null : 1; } | nullable |
55,612 | boolean () { return IS_LINUX; } | isLinux |
55,613 | boolean () { return IS_LINUX; } | isLinux |
55,614 | void (String[] args) { System.out.println(new C().a); // prints 12 } | main |
55,615 | void (String[] args) { Object x = new ; } | main |
55,616 | void (String[] args) { try { } catch (){ } } | main |
55,617 | void () { } | test |
55,618 | int () { return Z.MAGIC; } | foo |
55,619 | void () { new Inner().x(); } | m |
55,620 | void () { } | x |
55,621 | Object () { return new Marker(); } | foo |
55,622 | void () { privateStatic1(); privateStatic2(); } | foo |
55,623 | void () { privateStatic1(); } | publicStatic |
55,624 | void () {} | privateStatic1 |
55,625 | void () {} | privateStatic2 |
55,626 | void () { privateStatic1(); privateStatic2(); } | foo |
55,627 | void () {} | privateStatic1 |
55,628 | void () {} | privateStatic2 |
55,629 | void () { privateStatic1(); privateStatic2(); } | foo |
55,630 | void () {} | privateStatic1 |
55,631 | void () {} | privateStatic2 |
55,632 | void () { } | foo |
55,633 | void () { Derived.foo(); } | test |
55,634 | void () {} | privateStatic1 |
55,635 | void () {} | privateStatic2 |
55,636 | void () {} | privateStatic1 |
55,637 | void () {} | privateStatic2 |
55,638 | void (String[] args) { Rectangle rectangle = new Rectangle(); rectangle.x = 1; rectangle.y = 2; } | main |
55,639 | void () { List<Object> xs = new ArrayList<Object>(); List<Object> ys = new ELinkedList<Object>(); ArrayList<Object> zs = new ArrayList<Object>(); xs.add(null); ys.add(null); xs.clear(); ys.clear(); zs.add(null); } | test |
55,640 | void () { ArrayList<Object> xs = new ArrayList<Object>(); List<Object> ys = new ELinkedList<Object>(); for (Object x : xs) { ys.add(x); } for (Object y : ys) { xs.add(y); } } | test |
55,641 | int () { return 0; } | getInt |
55,642 | boolean (int x, int y) { return x < y; } | f1 |
55,643 | boolean (int x, int y) { if (false) { return false; } return x < y; } | f2 |
55,644 | void (List<String> lst) { List<String> streamOfList = lst.stream() .map(x -> x + "e") .collect(Collectors.toList()); List<Integer> streamOfElements = Stream.of(1, 2, 3) .map(x -> x + 1) .collect(Collectors.toList()); Integer[] array = {1, 2, 3}; List<Integer> streamOfArray = Arrays.stream(array) .map(x -> x + 1) .colle... | main |
55,645 | void (List<String> lst) { List<String> toList = lst.stream().collect(Collectors.toList()); Set<String> toSet = lst.stream().collect(Collectors.toSet()); long count = lst.stream().count(); boolean anyMatch = lst.stream().anyMatch(v -> v.isEmpty()); boolean allMatch = lst.stream().allMatch(v -> v.isEmpty()); boolean none... | main |
55,646 | void () { List<String> activities = Stream.of("12") .map(v -> v + "nya") .filter(v -> v != null) .flatMap(v -> Stream.of(v) .flatMap(s -> Stream.of(s)) ).filter(v -> { String name = v.getClass().getName(); if (name.equals("name")) { return false; } return !name.equals("other_name"); }) .collect(Collectors.toList()); } | main |
55,647 | void (List<Integer> lst) { List<Integer> newLst = /*before list*/lst/*after list*/./*before stream*/stream()/* after stream*/ .filter(x -> x > 10) .map(x -> x + 2)/*some comment*/./*another comment*/distinct()/* one more comment */.sorted()/*another one comment*/ .sorted(Comparator.<Integer>naturalOrder()) .peek(x -> S... | main |
55,648 | void (List<Integer> lst) { List<Integer> newLst = lst.stream() .filter(x -> x > 10) .map(x -> x + 2) .distinct() .sorted() .sorted(Comparator.<Integer>naturalOrder()) .peek(x-> System.out.println(x)) .limit(1) .skip(42) .collect(Collectors.toList()); } | main |
55,649 | void (List<String> lst) { Stream<Integer> stream = Stream.of(1); List<Integer> list = stream.collect(Collectors.toList()); } | main |
55,650 | void (String[] args) { } | main |
55,651 | int () { return super.hashCode(); } | hashCode |
55,652 | boolean (Object o) { return super.equals(o); } | equals |
55,653 | String () { return super.toString(); } | toString |
55,654 | int () { return super.hashCode(); } | hashCode |
55,655 | boolean (Object o) { return super.equals(o); } | equals |
55,656 | String () { return super.toString(); } | toString |
55,657 | void () {} | foo |
55,658 | Java8Class () { return new Java8Class(); } | staticFun |
55,659 | int () {return 1;} | memberFun |
55,660 | String () { return "1"; } | testOverloads |
55,661 | String (int i) { return "2"; } | testOverloads |
55,662 | void () { Function0 staticFunFromSameClass = Java8Class::staticFun; staticFunFromSameClass.invoke(); Function0 staticFunFromAnotherClass = Test::staticFun; staticFunFromAnotherClass.invoke(); } | testStaticFunction |
55,663 | void () { Function1<Java8Class, Integer> memberFunFromClass = Java8Class::memberFun; memberFunFromClass.invoke(new Java8Class()); } | testMemberFunctionThroughClass |
55,664 | void () { Java8Class obj = new Java8Class(); Function0 memberFunFromSameClass = obj::memberFun; memberFunFromSameClass.invoke(); Test anotherObj = new Test(); Function0 memFunFromAnotherClass = anotherObj::memberFun; memFunFromAnotherClass.invoke(); Function0 memberFunThroughObj1 = field::memberFun; memberFunThroughObj... | testMemberFunctionThroughObject |
55,665 | void () { Function0 constructorSameClass = Java8Class::new; constructorSameClass.invoke(); Function0 qualifiedConstructorSameClass = test.Java8Class::new; qualifiedConstructorSameClass.invoke(); Function0 constructorAnotherClass = Test::new; constructorAnotherClass.invoke(); Function0 qualifiedConstructorAnotherClass =... | testConstructor |
55,666 | void () { Function1<String, Integer> memberFunFromClass = String::length; memberFunFromClass.invoke("str"); } | testLibraryFunctions |
55,667 | void () { Function0<String> constructorWithoutParams = Test::testOverloads; constructorWithoutParams.invoke(); Function1<Integer, String> constructorWithParam = Test::testOverloads; constructorWithParam.invoke(2) + 42; } | testOverloads |
55,668 | void () { Function0<List<String>> emptyList = Collections::emptyList; List<String> list = emptyList.invoke(); list.get(0); } | testGenericFunctions |
55,669 | int () { return 1; } | memberFun |
55,670 | int () { return super.hashCode(); } | hashCode |
55,671 | boolean (Object o) { return super.equals(o); } | equals |
55,672 | double () { return foo(1, this::toDouble); } | nya |
55,673 | int () { return super.hashCode(); } | hashCode |
55,674 | String () { return super.toString(); } | toString |
55,675 | Java8Class () { return new Java8Class(); } | staticFun |
55,676 | int () { return 1; } | memberFun |
55,677 | String () { return "1"; } | testOverloads |
55,678 | String (int i) { return "2"; } | testOverloads |
55,679 | void () { JFunction0 staticFunFromSameClass = Java8Class::staticFun; staticFunFromSameClass.foo(); MethodReferenceHelperClass.staticFun0(Java8Class::staticFun); h.memberFun0(Java8Class::staticFun); JFunction0 staticFunFromAnotherClass = Test::staticFun; staticFunFromAnotherClass.foo(); MethodReferenceHelperClass.static... | testStaticFunction |
55,680 | void () { JFunction2<Java8Class, Integer> memberFunFromClass = Java8Class::memberFun; memberFunFromClass.foo(new Java8Class()); MethodReferenceHelperClass.staticFun2(Java8Class::memberFun); h.memberFun2(Java8Class::memberFun); } | testMemberFunctionThroughClass |
55,681 | void () { Java8Class obj = new Java8Class(); JFunction0 memberFunFromSameClass = obj::memberFun; memberFunFromSameClass.foo(); MethodReferenceHelperClass.staticFun0(obj::memberFun); h.memberFun0(obj::memberFun); Test anotherObj = new Test(); JFunction0 memFunFromAnotherClass = anotherObj::memberFun; memFunFromAnotherCl... | testMemberFunctionThroughObject |
55,682 | void () { JFunction0 constructorSameClass = Java8Class::new; constructorSameClass.foo(); MethodReferenceHelperClass.staticFun0(Java8Class::new); h.memberFun0(Java8Class::new); JFunction0 qualifiedConstructorSameClass = test.Java8Class::new; qualifiedConstructorSameClass.foo(); MethodReferenceHelperClass.staticFun0(test... | testConstructor |
55,683 | void () { JFunction2<String, Integer> memberFunFromClass = String::length; memberFunFromClass.foo("str"); new Thread(System.out::println).start(); ((Runnable) System.out::println).run(); } | testLibraryFunctions |
55,684 | void () { JFunction1<String> constructorWithoutParams = Test::testOverloads; constructorWithoutParams.foo(); MethodReferenceHelperClass.<String>staticFun1(Test::testOverloads); h.<String>memberFun1(Test::testOverloads); JFunction2<Integer, String> constructorWithParam = Test::testOverloads; constructorWithParam.foo(2);... | testOverloads |
55,685 | void () { JFunction1<List<String>> emptyList = Collections::emptyList; emptyList.foo(); MethodReferenceHelperClass.<List<String>>staticFun1(Collections::emptyList); h.<List<String>>memberFun1(Collections::emptyList); } | testGenericFunctions |
55,686 | int () { return 1; } | staticFun |
55,687 | int () { return 1; } | memberFun |
55,688 | void ( int p1, int p2) { } | foo2 |
55,689 | void (int p1, int p2) { } | foo3 |
55,690 | void ( int p1, int p2, int p3, int p4 ) { } | foo4 |
55,691 | void (Function0<String> r) { } | foo0 |
55,692 | void (Function1<Integer, String> r) { } | foo1 |
55,693 | void (Function2<Integer, Integer, String> r) { } | foo2 |
55,694 | void () { } | helper |
55,695 | boolean (Object o) { return super.equals(o); } | equals |
55,696 | double () { return foo(1, this::toDouble); } | nya |
55,697 | byte () { return 0; } | getByte |
55,698 | void () { } | run |
55,699 | void (String[] args) { <selection>String s = 1;</selection> } | main |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.