Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
1,400
boolean () { return base() == NONE && requires().unchanged() && exports().unchanged() && !versionChanged(); }
no
1,401
Diff (Proto past) { final Difference delegate = super.difference(past); final ModuleRepr pastModule = (ModuleRepr)past; final int base = !getUsages().equals(pastModule.getUsages())? delegate.base() | Difference.USAGES : delegate.base(); return new Diff(delegate) { @Override public Specifier<ModuleRequiresRepr, ModuleRequiresRepr.Diff> requires() { return Difference.make(pastModule.myRequires, myRequires); } @Override public Specifier<ModulePackageRepr, ModulePackageRepr.Diff> exports() { return Difference.make(pastModule.myExports, myExports); } @Override public boolean versionChanged() { return pastModule.getVersion() != myVersion; } @Override public int base() { return base; } }; }
difference
1,402
boolean () { return pastModule.getVersion() != myVersion; }
versionChanged
1,403
int () { return base; }
base
1,404
DataExternalizer<ModuleRepr> (final DependencyContext context) { return new DataExternalizer<ModuleRepr>() { @Override public void save(final @NotNull DataOutput out, final ModuleRepr value) { value.save(out); } @Override public ModuleRepr read(final @NotNull DataInput in) { return new ModuleRepr(context, in); } }; }
externalizer
1,405
void (final @NotNull DataOutput out, final ModuleRepr value) { value.save(out); }
save
1,406
ModuleRepr (final @NotNull DataInput in) { return new ModuleRepr(context, in); }
read
1,407
boolean (final int me, final int than) { return (isPrivate(me) && !isPrivate(than)) || (isProtected(me) && isPublic(than)) || (isPackageLocal(me) && (than & (Opcodes.ACC_PROTECTED | Opcodes.ACC_PUBLIC)) != 0); }
weakerAccess
1,408
boolean (int access) { return (access & Opcodes.ACC_PRIVATE) != 0; }
isPrivate
1,409
boolean (int access) { return (access & Opcodes.ACC_PUBLIC) != 0; }
isPublic
1,410
boolean (int access) { return (access & Opcodes.ACC_PROTECTED) != 0; }
isProtected
1,411
boolean (final int access) { return (access & (Opcodes.ACC_PRIVATE | Opcodes.ACC_PROTECTED | Opcodes.ACC_PUBLIC)) == 0; }
isPackageLocal
1,412
Collection<T> () { return Collections.emptySet(); }
added
1,413
Collection<T> () { return Collections.emptySet(); }
removed
1,414
boolean () { return true; }
unchanged
1,415
Collection<T> () { return _now; }
added
1,416
Collection<T> () { return Collections.emptySet(); }
removed
1,417
boolean () { return false; }
unchanged
1,418
Collection<T> () { return Collections.emptySet(); }
added
1,419
Collection<T> () { return _past; }
removed
1,420
boolean () { return false; }
unchanged
1,421
Collection<T> () { return added; }
added
1,422
Collection<T> () { return removed; }
removed
1,423
boolean () { return changed.isEmpty() && added.isEmpty() && removed.isEmpty(); }
unchanged
1,424
Set<String> (String className, ClassReader classReader) { ClassFileRepr classFileRepr = new ClassfileAnalyzer(myContext).analyze(myContext.get(className), classReader, false); if (classFileRepr == null) return Collections.emptySet(); final int classNameId = classFileRepr.name; Set<String> classDependencies = new LinkedHashSet<>(); for (UsageRepr.Usage usage : classFileRepr.getUsages()) { int owner = usage.getOwner(); if (owner != classNameId) { classDependencies.add(myContext.getValue(owner)); } } return classDependencies; }
collectDependencies
1,425
void () { myContext.close(); }
close
1,426
IntSet (IntSet acc, final DataInput in) { try { int size = DataInputOutputUtil.readINT(in); for (int i = 0; i<size; i++) { acc.add(DataInputOutputUtil.readINT(in)); } return acc; } catch (IOException x) { throw new BuildDataCorruptedException(x); } }
read
1,427
void (final BufferedWriter w, final String s) { try { if (s == null) { w.write(""); } else { w.write(s); } w.newLine(); } catch (IOException e) { throw new BuildDataCorruptedException(e); } }
writeln
1,428
Writable (final String s) { return new Writable() { @Override public void write(BufferedWriter w) { writeln(w, s); } }; }
convert
1,429
void (BufferedWriter w) { writeln(w, s); }
write
1,430
String (final BufferedReader r) { try { return r.readLine(); } catch (IOException e) { throw new BuildDataCorruptedException(e); } }
readString
1,431
long (final BufferedReader r) { final String s = readString(r); try { return Long.parseLong(s); } catch (Exception n) { System.err.println("Parsing error: expected long, but found \"" + s + "\""); return 0; } }
readLong
1,432
UsageConstraint (int name) { return residence -> name == residence; }
exactMatch
1,433
boolean (final int key) { return myMap.containsKey(key); }
containsKey
1,434
Collection<V> (final int key) { return myMap.get(key); }
get
1,435
void (IntObjectMultiMaplet<V> m) { m.forEachEntry((vs, value) -> put(value, vs)); }
putAll
1,436
void (final int key, final Collection<V> value) { final Collection<V> x = myMap.get(key); if (x == null) { myMap.put(key, value); } else { x.addAll(value); } }
put
1,437
void (int key, Collection<V> value) { if (value == null || value.isEmpty()) { myMap.remove(key); } else { myMap.put(key, value); } }
replace
1,438
void (final int key, final V value) { final Collection<V> collection = myMap.get(key); if (collection == null) { final Collection<V> x = myCollectionFactory.get(); x.add(value); myMap.put(key, x); } else { collection.add(value); } }
put
1,439
void (final int key, final V value) { final Collection<V> collection = myMap.get(key); if (collection != null) { if (collection.remove(value)) { if (collection.isEmpty()) { myMap.remove(key); } } } }
removeFrom
1,440
void (int key, Collection<V> values) { final Collection<V> collection = myMap.get(key); if (collection != null) { if (collection.removeAll(values)) { if (collection.isEmpty()) { myMap.remove(key); } } } }
removeAll
1,441
void (final int key) { myMap.remove(key); }
remove
1,442
void (IntObjectMultiMaplet<V> m) { m.forEachEntry((vs, value) -> replace(value, vs)); }
replaceAll
1,443
void () { myMap.clear(); // free memory }
close
1,444
void (boolean memoryCachesOnly) { }
flush
1,445
boolean () { return (access & Opcodes.ACC_TRANSITIVE) != 0; }
isTransitive
1,446
int () { return myVersion; }
getVersion
1,447
void (final DataOutput out) { try { super.save(out); DataInputOutputUtil.writeINT(out, myVersion); } catch (IOException e) { throw new BuildDataCorruptedException(e); } }
save
1,448
DataExternalizer<ModuleRequiresRepr> (DependencyContext context) { return new DataExternalizer<ModuleRequiresRepr>() { @Override public void save(@NotNull DataOutput out, ModuleRequiresRepr value) { value.save(out); } @Override public ModuleRequiresRepr read(@NotNull DataInput in) { return new ModuleRequiresRepr(context, in); } }; }
externalizer
1,449
void (@NotNull DataOutput out, ModuleRequiresRepr value) { value.save(out); }
save
1,450
ModuleRequiresRepr (@NotNull DataInput in) { return new ModuleRequiresRepr(context, in); }
read
1,451
Diff (Proto past) { final ModuleRequiresRepr pastRequirement = (ModuleRequiresRepr)past; return new Diff(super.difference(past)) { @Override public boolean versionChanged() { return pastRequirement.myVersion != myVersion; } @Override public boolean no() { return super.no() && !versionChanged(); } @Override public boolean becameNonTransitive() { return pastRequirement.isTransitive() && !ModuleRequiresRepr.this.isTransitive(); } }; }
difference
1,452
boolean () { return pastRequirement.myVersion != myVersion; }
versionChanged
1,453
boolean () { return super.no() && !versionChanged(); }
no
1,454
boolean () { return pastRequirement.isTransitive() && !ModuleRequiresRepr.this.isTransitive(); }
becameNonTransitive
1,455
boolean (Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } return name == ((ModuleRequiresRepr)o).name; }
equals
1,456
int () { return 31 * name; }
hashCode
1,457
void (final DependencyContext context, final PrintStream stream) { stream.println("Requires module: " + context.getValue(name) + ":" + access + ":" + myVersion); }
toStream
1,458
Collection<V> (K key) { try { final Collection<V> collection = myMap.get(key); //noinspection unchecked return collection == null? (Collection<V>)NULL_COLLECTION : collection; } catch (IOException e) { throw new BuildDataCorruptedException(e); } }
createValue
1,459
boolean (final K key) { try { return myMap.containsMapping(key); } catch (IOException e) { throw new BuildDataCorruptedException(e); } }
containsKey
1,460
Collection<V> (final K key) { final Collection<V> collection = myCache.get(key); return collection == NULL_COLLECTION? null : collection; }
get
1,461
void (K key, Collection<V> value) { try { myCache.remove(key); if (value == null || value.isEmpty()) { myMap.remove(key); } else { myMap.put(key, value); } } catch (IOException e) { throw new BuildDataCorruptedException(e); } }
replace
1,462
void (final K key, final Collection<V> value) { try { myCache.remove(key); myMap.appendData(key, new AppendablePersistentMap.ValueDataAppender() { @Override public void append(@NotNull DataOutput out) throws IOException { for (V v : value) { myValueExternalizer.save(out, v); } } }); } catch (IOException e) { throw new BuildDataCorruptedException(e); } }
put
1,463
void (final K key, final V value) { put(key, Collections.singleton(value)); }
put
1,464
void (K key, Collection<V> values) { try { final Collection<V> collection = myCache.get(key); if (collection != NULL_COLLECTION) { if (collection.removeAll(values)) { myCache.remove(key); if (collection.isEmpty()) { myMap.remove(key); } else { myMap.put(key, collection); } } } } catch (IOException e) { throw new BuildDataCorruptedException(e); } }
removeAll
1,465
void (final K key, final V value) { try { final Collection<V> collection = myCache.get(key); if (collection != NULL_COLLECTION) { if (collection.remove(value)) { myCache.remove(key); if (collection.isEmpty()) { myMap.remove(key); } else { myMap.put(key, collection); } } } } catch (IOException e) { throw new BuildDataCorruptedException(e); } }
removeFrom
1,466
void (final K key) { try { myCache.remove(key); myMap.remove(key); } catch (IOException e) { throw new BuildDataCorruptedException(e); } }
remove
1,467
void (ObjectObjectMultiMaplet<K, V> m) { m.forEachEntry((key, value) -> { put(key, value); return true; }); }
putAll
1,468
void (ObjectObjectMultiMaplet<K, V> m) { m.forEachEntry((key, value) -> { replace(key, value); return true; }); }
replaceAll
1,469
void () { try { myCache.clear(); myMap.close(); } catch (IOException e) { throw new BuildDataCorruptedException(e); } }
close
1,470
void (boolean memoryCachesOnly) { if (memoryCachesOnly) { if (myMap.isDirty()) { myMap.dropMemoryCaches(); } } else { myMap.force(); } }
flush
1,471
Object (DataInput out) { return null; }
load
1,472
void (DataOutput out, Object value) { }
save
1,473
byte () { return myId; }
getId
1,474
DataDescriptor (byte tag) { if (STRING.getId() == tag) { return STRING; } if (INTEGER.getId() == tag) { return INTEGER; } if (LONG.getId() == tag) { return LONG; } if (FLOAT.getId() == tag) { return FLOAT; } if (DOUBLE.getId() == tag) { return DOUBLE; } if (TYPE.getId() == tag) { return TYPE; } if (NONE.getId() == tag) { return NONE; } assert false : "Unknown descriptor tag: " + tag; return NONE; }
findById
1,475
DataDescriptor (@Nullable Class<?> dataType) { if (dataType != null) { if (dataType.equals(STRING.getDataType())) { return STRING; } if (dataType.equals(INTEGER.getDataType())) { return INTEGER; } if (dataType.equals(LONG.getDataType())) { return LONG; } if (dataType.equals(FLOAT.getDataType())) { return FLOAT; } if (dataType.equals(DOUBLE.getDataType())) { return DOUBLE; } //noinspection ConstantConditions if (TYPE.getDataType().isAssignableFrom(dataType)) { return TYPE; } } return NONE; }
findByValueType
1,476
boolean () { return myValue != null; }
hasValue
1,477
Object (final DataInput in) { try { final byte tag = in.readByte(); if (tag < 0) { // is array final int length = DataInputOutputUtil.readINT(in); final DataDescriptor descriptor = DataDescriptor.findById((byte)-tag); final Object array = Array.newInstance(descriptor.getDataType(), length); for (int idx = 0; idx < length; idx++) { Array.set(array, idx, descriptor.load(in)); } return array; } return DataDescriptor.findById(tag).load(in); } catch (IOException e) { throw new BuildDataCorruptedException(e); } }
loadTyped
1,478
void (final DataOutput out) { super.save(out); myType.save(out); try { final Object val = myValue; final Class valueType = val != null? val.getClass() : null; if (valueType != null && valueType.isArray()) { final int length = Array.getLength(val); final Class dataType = length > 0? Array.get(val, 0).getClass() : valueType.getComponentType(); final DataDescriptor descriptor = DataDescriptor.findByValueType(dataType); out.writeByte(-descriptor.getId()); if (descriptor != DataDescriptor.NONE) { DataInputOutputUtil.writeINT(out, length); for (int idx = 0; idx < length; idx++) { final Object element = Array.get(val, idx); //noinspection unchecked descriptor.save(out, element); } } } else { final DataDescriptor descriptor = DataDescriptor.findByValueType(valueType); out.writeByte(descriptor.getId()); //noinspection unchecked descriptor.save(out, val); } } catch (IOException e) { throw new BuildDataCorruptedException(e); } catch (Exception e) { throw new RuntimeException(e); } }
save
1,479
Difference (final Proto past) { final ProtoMember m = (ProtoMember)past; final Difference diff = super.difference(past); int base = diff.base(); if (!m.myType.equals(myType)) { base |= Difference.TYPE; } switch ((myValue == null ? 0 : 1) + (m.myValue == null ? 0 : 2)) { case 3: if (!myValue.equals(m.myValue)) { base |= Difference.VALUE; } break; case 2: base |= Difference.VALUE; break; case 1: base |= Difference.VALUE; break; case 0: break; } final int newBase = base; return new DifferenceImpl(diff) { @Override public int base() { return newBase; } @Override public boolean no() { return newBase == NONE && super.no(); } @Override public boolean hadValue() { return ((ProtoMember)past).hasValue(); } }; }
difference
1,480
int () { return newBase; }
base
1,481
boolean () { return newBase == NONE && super.no(); }
no
1,482
boolean () { return ((ProtoMember)past).hasValue(); }
hadValue
1,483
void (final DependencyContext context, final PrintStream stream) { super.toStream(context, stream); stream.print(" Type : "); stream.println(myType.getDescr(context)); stream.print(" Value : "); stream.println(myValue == null ? "<null>" : myValue.toString()); }
toStream
1,484
Diff (final Proto past) { final MethodRepr m = (MethodRepr)past; final Difference diff = super.difference(past); final Difference.Specifier<TypeRepr.ClassType, Difference> excs = Difference.make(m.myExceptions, myExceptions); final Difference.Specifier<ParamAnnotation, Difference> paramAnnotations = Difference.make(m.myParameterAnnotations, myParameterAnnotations); final int base = paramAnnotations.unchanged()? diff.base() : diff.base() | Difference.ANNOTATIONS; return new Diff(diff) { @Override public Specifier<ParamAnnotation, Difference> parameterAnnotations() { return paramAnnotations; } @Override public boolean no() { return base() == NONE && !defaultAdded() && !defaultRemoved() && excs.unchanged() && paramAnnotations.unchanged(); } @Override public boolean defaultAdded() { return hasValue() && !m.hasValue(); } @Override public boolean defaultRemoved() { return !hasValue() && m.hasValue(); } @Override public Specifier<TypeRepr.ClassType, Difference> exceptions() { return excs; } @Override public int base() { return base; } @Override public boolean hadValue() { return m.hasValue(); } }; }
difference
1,485
boolean () { return base() == NONE && !defaultAdded() && !defaultRemoved() && excs.unchanged() && paramAnnotations.unchanged(); }
no
1,486
boolean () { return hasValue() && !m.hasValue(); }
defaultAdded
1,487
boolean () { return !hasValue() && m.hasValue(); }
defaultRemoved
1,488
int () { return base; }
base
1,489
boolean () { return m.hasValue(); }
hadValue
1,490
void (final DependencyContext context, final int owner, final Set<? super UsageRepr.Usage> s) { myType.updateClassUsages(context, owner, s); for (final TypeRepr.AbstractType argType : myArgumentTypes) { argType.updateClassUsages(context, owner, s); } if (myExceptions != null) { for (TypeRepr.AbstractType typ : myExceptions) { typ.updateClassUsages(context, owner, s); } } }
updateClassUsages
1,491
void (@NotNull DataOutput out, ParamAnnotation value) { value.save(out); }
save
1,492
ParamAnnotation (@NotNull DataInput in) { return new ParamAnnotation(clsTypeExternalizer, in); }
read
1,493
void (final DataOutput out) { super.save(out); RW.save(myArgumentTypes, out); RW.save(myExceptions, out); RW.save(myParameterAnnotations, out); }
save
1,494
DataExternalizer<MethodRepr> (final DependencyContext context) { return new DataExternalizer<>() { @Override public void save(final @NotNull DataOutput out, final MethodRepr value) { value.save(out); } @Override public MethodRepr read(@NotNull DataInput in) { return new MethodRepr(context, in); } }; }
externalizer
1,495
void (final @NotNull DataOutput out, final MethodRepr value) { value.save(out); }
save
1,496
MethodRepr (@NotNull DataInput in) { return new MethodRepr(context, in); }
read
1,497
Predicate<MethodRepr> (final MethodRepr me) { return that -> { return me == that || me.name == that.name && Arrays.equals(me.myArgumentTypes, that.myArgumentTypes); }; }
equalByJavaRules
1,498
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final MethodRepr that = (MethodRepr)o; return name == that.name && myType.equals(that.myType) && Arrays.equals(myArgumentTypes, that.myArgumentTypes); }
equals
1,499
int () { return 31 * (31 * Arrays.hashCode(myArgumentTypes) + myType.hashCode()) + name; }
hashCode