Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
1,200
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final ModuleUsage that = (ModuleUsage)o; return myModuleName == that.myModuleName; }
equals
1,201
int () { return myModuleName; }
hashCode
1,202
void (final DependencyContext context, final PrintStream stream) { stream.println("ModuleUsage: " + context.getValue(myModuleName)); }
toStream
1,203
int () { return myOwner; }
getOwner
1,204
void (final DataOutput out) { try { out.writeByte(IMPORT_STATIC_ON_DEMAND_USAGE); DataInputOutputUtil.writeINT(out, myOwner); } catch (IOException e) { throw new BuildDataCorruptedException(e); } }
save
1,205
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final ImportStaticOnDemandUsage that = (ImportStaticOnDemandUsage)o; return myOwner == that.myOwner; }
equals
1,206
int () { return myOwner; }
hashCode
1,207
void (final DependencyContext context, final PrintStream stream) { stream.println("ImportStaticOnDemandUsage: " + context.getValue(myOwner)); }
toStream
1,208
int () { return super.hashCode() + 3; }
hashCode
1,209
void (final DataOutput out) { try { out.writeByte(CLASS_AS_GENERIC_BOUND_USAGE); DataInputOutputUtil.writeINT(out, myClassName); } catch (IOException e) { throw new BuildDataCorruptedException(e); } }
save
1,210
void (final DependencyContext context, final PrintStream stream) { stream.println("ClassAsGenericBoundUsage: " + context.getValue(myClassName)); }
toStream
1,211
int () { return myClassName; }
getOwner
1,212
void (final DataOutput out) { try { out.writeByte(CLASS_EXTENDS_USAGE); DataInputOutputUtil.writeINT(out, myClassName); } catch (IOException e) { throw new BuildDataCorruptedException(e); } }
save
1,213
int () { return myClassName + 1; }
hashCode
1,214
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ClassExtendsUsage that = (ClassExtendsUsage)o; if (myClassName != that.myClassName) return false; return true; }
equals
1,215
void (final DependencyContext context, final PrintStream stream) { stream.println("ClassExtendsUsage: " + context.getValue(myClassName)); }
toStream
1,216
void (final DataOutput out) { try { out.writeByte(CLASS_NEW_USAGE); DataInputOutputUtil.writeINT(out, myClassName); } catch (IOException e) { throw new BuildDataCorruptedException(e); } }
save
1,217
int () { return myClassName + 2; }
hashCode
1,218
void (final DependencyContext context, final PrintStream stream) { stream.println("ClassNewUsage: " + context.getValue(myClassName)); }
toStream
1,219
boolean (final AnnotationUsage annotationUsage) { if (!myType.equals(annotationUsage.myType)) { return false; } boolean argumentsSatisfy = false; if (myUsedArguments != null) { IntSet arguments = new IntOpenHashSet(myUsedArguments); arguments.removeAll(annotationUsage.myUsedArguments); // need to find annotation usages that do not mention arguments this annotation uses argumentsSatisfy = !arguments.isEmpty(); } boolean targetsSatisfy = false; if (myUsedTargets != null) { final Collection<ElemType> targets = EnumSet.copyOf(myUsedTargets); targets.retainAll(annotationUsage.myUsedTargets); targetsSatisfy = !targets.isEmpty(); } return argumentsSatisfy || targetsSatisfy; }
satisfies
1,220
void (final DataOutput out) { try { out.writeByte(ANNOTATION_USAGE); myType.save(out); RW.save(myUsedArguments, out); RW.save(myUsedTargets, elementTypeExternalizer, out); } catch (IOException e) { throw new BuildDataCorruptedException(e); } }
save
1,221
int () { return myType.className; }
getOwner
1,222
boolean (final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AnnotationUsage that = (AnnotationUsage)o; if (myUsedArguments != null ? !myUsedArguments.equals(that.myUsedArguments) : that.myUsedArguments != null) return false; if (myUsedTargets != null ? !myUsedTargets.equals(that.myUsedTargets) : that.myUsedTargets != null) return false; if (myType != null ? !myType.equals(that.myType) : that.myType != null) return false; return true; }
equals
1,223
int () { int result = myType != null ? myType.hashCode() : 0; result = 31 * result + (myUsedArguments != null ? myUsedArguments.hashCode() : 0); result = 31 * result + (myUsedTargets != null ? myUsedTargets.hashCode() : 0); return result; }
hashCode
1,224
void (final DependencyContext context, final PrintStream stream) { stream.println(" AnnotationUsage:"); stream.println(" Type : " + myType.getDescr(context)); final List<String> arguments = new LinkedList<>(); if (myUsedArguments != null) { myUsedArguments.forEach(value -> { arguments.add(context.getValue(value)); }); } Collections.sort(arguments); final List<String> targets = new LinkedList<>(); if (myUsedTargets != null) { for (final ElemType e : myUsedTargets) { targets.add(e.toString()); } } Collections.sort(targets); stream.println(" Arguments:"); for (final String s : arguments) { stream.println(" " + s); } stream.println(" Targets :"); for (final String s : targets) { stream.println(" " + s); } }
toStream
1,225
Usage (final DependencyContext context, final int name, final int owner, final int descr) { return context.getUsage(new FieldUsage(context, name, owner, descr)); }
createFieldUsage
1,226
Usage (final DependencyContext context, final int name, final int owner, final int descr) { return context.getUsage(new FieldAssignUsage(context, name, owner, descr)); }
createFieldAssignUsage
1,227
Usage (final DependencyContext context, final int name, final int owner, final String descr) { return context.getUsage(new MethodUsage(context, name, owner, descr)); }
createMethodUsage
1,228
Usage (final DependencyContext context, final int name, final int owner) { return context.getUsage(new MetaMethodUsage(name, owner)); }
createMetaMethodUsage
1,229
Usage (final DependencyContext context, final int name, final int owner) { return context.getUsage(new ImportStaticMemberUsage(name, owner)); }
createImportStaticMemberUsage
1,230
Usage (final DependencyContext context, final int owner) { return context.getUsage(new ImportStaticOnDemandUsage(owner)); }
createImportStaticOnDemandUsage
1,231
Usage (final DependencyContext context, final int name) { return context.getUsage(new ClassUsage(name)); }
createClassUsage
1,232
Usage (final DependencyContext context, final int name) { return context.getUsage(new ClassAsGenericBoundUsage(name)); }
createClassAsGenericBoundUsage
1,233
Usage (final DependencyContext context, final int name) { return context.getUsage(new ClassNewUsage(name)); }
createClassNewUsage
1,234
Usage (DependencyContext context, TypeRepr.ClassType type, IntSet usedArguments, Set<ElemType> targets) { return context.getUsage(new AnnotationUsage(type, usedArguments, targets)); }
createAnnotationUsage
1,235
Usage (final DependencyContext context, final int name) { return context.getUsage(new ModuleUsage(name)); }
createModuleUsage
1,236
DataExternalizer<Usage> (final DependencyContext context) { return new DataExternalizer<Usage>() { @Override public void save(final @NotNull DataOutput out, final Usage value) { value.save(out); } @Override public Usage read(@NotNull DataInput in) throws IOException { final byte tag = in.readByte(); switch (tag) { case CLASS_USAGE: return context.getUsage(new ClassUsage(in)); case CLASS_AS_GENERIC_BOUND_USAGE: return context.getUsage(new ClassAsGenericBoundUsage(in)); case CLASS_EXTENDS_USAGE: return context.getUsage(new ClassExtendsUsage(in)); case CLASS_NEW_USAGE: return context.getUsage(new ClassNewUsage(in)); case FIELD_USAGE: return context.getUsage(new FieldUsage(context, in)); case FIELD_ASSIGN_USAGE: return context.getUsage(new FieldAssignUsage(context, in)); case METHOD_USAGE: return context.getUsage(new MethodUsage(context, in)); case ANNOTATION_USAGE: return context.getUsage(new AnnotationUsage(context, in)); case METAMETHOD_USAGE: return context.getUsage(new MetaMethodUsage(in)); case MODULE_USAGE: return context.getUsage(new ModuleUsage(in)); case IMPORT_STATIC_MEMBER_USAGE: return context.getUsage(new ImportStaticMemberUsage(in)); case IMPORT_STATIC_ON_DEMAND_USAGE: return context.getUsage(new ImportStaticOnDemandUsage(in)); default: throw new IOException("Unknown usage with tag " + tag); } } }; }
externalizer
1,237
void (final @NotNull DataOutput out, final Usage value) { value.save(out); }
save
1,238
String (final DependencyContext context) { return context.getValue(type); }
getDescr
1,239
void (final DependencyContext context, final int owner, final Set<? super UsageRepr.Usage> s) { }
updateClassUsages
1,240
void (final DataOutput out) { try { out.writeByte(PRIMITIVE_TYPE); DataInputOutputUtil.writeINT(out, type); } catch (IOException e) { throw new BuildDataCorruptedException(e); } }
save
1,241
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final PrimitiveType that = (PrimitiveType)o; return type == that.type; }
equals
1,242
int () { return type; }
hashCode
1,243
AbstractType () { AbstractType current = this; while (current instanceof ArrayType) { current = ((ArrayType)current).elementType; } return current; }
getDeepElementType
1,244
String (final DependencyContext context) { return "[" + elementType.getDescr(context); }
getDescr
1,245
void (final DependencyContext context, final int owner, final Set<? super UsageRepr.Usage> s) { elementType.updateClassUsages(context, owner, s); }
updateClassUsages
1,246
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final ArrayType arrayType = (ArrayType)o; return elementType.equals(arrayType.elementType); }
equals
1,247
int () { return elementType.hashCode(); }
hashCode
1,248
void (final DataOutput out) { try { out.writeByte(ARRAY_TYPE); elementType.save(out); } catch (IOException e) { throw new BuildDataCorruptedException(e); } }
save
1,249
String (final DependencyContext context) { return "L" + context.getValue(className) + ";"; }
getDescr
1,250
void (final DependencyContext context, final int owner, final Set<? super UsageRepr.Usage> s) { s.add(UsageRepr.createClassUsage(context, className)); }
updateClassUsages
1,251
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ClassType type = (ClassType)o; if (className != type.className) return false; return true; }
equals
1,252
int () { return className; }
hashCode
1,253
void (final DataOutput out) { try { out.writeByte(CLASS_TYPE); DataInputOutputUtil.writeINT(out, className); } catch (IOException e) { throw new BuildDataCorruptedException(e); } }
save
1,254
ClassType (final DependencyContext context, final int s) { return context.getType(new ClassType(s)); }
createClassType
1,255
AbstractType (final DependencyContext context, final int descr) { return getType(InternedString.create(context, descr)); }
getType
1,256
AbstractType (final DependencyContext context, final String descr) { return getType(InternedString.create(context, descr)); }
getType
1,257
AbstractType (InternedString descr) { final DependencyContext context = descr.getContext(); final Type t = Type.getType(descr.asString()); switch (t.getSort()) { case Type.OBJECT: return context.getType(new ClassType(context.get(t.getClassName().replace('.', '/')))); case Type.ARRAY: return context.getType(new ArrayType(getType(context, t.getElementType()))); default: return context.getType(new PrimitiveType(descr.asInt())); } }
getType
1,258
AbstractType (final DependencyContext context, final Type t) { return getType(context, t.getDescriptor()); }
getType
1,259
AbstractType[] (final DependencyContext context, final Type[] t) { if(t.length == 0) return AbstractType.EMPTY_TYPE_ARRAY; final AbstractType[] r = new AbstractType[t.length]; for (int i = 0; i < r.length; i++) { r[i] = getType(context, t[i]); } return r; }
getType
1,260
void (final @NotNull DataOutput out, final T value) { value.save(out); }
save
1,261
void (final DependencyContext context, final PrintStream stream) { final OrderProvider op = new OrderProvider(context); forEachEntry((vs, value) -> op.register(value)); final int[] keys = op.get(); for (final int a : keys) { final Collection<V> b = get(a); stream.print(" Key: "); stream.println(context.getValue(a)); stream.println(" Values:"); final List<String> list = new LinkedList<>(); for (final V value : b) { if (value instanceof Streamable) { final ByteArrayOutputStream baos = new ByteArrayOutputStream(); final PrintStream s = new PrintStream(baos); ((Streamable)value).toStream(context, s); list.add(baos.toString()); } else { list.add(value.toString()); } } Collections.sort(list); for (final String l : list) { stream.print(l); } stream.println(" End Of Values"); } }
toStream
1,262
void (DataOutput out) { try { DataInputOutputUtil.writeINT(out, paramIndex); type.save(out); } catch (IOException e) { throw new BuildDataCorruptedException(e); } }
save
1,263
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ParamAnnotation that = (ParamAnnotation)o; if (paramIndex != that.paramIndex) return false; if (!type.equals(that.type)) return false; return true; }
equals
1,264
int () { int result = paramIndex; result = 31 * result + type.hashCode(); return result; }
hashCode
1,265
void (String name, Object value) { }
visit
1,266
void (String name, String desc, String value) { myRetentionPolicy = RetentionPolicy.valueOf(value); }
visitEnum
1,267
AnnotationVisitor (String name, String desc) { return null; }
visitAnnotation
1,268
AnnotationVisitor (String name) { return null; }
visitArray
1,269
void () { }
visitEnd
1,270
void (String name, Object value) { }
visit
1,271
void (final String name, String desc, final String value) { myTargets.add(ElemType.valueOf(value)); }
visitEnum
1,272
AnnotationVisitor (String name, String desc) { return this; }
visitAnnotation
1,273
AnnotationVisitor (String name) { return this; }
visitArray
1,274
void () { }
visitEnd
1,275
String (final Object value, boolean isArray) { final StringBuilder descriptor = new StringBuilder(); descriptor.append("()"); if (isArray) { descriptor.append("["); } if (value instanceof Type) { descriptor.append("Ljava/lang/Class;"); } else { final String name = Type.getType(value.getClass()).getInternalName(); // only primitive, String, Class, Enum, another Annotation or array of any of these are allowed switch (name) { case "java/lang/Integer": descriptor.append("I;"); break; case "java/lang/Short": descriptor.append("S;"); break; case "java/lang/Long": descriptor.append("J;"); break; case "java/lang/Byte": descriptor.append("B;"); break; case "java/lang/Char": descriptor.append("C;"); break; case "java/lang/Boolean": descriptor.append("Z;"); break; case "java/lang/Float": descriptor.append("F;"); break; case "java/lang/Double": descriptor.append("D;"); break; default: descriptor.append("L").append(name).append(";"); break; } } return descriptor.toString(); }
getMethodDescr
1,276
void (String name, Object value) { final boolean isArray = name == null && myArrayName != null; final String argName; if (name != null) { argName = name; } else { argName = myArrayName; // not interested in collecting complete array value; need to know just array type myArrayName = null; } if (argName != null) { registerUsages(argName, getMethodDescr(value, isArray), value); } }
visit
1,277
void (String name, String desc, String value) { final boolean isArray = name == null && myArrayName != null; final String argName; if (name != null) { argName = name; } else { argName = myArrayName; // not interested in collecting complete array value; need to know just array type myArrayName = null; } if (argName != null) { registerUsages(argName, (isArray? "()[" : "()") + desc, value); } }
visitEnum
1,278
AnnotationVisitor (String name, String desc) { return new AnnotationCrawler((TypeRepr.ClassType)TypeRepr.getType(myContext, desc), myTarget); }
visitAnnotation
1,279
AnnotationVisitor (String name) { myArrayName = name; return this; }
visitArray
1,280
void (String argName, String methodDescr, Object value) { final int methodName = myContext.get(argName); if (value instanceof Type) { final String className = ((Type)value).getClassName().replace('.', '/'); myUsages.add(UsageRepr.createClassUsage(myContext, myContext.get(className))); } myUsages.add(UsageRepr.createMethodUsage(myContext, methodName, myType.className, methodDescr)); myUsages.add(UsageRepr.createMetaMethodUsage(myContext, methodName, myType.className)); myUsedArguments.add(methodName); }
registerUsages
1,281
void () { IntSet s = myAnnotationArguments.get(myType); if (s == null) { myAnnotationArguments.put(myType, myUsedArguments); } else { s.retainAll(myUsedArguments); } }
visitEnd
1,282
void (String mainClass) { myUsages.add(UsageRepr.createClassUsage(myContext, myContext.get(mainClass))); }
visitMainClass
1,283
void (String module, int access, String version) { if (isExplicit(access)) { // collect non-synthetic dependencies only myModuleRequires.add(new ModuleRequiresRepr(myContext, access, myContext.get(module), version)); } }
visitRequire
1,284
void (String packaze, int access, String... modules) { if (isExplicit(access)) { // collect non-synthetic dependencies only myModuleExports.add(new ModulePackageRepr(myContext, myContext.get(packaze), modules != null? Arrays.asList(modules) : Collections.emptyList())); } }
visitExport
1,285
void (String service) { myUsages.add(UsageRepr.createClassUsage(myContext, myContext.get(service))); }
visitUse
1,286
void (String service, String... providers) { myUsages.add(UsageRepr.createClassUsage(myContext, myContext.get(service))); if (providers != null) { for (String provider : providers) { myUsages.add(UsageRepr.createClassUsage(myContext, myContext.get(provider))); } } }
visitProvide
1,287
boolean (int access) { return (access & (Opcodes.ACC_SYNTHETIC | Opcodes.ACC_MANDATED)) == 0; }
isExplicit
1,288
void (final String sig) { if (sig != null) { try { new SignatureReader(sig).accept(mySignatureCrawler); } catch (Exception e) { LOG.info("Problems parsing signature \"" + sig + "\" in " + myContext.getValue(myFileName), e); } } }
processSignature
1,289
SignatureVisitor () { return mySignatureWithGenericBoundUsageCrawler; }
visitClassBound
1,290
SignatureVisitor () { return mySignatureWithGenericBoundUsageCrawler; }
visitInterfaceBound
1,291
SignatureVisitor (char wildcard) { return wildcard == '+' || wildcard == '-' ? mySignatureWithGenericBoundUsageCrawler : super.visitTypeArgument(wildcard); }
visitTypeArgument
1,292
void (String name) { final int className = myContext.get(name); myUsages.add(UsageRepr.createClassUsage(myContext, className)); myUsages.add(UsageRepr.createClassAsGenericBoundUsage(myContext, className)); }
visitClassType
1,293
boolean (final int access) { return (access & Opcodes.ACC_PRIVATE) == 0; }
notPrivate
1,294
ClassFileRepr () { if (!myTakeIntoAccount) { return null; } if (myIsModule) { return new ModuleRepr(myContext, myAccess, myVersion, myFileName, myName, myModuleRequires, myModuleExports, myUsages); } return new ClassRepr( myContext, myAccess, myFileName, myName, myContext.get(mySignature), myContext.get(mySuperClass), myInterfaces, myFields, myMethods, myAnnotations, myTargets, myRetentionPolicy, myContext.get(myOuterClassName.get()), myLocalClassFlag.get(), myAnonymousClassFlag.get(), myUsages, myIsGenerated ); }
getResult
1,295
void (int version, int access, String name, String sig, String superName, String[] interfaces) { myTakeIntoAccount = notPrivate(access); myAccess = access; myName = myContext.get(name); myVersion = version; mySignature = sig; mySuperClass = superName; myInterfaces = interfaces; myClassNameHolder.set(name); if (mySuperClass != null) { final int superclassName = myContext.get(mySuperClass); myUsages.add(UsageRepr.createClassUsage(myContext, superclassName)); //myUsages.add(UsageRepr.createClassExtendsUsage(myContext, superclassName)); } if (myInterfaces != null) { for (String it : myInterfaces) { final int interfaceName = myContext.get(it); myUsages.add(UsageRepr.createClassUsage(myContext, interfaceName)); //myUsages.add(UsageRepr.createClassExtendsUsage(myContext, interfaceName)); } } processSignature(sig); }
visit
1,296
void () { for (Map.Entry<TypeRepr.ClassType, Set<ElemType>> entry : myAnnotationTargets.entrySet()) { TypeRepr.ClassType type = entry.getKey(); Set<ElemType> targets = entry.getValue(); IntSet usedArguments = myAnnotationArguments.get(type); myUsages.add(UsageRepr.createAnnotationUsage(myContext, type, usedArguments, targets)); } }
visitEnd
1,297
ModuleVisitor (String name, int access, String version) { myIsModule = true; myAccess = access; myName = myContext.get(name); myVersion = myContext.get(version); return new ModuleCrawler(); }
visitModule
1,298
AnnotationVisitor (final String desc, final boolean visible) { if (desc.equals("Ljava/lang/annotation/Target;")) { return new AnnotationTargetCrawler(); } if (desc.equals("Ljava/lang/annotation/Retention;")) { return new AnnotationRetentionPolicyCrawler(); } final TypeRepr.ClassType annotationType = (TypeRepr.ClassType)TypeRepr.getType(myContext, desc); myAnnotations.add(annotationType); return new AnnotationCrawler(annotationType, (myAccess & Opcodes.ACC_ANNOTATION) > 0 ? ElemType.ANNOTATION_TYPE : ElemType.TYPE); }
visitAnnotation
1,299
void (String source, String debug) { }
visitSource