Unnamed: 0 int64 0 305k | body stringlengths 7 52.9k | name stringlengths 1 185 |
|---|---|---|
39,100 | void (@Deprecated int p03) { } | m2 |
39,101 | void (@Deprecated int p23) { } | m2 |
39,102 | void () { TestClassNestedInitializer obj = new TestClassNestedInitializer() { {secret = "one";} }; System.out.println(obj.secret); } | test |
39,103 | void (String r2) { switch (r2) { case "first": System.out.println("1"); break; case "second": System.out.println("2"); case "third": System.out.println("3"); break; case null, default: System.out.println("default null"); } } | testString |
39,104 | void (String r2) { switch (r2) { case "first": System.out.println("1"); break; case "second": System.out.println("2"); break; case String s: System.out.println(s); } } | testString2 |
39,105 | void (String r2) { switch (r2) { case "first": System.out.println("1"); break; case "second": System.out.println("2"); break; case null: System.out.println("null"); break; case String s: System.out.println(s); } } | testString3 |
39,106 | void (Byte r2) { switch (r2) { case 1: break; case 2: System.out.println("2"); break; case null: default: System.out.println("default, null"); } } | testByte |
39,107 | void (Character r2) { switch (r2) { case '1': case '2': System.out.println("2"); break; case null: default: System.out.println("default, null"); } } | testChar |
39,108 | void (Integer r2) { switch (r2) { case 1: break; case 3: System.out.println("2"); break; case null: default: System.out.println("default, null"); } } | testInt |
39,109 | void (Integer r2) { switch (r2) { case 1: break; case 3: System.out.println("2"); break; default: System.out.println("default"); } } | testInt2 |
39,110 | void (Numbers r2) { switch (r2) { case Numbers.FIRST: break; case SECOND: System.out.println("2"); break; case null: System.out.println("null"); } } | testEnum |
39,111 | void (Numbers r2) { switch (r2) { case Numbers.FIRST: break; case SECOND: System.out.println("2"); break; case null: System.out.println("null"); } } | testEnum2 |
39,112 | void (Numbers r2) { switch (r2) { case Numbers.FIRST: break; case SECOND: System.out.println("2"); break; case null: System.out.println("null"); break; case Numbers n: System.out.println(n); } } | testEnum3 |
39,113 | void (Numbers r2) { switch (r2) { case Numbers.FIRST: break; case SECOND: System.out.println("2"); break; default: System.out.println("default"); } } | testEnum4 |
39,114 | void (Numbers r2) { switch (r2) { case SECOND: System.out.println("2"); break; case null, default: System.out.println("default"); } } | testEnum5 |
39,115 | int () { int hash = 7; hash = 23 * hash; hash *= 23; return hash; } | test1 |
39,116 | void () { int k = 3; System.out.println(k); k++; System.out.println(k); ++k; System.out.println(k); } | test2 |
39,117 | int (boolean status, int[] values) { return status ? values[0] : values[1]; } | simpleIff |
39,118 | int (boolean status, int[] values) { if (status) { return values[0]; } else { return values[1]; } } | simpleIf |
39,119 | int (boolean status, boolean condition, int[] values) { if (status) { if (condition) { return values[2]; } else { return values[0]; } } else { return values[1]; } } | nestedIf |
39,120 | int (int mc1, int mc2, byte csg1, byte csg2, double score1, double score2, int doc1, int doc2) { if (mc1 != mc2) { return mc1 < mc2 ? 1 : -1; } if (csg1 != csg2) { return csg1 < csg2 ? 1 : -1; } if (Math.abs(score1 - score2) < 1e-6) { return doc1 < doc2 ? -1 : 1; } return score1 < score2 ? 1 : -1; } | compareTo |
39,121 | void () { while (true) { System.out.println(); } } | testSimpleInfinite |
39,122 | void () { boolean a = (Math.random() > 0); while (true) { try { if (!a) { return; } } finally { System.out.println("1"); } } } | testFinally |
39,123 | void () { boolean a = (Math.random() > 0); for (; ; ) { try { System.out.println("1"); } finally { if (a) { System.out.println("3"); continue; } } System.out.println("4"); } } | testFinallyContinue |
39,124 | int (String in) { int len = in.length(); int i = 0; boolean decSeen = false; boolean signSeen = false; int decPt = 0; char c; int nLeadZero = 0; int nTrailZero= 0; skipLeadingZerosLoop: while (i < len) { c = in.charAt(i); if (c == '0') { nLeadZero++; } else if (c == '.') { if (decSeen) { // already saw one ., this is t... | testWhileCombined |
39,125 | void (List list) { List a = list; if (a != null) { (a = new ArrayList(a)).add("23"); } System.out.println(a.size()); } | test |
39,126 | void (String[] args) { } | main |
39,127 | void (Object o) { switch (o) { case R2(String s, String s2) when s.length() > 123456789 -> { if (s.length() == 2) { System.out.println(o); } } case R2(String s, String s2) when s.length() > 2 -> { if (s.length() == 2) { System.out.println(o); } } case R2(String s, Object s2) when s.length() > 45 -> { if (s.length() == ... | testNestedSwitches |
39,128 | void (Object o) { switch (o) { case R2(String s1, String s2) -> { if (s2.isEmpty()) { System.out.println("3"); } } default -> System.out.println("3"); } System.out.println("1"); } | testStringString |
39,129 | void (Object o) { switch (o) { case R2(String s, String s2) when s2.length() > 11 -> { if (s.length() == 9) { System.out.println(o); } } case R2(Object s, R1(String s2)) when s2.length() > 7 -> { if (s.hashCode() == 2) { System.out.println(o); } } case Object ob -> System.out.println(o); } } | testNestedLevel2 |
39,130 | void (Object o) { switch (o) { case R2(String s, String s2) when s2.length() > 10 -> { if (s.length() == 9) { System.out.println(o); } } case R2(Number s, String s2) when s2.length() > 9 -> { if (s.hashCode() == 9) { System.out.println(o); } } case R2(String s, Object s2) when s.length() > 7 -> { if (s.length() == 2) {... | testNumberString |
39,131 | void (Object o) { switch (o) { case R1(R1(String s)) when s.hashCode() == 5 -> { System.out.println("123456789"); } case R1(String s) when s.hashCode() == 3 -> { System.out.println("3"); } default -> System.out.println("3"); } System.out.println("1"); } | test2DeepDeconstruction |
39,132 | void (Object o) { switch (o) { case R2(String s, String s2) when s.length() > 3 -> { if (s.length() == 2) { System.out.println(o); } } case R2(String s, String s2) when s.length() > 4 -> { if (s.length() == 2) { System.out.println(o); } } case R2(String s, Object s2) when s.length() > 3 -> { if (s.length() == 2) { Syst... | testDoubleLongCase |
39,133 | int () { int i=1; assert i > 1; assert i> 1 && i < 5; return 1; } | foo |
39,134 | void (Object o) { Task: while (true) { for (int i = 0; i < o.hashCode(); i++) { switch (o) { case String s: System.out.println("s"); System.exit(0); break; case Integer in: System.out.println("ii"); continue Task; case Object ob: System.out.println("s"); break Task; } } } } | testObject |
39,135 | void (Object o) { Task: while (true) { for (int i = 0; i < o.hashCode(); i++) { switch (o) { case String s -> { System.out.println("s"); System.exit(0); break; } case Integer in -> { System.out.println("ii"); continue Task; } case Object ob -> { System.out.println("s"); break Task; } } } } } | testObject2 |
39,136 | void (final String property) { TestStaticNameClash.property = property; } | setProperty |
39,137 | void (int a) { switch (a) { case 13: System.out.println(13); return; case 5: System.out.println(5); } } | testCaseOrder |
39,138 | void (char os) { switch (os) { case 'u': lineBreak = '\r'; break; case 'w': lineBreak = '\n'; break; } } | setLineBreak |
39,139 | void () { setLineBreak('w'); } | init |
39,140 | String (String text) { if (text.charAt(0) == '\t') { text = text.replace('\t', ' '); } return text; } | convertIndentation |
39,141 | void () { System.out.println('a'); System.out.println('\t'); System.out.println(0); System.out.println(65); System.out.println(120); System.out.println(32760); System.out.println(32761); System.out.println(35000); System.out.println(50000); System.out.println(128000); System.out.println(60793); System.out.println(60737... | printalot |
39,142 | char (int val) { if (0 <= val && val <= 127) { return 'X'; } else if (-128 <= val && val <= 127) { return 'B'; } else if (128 <= val && val <= 32767) { return 'Y'; } else if (-32768 <= val && val <= 32767) { return 'S'; } else if (32768 <= val && val <= 0xFFFF) { return 'C'; } else { return 'I'; } } | guessType |
39,143 | int (char type) { int maxValue; switch (type) { case 'X': maxValue = 128; break; case 'B': maxValue = 127; break; case 'Y': maxValue = 32768; break; case 'S': maxValue = 32767; break; case 'C': maxValue = 0xFFFF; break; default: maxValue = Integer.MAX_VALUE; } return maxValue; } | getTypeMaxValue |
39,144 | void (Object o) { Task: while (true) { for (int i = 0; i < o.hashCode(); i++) { switch (o) { case String s: System.out.println("s"); System.exit(0); break; case Integer in: System.out.println("ii"); continue Task; case Object ob: System.out.println("s"); break Task; } } } } | testObject |
39,145 | void (Object o) { Task: while (true) { for (int i = 0; i < o.hashCode(); i++) { switch (o) { case String s -> { System.out.println("s"); System.exit(0); break; } case Integer in -> { System.out.println("ii"); continue Task; } case Object ob -> { System.out.println("s"); break Task; } } } } } | testObject2 |
39,146 | void () { ((Runnable)r::foo).run(); } | foo |
39,147 | void (String[] args) { } | main |
39,148 | void (Object o) { if (o instanceof R(Object s1)) { System.out.println(s1); } System.out.println("1"); } | instanceOfTest1 |
39,149 | void (Object o) { int a = 1; try { if (o instanceof R(String s1)) { a += 34; } } catch (Exception e) { if (o instanceof R(String s1)) { a += 34; } } } | tryInstanceOfTest1 |
39,150 | void (Object o) { if (!(o instanceof R(Object s1))) { return; } else if (s1.hashCode() == 1) { System.out.println(s1); System.out.println("1"); } } | negativeInstanceOfTest1 |
39,151 | void (Object o) { if (o instanceof R(String s1)) { System.out.println(s1); if (s1.hashCode() == 1) { System.out.println("1"); } } System.out.println("5"); } | instanceOfTest2 |
39,152 | void (Object o) { if (o instanceof R(String s1)) { if (s1.isEmpty()) { System.out.println("111"); System.out.println("111"); System.out.println("111"); System.out.println("111"); } } System.out.println("s222222222222"); System.out.println("s222222222222"); } | instanceOfTest3 |
39,153 | void (Object o) { if (o.hashCode() == 1) { if (o instanceof R(String s1)) { if (o instanceof R(String s2)) { if (s1.isEmpty()) { System.out.println("111"); System.out.println("111"); System.out.println("111"); System.out.println("111"); } } } } System.out.println("s222222222222"); System.out.println("s222222222222"); } | instanceOfTest4 |
39,154 | void (Object o, Object o2) { if (o instanceof R(Object s1)) { System.out.println(s1); } if (o2 instanceof R(Object r)) { System.out.println(r); } System.out.println("s2222222"); } | instanceOfTestDouble1 |
39,155 | void (Object o, Object o2) { if (o instanceof R(Object s1)) { System.out.println(s1); } if (o2 instanceof R(String r)) { System.out.println(r); } System.out.println("2222222"); } | instanceOfTestDouble2 |
39,156 | void (Object o, Object o2) { if (!(o instanceof R(Object s1))) { return; } System.out.println(s1); if (!(o2 instanceof R(String r))) { return; } System.out.println(r); System.out.println("2222222"); } | instanceOfTestDoubleNegate2 |
39,157 | void () {} | fooS |
39,158 | void () {} | foo |
39,159 | void (long a, long b) {} | fooSParams |
39,160 | void (long a, long b) {} | fooParams |
39,161 | void (String[] args) { test1("1"); test2("1"); test3("1"); } | main |
39,162 | void (String r2) { switch (r2) { case "2" -> System.out.println("4"); case "3" -> System.out.println("2"); default -> System.out.println("31"); } } | test1 |
39,163 | void (String r2) { switch (r2) { case "2": break; default: System.out.println("31"); break; case "3": System.out.println("2"); break; } } | test2 |
39,164 | void (String r2) { switch (r2) { case "2": default: System.out.println("31"); break; case "3": System.out.println("2"); break; } } | test3 |
39,165 | int (int a) { synchronized (this) { a++; } return a++; } | test |
39,166 | void (String a) { System.out.println(a); } | test2 |
39,167 | void (String[] args) { } | main |
39,168 | void (Object o) { switch (o) { case R1(String s1, String s2) -> { if (s2.isEmpty()) { System.out.println("2"); } } default -> System.out.println("3"); } System.out.println("1"); } | testStringString |
39,169 | void (Object o) { switch (o) { case R1(String s1, Object s2) when s1.hashCode() == 3 -> { if (s1.hashCode() == 1) { System.out.println("2"); System.out.println("2"); System.out.println("2"); } } default -> System.out.println("3"); } System.out.println("1"); } | testStringObjectWhen |
39,170 | void (Object o) { switch (o) { case R1(String s1, Object s2) -> { if (s1.isEmpty()) { System.out.println("1"); } } default -> System.out.println("3"); } System.out.println("1"); } | testStringObject |
39,171 | void (Object o) { switch (o) { case R1(Object s1, String s2) -> { if (s1.hashCode() == 1) { System.out.println("1"); } } default -> System.out.println("3"); } System.out.println("1"); } | testObjectString |
39,172 | void (Object o) { switch (o) { case R1(Object s1, Object s2) -> { if (s1.hashCode() == 1) { System.out.println("1"); } } default -> System.out.println("3"); } System.out.println("1"); } | testObjectObject |
39,173 | int () { String text = "text"; long prolonged = 42L; float decimated = prolonged / 10.0f; double doubled = 2 * decimated; return (text + ":" + prolonged + ":" + decimated + ":" + doubled).length(); } | m |
39,174 | void () { int i = 0; int count = 0; do { i += count++; } while( i < 10 ); } | test |
39,175 | void () { printAll("Test"); printAll("Test: %s", "abc"); printAll("Test: %s - %s", "abc", "DEF"); printComplex("Test"); printComplex("Test: %[0]s", new String[] { "abc" }); printComplex("Test: %[0]s - %[0]s", new String[] { "abc" }, new String[] { "DEF" }); String.format("Test"); String.format("Test: %d", 123); String.... | doSmth |
39,176 | void (String fmt, String... params) { System.out.println(String.format(fmt, (Object[]) params)); } | printAll |
39,177 | void (String fmt, String[]... params) { System.out.println(String.format(fmt, (Object[]) params)); } | printComplex |
39,178 | void () { int a =5; } | byComment |
39,179 | void () { int a =5; } | byAnno |
39,180 | void () { } | m |
39,181 | void () { } | m |
39,182 | void () { } | m |
39,183 | int () { System.out.println("before"); run(new Runnable() { @Override public void run() { System.out.println("Runnable"); } }); test2("1"); if(Math.random() > 0) { System.out.println("0"); return 0; } else { System.out.println("1"); return 1; } } | test |
39,184 | void () { System.out.println("Runnable"); } | run |
39,185 | void (String a) { try { Integer.parseInt(a); } catch (Exception e) { System.out.println(e); } finally { System.out.println("Finally"); } } | test2 |
39,186 | void () { System.out.println("Inner"); } | print |
39,187 | void () { System.out.println("Inner2"); } | print |
39,188 | int () { return f; } | getF |
39,189 | int () { return f; } | getF |
39,190 | int () { int SharedName2 = i; pkg.SharedName1.f = j; // (+)FieldExprent. SharedName1 class name is shadowed by a variable in this class int x = pkg.SharedName2.f; // (+)FieldExprent. SharedName2 class name is shadowed by a variable in this method NonSharedName.f = k; // (-)ExprProcessor. The NonSharedName is not used f... | m |
39,191 | void () {} | f |
39,192 | void (String[] args) { } | main |
39,193 | void (Object o) { if (o instanceof R(R(Object s1))) { System.out.println(s1); System.out.println(s1); } System.out.println("1"); } | instanceOfTest1 |
39,194 | void (Object o) { if (o instanceof R(R(String s1))) { System.out.println(s1); System.out.println(s1); } System.out.println("4"); } | instanceOfTest2 |
39,195 | void (Object o) { if (o instanceof R2(String s1, Object s2)) { System.out.println(s1); System.out.println(s1); } System.out.println("12"); } | instanceOfTest3 |
39,196 | void (Object o) { if (o instanceof R2(Object s2, String s1)) { System.out.println(s1); System.out.println(s1); } System.out.println("3"); } | instanceOfTest3_2 |
39,197 | void (Object o) { if (o instanceof R2(String s1, R(String s))) { System.out.println(s1); System.out.println(s); if (o instanceof R2(String s2, R(String s3))) { System.out.println(s2); System.out.println(s3); } } System.out.println("1"); } | instanceOfTest4 |
39,198 | void (Object collectionFactory) { Class a = null; Function f = r1 -> collectionFactory; Function f1 = r1 -> a; Function f2 = r1 -> r1; } | toCollection |
39,199 | String (String prefix, int a) { return prefix + a; } | test1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.