Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
55,500
void () { int a = 10; float b = 0.7f; acceptDouble(a * b) acceptDoubleBoxed(a * b) }
conversion
55,501
int (byte[] b) { int i = 0, result = 0, shift = 0; while (i < b.length) { byte be = b[i]; result |= (be & 0xff) << shift; shift += 8; i += 1; } return result; }
byteToInt
55,502
void (byte b, char c, short s, int i, long l) { System.out.println(b >> i); System.out.println(b >>> i); System.out.println(b << i); System.out.println(b << l); System.out.println(b << 5); System.out.println(5 << b); System.out.println(b & b); System.out.println(b & 0x01); System.out.println(b | b); System.out.println(...
foo
55,503
void (int i) { System.out.println(new A(1)); System.out.println(new A(i)); A a1 = new A(1); A a2 = new A(i); }
testPrimary
55,504
void (int i) { System.out.println(new B(1, 1)); System.out.println(new B(i, i)); B b1 = new B(1, 1); B b2 = new B(i, i); }
testSecondary
55,505
void (int i) { new Runnable() { @Override public void run() { System.out.println(new C(1)); System.out.println(new C(i)); foo(1); foo(i); } }; }
testAnonymousClass
55,506
void () { System.out.println(new C(1)); System.out.println(new C(i)); foo(1); foo(i); }
run
55,507
void (Boolean bool, Character c, Byte b, Short s, Integer i, Long l, Float f, Double d, Object obj) { System.out.println(bool.booleanValue()); System.out.println(c.charValue()); System.out.println(b.byteValue()); System.out.println(s.shortValue()); System.out.println(i.intValue()); System.out.println(l.longValue()); Sy...
foo
55,508
void (String[] args) { boolean ANDAND = true && true && true; boolean OROR = true || true || true; int PLUS = 1 + 2 + 3; int MINUS = 1 - 2 - 3; int ASTERISK = 1 * 2 * 3; int DIV = 1 / 2 / 3; int PERC = 1 % 2 % 3; int GTGT = 1 << 2 << 3; int LTLT = 1 >> 2 >> 3; int XOR = 1 ^ 2 ^ 3; int AND = 1 & 2 & 3; int OR = 1 % 2 % ...
main
55,509
void (String[] args) { System.out.println("5" + 1); System.out.println(1 + "5"); System.out.println(1 + 3 + "5"); System.out.println((1 + 3) + "5"); System.out.println("5" + "5" + (1 + 3)); System.out.println("5" + "5" + 1 + 3); System.out.println("5" + "5" + 1); System.out.println("5" + ("5" + 1) + 3); System.out.prin...
main
55,510
boolean (String text) { return text == null || (text.length() != 2 && text.length() != 3 && asFoo(text) != Foo.BAD) || asFoo(text) == Foo.GOOD; }
foo
55,511
Foo (String text) { return text.isEmpty() ? Foo.BAD : Foo.GOOD; }
asFoo
55,512
void (String[] args) { System.out.println(0x1234 & 0x1234 >>> 1); // 16 System.out.println(1 | 2 << 3); // 17 System.out.println(1 << 2 | 3); // 7 System.out.println(1 << 2 | 3 >>> 4 & 5); // 4 System.out.println(1 | 2 << 3 & 4 >>> 5); // 1 System.out.println(1 | 2 << 3 & 4 >>> 5 | 6 | 7 & 8); // 7 System.out.println(1...
main
55,513
void (String[] args) { ieee(Double.NaN); }
main
55,514
void (double x) { System.out.println(!(x <= 0)); }
ieee
55,515
String (String category, String name, boolean createWithProject) { return category + ':' + name + ':' + createWithProject; }
getCheckKey
55,516
String () { return string; }
getString
55,517
byte () { return 0; }
getByte
55,518
void (as a) { }
foo
55,519
List<Object> (Collection<String> mutableCollection, Collection<Integer> nullableCollection) { return super.foo(mutableCollection, nullableCollection); }
foo
55,520
void (Owner owner) { owner.list.add(""); }
update
55,521
void () { collection.add("1") }
foo
55,522
Collection<String> () { return collection; }
getCollection
55,523
void () { for (Iterator<String> it = list.iterator(); it.hasNext(); ) { String s = it.next(); if (s.equals("")) it.remove(); } }
test
55,524
void () { list.get(0).add(1) }
test
55,525
void (String name, int maxLen) { String.valueOf(1 + 1); "a".split("\\s+" + "\\s+", 2) kotlinApi.KotlinApiKt.extensionFunction(1 + 1) }
adjust
55,526
void (String[] args) { System.out.println("aA".replaceAll("[a-z]" + "[A-Z]", "b")); }
main
55,527
void (boolean condition, String message, Object... args) { }
checkState
55,528
void (boolean condition) { checkState(condition, "condition not met"); }
checkState
55,529
void (String[] args) { String s = ""; String result = s .replace("_", "/") .concat("=="); String result2 = s .replace("_", "/") // comment .concat("=="); String result3 = s .replace("_", "/").concat("=="); String result4 = s .replace("_", "/").concat("==").replace("_", "/"); String result5 = s .replace("_", "/") .conca...
main
55,530
boolean (Object o) { return super.equals(o); }
equals
55,531
boolean (Object o) { return super.equals(o); }
equals
55,532
boolean (C c) { return false; }
equals
55,533
void (String[] args) { Float posZero = 0.0f; Double negZero = -0.0; System.out.println(posZero.equals(negZero)); System.out.println(Objects.equals(posZero, negZero)); System.out.println(java.util.Objects.equals(posZero, negZero)); System.out.println(posZero.equals(0)); System.out.println(Objects.equals(0, negZero)); Sy...
main
55,534
void (String... args) { String greeting = new String(GREETING); System.out.println(greeting); }
main
55,535
int (@NotNull Book o) { return 0; }
compareTo
55,536
int (HashMap<String, Integer> map) { return map.get("zzz"); }
foo
55,537
void () {}
foo
55,538
void () { this.foo(); }
bar
55,539
void (String[] args) { ClassC a; }
main
55,540
int (String[] args) { return args.length; }
foo
55,541
void (String s) {}
doStuff
55,542
void (String s) { if (s == null) System.out.println("null"); else System.out.println("not null: " + s); }
doStuff
55,543
void (int a) { if (a < 0) throw new RuntimeException("a = " + a); }
bar
55,544
void () { o = null; }
foo
55,545
void (String args[]) { try { FileInputStream fstream = new FileInputStream(new File("file.txt")); DataInputStream in = new DataInputStream(fstream); BufferedReader br = new BufferedReader(new InputStreamReader(in)); String strLine; while ((strLine = br.readLine()) != null) { System.out.println (strLine); } in.close(); ...
main
55,546
String (Collection<Integer> collection) { return "[" + collection.stream().map(Object::toString).collect(Collectors.joining(", ")) + "]"; }
toJSON
55,547
void (String[] args) { List.class.isAssignableFrom(ArrayList.class); }
main
55,548
int (Map<String, String> map) { return map.get("zzz").length(); }
foo
55,549
String (String s) { return last = s; }
foo
55,550
void () { new TestInnerClassCtor.Inner(); }
test
55,551
<T> (T t) { }
G
55,552
void () { int a, b; switch (new Random().nextInt()) { case 0: a = b = 1; break; default: a = b = -1; } System.out.println(a + b); }
x
55,553
void () { /* This is a function comment */ }
foo
55,554
String () { return this.code; }
toString
55,555
String () { return "BASE"; }
toString
55,556
String () { return "Child"; }
toString
55,557
String (String name) { int size = name.length(); return name; }
toFileSystemSafeName
55,558
String[] (int n) { String[] result = new String[n]; for (int i = 0; i < n; ++i) { result[i] = Integer.toString(i); } return result; }
strings
55,559
boolean (Double value) { return value == 3.14; }
test
55,560
void () { setD(1); }
init
55,561
double () { return d; }
getD
55,562
void (double d) { this.d = d; }
setD
55,563
Object[] (Boolean x1, Byte x2, Short x3, Integer x4, Long x5, Float x6, Double x7, Character x8) { return new Object[]{x1, x2, x3, x4, x5, x6, x7, x8}; }
foo
55,564
void () { int i = 1; byte b = 1; short s = 1; long l = 1; double d = 1.0; float f = 1.0f; char c = 1; t(i == i); t(i == b); t(i == s); t(i == l); t(i == d); t(i == f); t(i == c); t(b == i); t(b == b); t(b == s); t(b == l); t(b == d); t(b == f); t(b == c); t(s == i); t(s == b); t(s == s); t(s == l); t(s == d); t(s == f)...
equals
55,565
void () { int i = 1; byte b = 1; short s = 1; long l = 1; double d = 1.0; float f = 1.0f; char c = 1; t(i > i); t(i > b); t(i > s); t(i > l); t(i > d); t(i > f); t(i > c); t(b > i); t(b > b); t(b > s); t(b > l); t(b > d); t(b > f); t(b > c); t(s > i); t(s > b); t(s > s); t(s > l); t(s > d); t(s > f); t(s > c); t(l > i)...
compare
55,566
void (boolean b) { }
t
55,567
boolean (File parent) { if (parent == null || !parent.exists()) { return false; } boolean result = true; if (parent.isDirectory()) { return true; } else return false; }
isDir
55,568
void () { int i = ALL_STYLES; }
foo
55,569
boolean (Language other) { return other.toString().equals(this.toString()); }
equals
55,570
TestPackagePrivateFieldInit (TestPackagePrivateFieldInit h, Object start, Object end) { if (h == null) { return null; } else { h.next = doStuff(h.next, start, end); } int hstart = h.start.hashCode(); int hend = h.end.hashCode(); int s = start.hashCode(); int e = end == null ? Integer.MAX_VALUE : end.hashCode(); if (s <...
doStuff
55,571
void () { List<Double> items = new ArrayList<>(); items.add(1.0); items.forEach(System.out::println); }
context
55,572
void (String key, String msg) { hashMap.merge(key, msg, String::concat); }
update
55,573
void (String key, String msg) { hashMap.merge(key, msg, String::concat); }
update
55,574
int () { return super.hashCode(); }
hashCode
55,575
boolean (Object o) { return super.equals(o); }
equals
55,576
String () { return super.toString(); }
toString
55,577
int () { return super.hashCode(); }
hashCode
55,578
boolean (Object o) { return super.equals(o); }
equals
55,579
String () { return super.toString(); }
toString
55,580
void (DefaultMutableTreeNode node) { for (Enumeration<DefaultMutableTreeNode> e = node.children(); e.hasMoreElements(); ) { DefaultMutableTreeNode child = e.nextElement(); String name = (String) child.getUserObject(); System.out.println(name); } }
test
55,581
T () { return myName; }
getName
55,582
void (String[] args) { Identifier<?> i1 = new Identifier<String>("name", false, true); Identifier i2 = new Identifier<String>("name", false); Identifier i3 = new Identifier<String>("name"); }
main
55,583
void (String s1, String s2) { this.s1 = s1; this.s2 = s2; }
set
55,584
Item (int n) { Item item = new Item(); item.set(readString(n), null); return item; }
readItem
55,585
String (int n) { if (n <= 0) return null; return Integer.toString(n); }
readString
55,586
void (int x) { if ((i = x) > 0) System.out.println(">0"); }
foo
55,587
void (int i) { ints[b] = i; ints[s] = i; }
foo
55,588
ArrayList<SomeClass> () { return null; }
foo
55,589
void (String[] args) { System.out.println("Halo!"); }
main
55,590
T () { return name; }
getName
55,591
void () { System.out.println(TOPDOWNLEFTRIGHT); }
test
55,592
int (int x) { return 'z' + x; }
foo
55,593
Long () { return id; }
getId
55,594
void (Long id) { this.id = id; }
setId
55,595
String () { return createdBy; }
getCreatedBy
55,596
void (String createdBy) { this.createdBy = createdBy; }
setCreatedBy
55,597
String () { return modifiedBy; }
getModifiedBy
55,598
void (String modifiedBy) { this.modifiedBy = modifiedBy; }
setModifiedBy
55,599
void () { for(int i1 = 0; i1 < 1; i1++) System.out.println(i1); byte b = 1; for(int i2 = 0; i2 < b; i2++) System.out.println(i2); short s = 1; for(int i3 = 0; i3 < s; i3++) System.out.println(i3); long l = 1L; for(int i4 = 0; i4 < l; i4++) System.out.println(i4); double d = 1.0; for(int i5 = 0; i5 < d; i5++) System.out...
printNumbers