Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
1,300
FieldVisitor (final int access, final String name, final String desc, final String signature, final Object value) { processSignature(signature); return new FieldVisitor(ASM_API_VERSION) { final Set<TypeRepr.ClassType> annotations = new HashSet<>(); @Override public AnnotationVisitor visitAnnotation(String desc, boolean visible) { final TypeRepr.ClassType annotation = (TypeRepr.ClassType)TypeRepr.getType(myContext, desc); annotations.add(annotation); return new AnnotationCrawler(annotation, ElemType.FIELD); } @Override public void visitEnd() { try { super.visitEnd(); } finally { if ((access & Opcodes.ACC_SYNTHETIC) == 0) { myFields.add(new FieldRepr( myContext, access, myContext.get(name), myContext.get(desc), myContext.get(signature), annotations, value )); } } } }; }
visitField
1,301
AnnotationVisitor (String desc, boolean visible) { final TypeRepr.ClassType annotation = (TypeRepr.ClassType)TypeRepr.getType(myContext, desc); annotations.add(annotation); return new AnnotationCrawler(annotation, ElemType.FIELD); }
visitAnnotation
1,302
void () { try { super.visitEnd(); } finally { if ((access & Opcodes.ACC_SYNTHETIC) == 0) { myFields.add(new FieldRepr( myContext, access, myContext.get(name), myContext.get(desc), myContext.get(signature), annotations, value )); } } }
visitEnd
1,303
MethodVisitor (final int access, final String n, final String desc, final String signature, final String[] exceptions) { final Ref<Object> defaultValue = Ref.create(); final Set<TypeRepr.ClassType> annotations = new HashSet<>(); final Set<ParamAnnotation> paramAnnotations = new HashSet<>(); processSignature(signature); return new MethodVisitor(ASM_API_VERSION) { @Override public void visitEnd() { if ((access & Opcodes.ACC_SYNTHETIC) == 0 || (access & Opcodes.ACC_BRIDGE) > 0) { myMethods.add(new MethodRepr( myContext, access, myContext.get(n), myContext.get(signature), desc, annotations, paramAnnotations, exceptions, defaultValue.get() )); } } @Override public AnnotationVisitor visitAnnotation(String desc, boolean visible) { final TypeRepr.ClassType annoType = (TypeRepr.ClassType)TypeRepr.getType(myContext, desc); annotations.add(annoType); return new AnnotationCrawler(annoType, "<init>".equals(n) ? ElemType.CONSTRUCTOR : ElemType.METHOD); } @Override public AnnotationVisitor visitAnnotationDefault() { return new AnnotationVisitor(ASM_API_VERSION) { private @Nullable List<Object> myAcc; @Override public void visit(String name, Object value) { collectValue(value); } @Override public void visitEnum(String name, String desc, String value) { collectValue(value); } @Override public AnnotationVisitor visitArray(String name) { myAcc = new SmartList<>(); return this; } @Override public void visitEnd() { if (myAcc != null) { Object[] template = null; if (!myAcc.isEmpty()) { final Object elem = myAcc.get(0); if (elem != null) { template = ArrayUtil.newArray(elem.getClass(), 0); } } defaultValue.set(template != null? myAcc.toArray(template) : myAcc.toArray()); } } private void collectValue(Object value) { if (myAcc != null) { myAcc.add(value); } else { defaultValue.set(value); } } }; } @Override public AnnotationVisitor visitParameterAnnotation(int parameter, String desc, boolean visible) { final TypeRepr.ClassType annoType = (TypeRepr.ClassType)TypeRepr.getType(myContext, desc); paramAnnotations.add(new ParamAnnotation(parameter, annoType)); return new AnnotationCrawler(annoType, ElemType.PARAMETER); } @Override public void visitLdcInsn(Object cst) { if (cst instanceof Type) { myUsages.add(UsageRepr.createClassUsage(myContext, myContext.get(((Type)cst).getInternalName()))); } super.visitLdcInsn(cst); } @Override public void visitMultiANewArrayInsn(String desc, int dims) { final TypeRepr.ArrayType typ = (TypeRepr.ArrayType)TypeRepr.getType(myContext, desc); final TypeRepr.AbstractType element = typ.getDeepElementType(); if (element instanceof TypeRepr.ClassType) { final int className = ((TypeRepr.ClassType)element).className; myUsages.add(UsageRepr.createClassUsage(myContext, className)); myUsages.add(UsageRepr.createClassNewUsage(myContext, className)); } typ.updateClassUsages(myContext, myName, myUsages); super.visitMultiANewArrayInsn(desc, dims); } @Override public void visitLocalVariable(String n, String desc, String signature, Label start, Label end, int index) { processSignature(signature); TypeRepr.getType(myContext, desc).updateClassUsages(myContext, myName, myUsages); super.visitLocalVariable(n, desc, signature, start, end, index); } @Override public void visitTryCatchBlock(Label start, Label end, Label handler, String type) { if (type != null) { TypeRepr.createClassType(myContext, myContext.get(type)).updateClassUsages(myContext, myName, myUsages); } super.visitTryCatchBlock(start, end, handler, type); } @Override public void visitTypeInsn(int opcode, String type) { final TypeRepr.AbstractType typ = type.startsWith("[")? TypeRepr.getType(myContext, type) : TypeRepr.createClassType(myContext, myContext.get(type)); if (opcode == Opcodes.NEW) { myUsages.add(UsageRepr.createClassUsage(myContext, ((TypeRepr.ClassType)typ).className)); myUsages.add(UsageRepr.createClassNewUsage(myContext, ((TypeRepr.ClassType)typ).className)); final int ktLambdaMarker = type.indexOf(KOTLIN_LAMBDA_USAGE_CLASS_MARKER); if (ktLambdaMarker > 0) { final int ifNameStart = ktLambdaMarker + KOTLIN_LAMBDA_USAGE_CLASS_MARKER.length(); final int ifNameEnd = type.indexOf("$", ifNameStart); if (ifNameEnd > ifNameStart) { myUsages.add(UsageRepr.createClassNewUsage(myContext, myContext.get(type.substring(ifNameStart, ifNameEnd).replace('_', '/')))); } } } else if (opcode == Opcodes.ANEWARRAY) { if (typ instanceof TypeRepr.ClassType) { myUsages.add(UsageRepr.createClassUsage(myContext, ((TypeRepr.ClassType)typ).className)); myUsages.add(UsageRepr.createClassNewUsage(myContext, ((TypeRepr.ClassType)typ).className)); } } typ.updateClassUsages(myContext, myName, myUsages); super.visitTypeInsn(opcode, type); } @Override public void visitFieldInsn(int opcode, String owner, String name, String desc) { registerFieldUsage(opcode, owner, name, desc); super.visitFieldInsn(opcode, owner, name, desc); } @Override public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) { registerMethodUsage(owner, name, desc); super.visitMethodInsn(opcode, owner, name, desc, itf); } @Override public void visitInvokeDynamicInsn(String methodName, String desc, Handle bsm, Object... bsmArgs) { final Type returnType = Type.getReturnType(desc); addClassUsage(TypeRepr.getType(myContext, returnType)); // common args processing for (Object arg : bsmArgs) { if (arg instanceof Type) { final Type type = (Type)arg; if (type.getSort() == Type.METHOD) { for (Type argType : type.getArgumentTypes()) { addClassUsage(TypeRepr.getType(myContext, argType)); } addClassUsage(TypeRepr.getType(myContext, type.getReturnType())); } else { addClassUsage(TypeRepr.getType(myContext, type)); } } else if (arg instanceof Handle) { processMethodHandle((Handle)arg); } } if (LAMBDA_FACTORY_CLASS.equals(bsm.getOwner())) { // This invokeDynamic implements a lambda or method reference usage. // Need to register method usage for the corresponding SAM-type. // First three arguments to the bootstrap methods are provided automatically by VM. // Arguments in args array are expected to be as following: // [0]: Type: Signature and return type of method to be implemented by the function object. // [1]: Handle: implementation method handle // [2]: Type: The signature and return type that should be enforced dynamically at invocation time. May be the same as samMethodType, or may be a specialization of it // [...]: optional additional arguments if (returnType.getSort() == Type.OBJECT && bsmArgs.length >= 3) { if (bsmArgs[0] instanceof Type) { final Type samMethodType = (Type)bsmArgs[0]; if (samMethodType.getSort() == Type.METHOD) { registerMethodUsage(returnType.getInternalName(), methodName, samMethodType.getDescriptor()); // reflect dynamic proxy instantiation with NewClassUsage myUsages.add(UsageRepr.createClassNewUsage(myContext, myContext.get(returnType.getInternalName()))); } } } } super.visitInvokeDynamicInsn(methodName, desc, bsm, bsmArgs); } private void processMethodHandle(Handle handle) { final String memberOwner = handle.getOwner(); if (memberOwner != null && !memberOwner.equals(myClassNameHolder.get())) { // do not register access to own class members final String memberName = handle.getName(); final String memberDescriptor = handle.getDesc(); final int opCode = getFieldAccessOpcode(handle); if (opCode > 0) { registerFieldUsage(opCode, memberOwner, memberName, memberDescriptor); } else { registerMethodUsage(memberOwner, memberName, memberDescriptor); } } } private void registerFieldUsage(int opcode, String owner, String fName, String desc) { final int fieldName = myContext.get(fName); final int fieldOwner = myContext.get(owner); final int descr = myContext.get(desc); if (opcode == Opcodes.PUTFIELD || opcode == Opcodes.PUTSTATIC) { myUsages.add(UsageRepr.createFieldAssignUsage(myContext, fieldName, fieldOwner, descr)); } if (opcode == Opcodes.GETFIELD || opcode == Opcodes.GETSTATIC) { addClassUsage(TypeRepr.getType(myContext, descr)); } myUsages.add(UsageRepr.createFieldUsage(myContext, fieldName, fieldOwner, descr)); } private void registerMethodUsage(String owner, String name, @Nullable String desc) { final int methodOwner = myContext.get(owner); final int methodName = myContext.get(name); myUsages.add(UsageRepr.createMetaMethodUsage(myContext, methodName, methodOwner)); if (desc != null) { myUsages.add(UsageRepr.createMethodUsage(myContext, methodName, methodOwner, desc)); addClassUsage(TypeRepr.getType(myContext, Type.getReturnType(desc))); } } private void addClassUsage(final TypeRepr.AbstractType type) { TypeRepr.ClassType classType = null; if (type instanceof TypeRepr.ClassType) { classType = (TypeRepr.ClassType)type; } else if (type instanceof TypeRepr.ArrayType) { final TypeRepr.AbstractType elemType = ((TypeRepr.ArrayType)type).getDeepElementType(); if (elemType instanceof TypeRepr.ClassType) { classType = (TypeRepr.ClassType)elemType; } } if (classType != null) { myUsages.add(UsageRepr.createClassUsage(myContext, classType.className)); } } }; }
visitMethod
1,304
void () { if ((access & Opcodes.ACC_SYNTHETIC) == 0 || (access & Opcodes.ACC_BRIDGE) > 0) { myMethods.add(new MethodRepr( myContext, access, myContext.get(n), myContext.get(signature), desc, annotations, paramAnnotations, exceptions, defaultValue.get() )); } }
visitEnd
1,305
AnnotationVisitor (String desc, boolean visible) { final TypeRepr.ClassType annoType = (TypeRepr.ClassType)TypeRepr.getType(myContext, desc); annotations.add(annoType); return new AnnotationCrawler(annoType, "<init>".equals(n) ? ElemType.CONSTRUCTOR : ElemType.METHOD); }
visitAnnotation
1,306
AnnotationVisitor () { return new AnnotationVisitor(ASM_API_VERSION) { private @Nullable List<Object> myAcc; @Override public void visit(String name, Object value) { collectValue(value); } @Override public void visitEnum(String name, String desc, String value) { collectValue(value); } @Override public AnnotationVisitor visitArray(String name) { myAcc = new SmartList<>(); return this; } @Override public void visitEnd() { if (myAcc != null) { Object[] template = null; if (!myAcc.isEmpty()) { final Object elem = myAcc.get(0); if (elem != null) { template = ArrayUtil.newArray(elem.getClass(), 0); } } defaultValue.set(template != null? myAcc.toArray(template) : myAcc.toArray()); } } private void collectValue(Object value) { if (myAcc != null) { myAcc.add(value); } else { defaultValue.set(value); } } }; }
visitAnnotationDefault
1,307
void (String name, Object value) { collectValue(value); }
visit
1,308
void (String name, String desc, String value) { collectValue(value); }
visitEnum
1,309
AnnotationVisitor (String name) { myAcc = new SmartList<>(); return this; }
visitArray
1,310
void () { if (myAcc != null) { Object[] template = null; if (!myAcc.isEmpty()) { final Object elem = myAcc.get(0); if (elem != null) { template = ArrayUtil.newArray(elem.getClass(), 0); } } defaultValue.set(template != null? myAcc.toArray(template) : myAcc.toArray()); } }
visitEnd
1,311
void (Object value) { if (myAcc != null) { myAcc.add(value); } else { defaultValue.set(value); } }
collectValue
1,312
AnnotationVisitor (int parameter, String desc, boolean visible) { final TypeRepr.ClassType annoType = (TypeRepr.ClassType)TypeRepr.getType(myContext, desc); paramAnnotations.add(new ParamAnnotation(parameter, annoType)); return new AnnotationCrawler(annoType, ElemType.PARAMETER); }
visitParameterAnnotation
1,313
void (Object cst) { if (cst instanceof Type) { myUsages.add(UsageRepr.createClassUsage(myContext, myContext.get(((Type)cst).getInternalName()))); } super.visitLdcInsn(cst); }
visitLdcInsn
1,314
void (String desc, int dims) { final TypeRepr.ArrayType typ = (TypeRepr.ArrayType)TypeRepr.getType(myContext, desc); final TypeRepr.AbstractType element = typ.getDeepElementType(); if (element instanceof TypeRepr.ClassType) { final int className = ((TypeRepr.ClassType)element).className; myUsages.add(UsageRepr.createClassUsage(myContext, className)); myUsages.add(UsageRepr.createClassNewUsage(myContext, className)); } typ.updateClassUsages(myContext, myName, myUsages); super.visitMultiANewArrayInsn(desc, dims); }
visitMultiANewArrayInsn
1,315
void (String n, String desc, String signature, Label start, Label end, int index) { processSignature(signature); TypeRepr.getType(myContext, desc).updateClassUsages(myContext, myName, myUsages); super.visitLocalVariable(n, desc, signature, start, end, index); }
visitLocalVariable
1,316
void (Label start, Label end, Label handler, String type) { if (type != null) { TypeRepr.createClassType(myContext, myContext.get(type)).updateClassUsages(myContext, myName, myUsages); } super.visitTryCatchBlock(start, end, handler, type); }
visitTryCatchBlock
1,317
void (int opcode, String type) { final TypeRepr.AbstractType typ = type.startsWith("[")? TypeRepr.getType(myContext, type) : TypeRepr.createClassType(myContext, myContext.get(type)); if (opcode == Opcodes.NEW) { myUsages.add(UsageRepr.createClassUsage(myContext, ((TypeRepr.ClassType)typ).className)); myUsages.add(UsageRepr.createClassNewUsage(myContext, ((TypeRepr.ClassType)typ).className)); final int ktLambdaMarker = type.indexOf(KOTLIN_LAMBDA_USAGE_CLASS_MARKER); if (ktLambdaMarker > 0) { final int ifNameStart = ktLambdaMarker + KOTLIN_LAMBDA_USAGE_CLASS_MARKER.length(); final int ifNameEnd = type.indexOf("$", ifNameStart); if (ifNameEnd > ifNameStart) { myUsages.add(UsageRepr.createClassNewUsage(myContext, myContext.get(type.substring(ifNameStart, ifNameEnd).replace('_', '/')))); } } } else if (opcode == Opcodes.ANEWARRAY) { if (typ instanceof TypeRepr.ClassType) { myUsages.add(UsageRepr.createClassUsage(myContext, ((TypeRepr.ClassType)typ).className)); myUsages.add(UsageRepr.createClassNewUsage(myContext, ((TypeRepr.ClassType)typ).className)); } } typ.updateClassUsages(myContext, myName, myUsages); super.visitTypeInsn(opcode, type); }
visitTypeInsn
1,318
void (int opcode, String owner, String name, String desc) { registerFieldUsage(opcode, owner, name, desc); super.visitFieldInsn(opcode, owner, name, desc); }
visitFieldInsn
1,319
void (int opcode, String owner, String name, String desc, boolean itf) { registerMethodUsage(owner, name, desc); super.visitMethodInsn(opcode, owner, name, desc, itf); }
visitMethodInsn
1,320
void (String methodName, String desc, Handle bsm, Object... bsmArgs) { final Type returnType = Type.getReturnType(desc); addClassUsage(TypeRepr.getType(myContext, returnType)); // common args processing for (Object arg : bsmArgs) { if (arg instanceof Type) { final Type type = (Type)arg; if (type.getSort() == Type.METHOD) { for (Type argType : type.getArgumentTypes()) { addClassUsage(TypeRepr.getType(myContext, argType)); } addClassUsage(TypeRepr.getType(myContext, type.getReturnType())); } else { addClassUsage(TypeRepr.getType(myContext, type)); } } else if (arg instanceof Handle) { processMethodHandle((Handle)arg); } } if (LAMBDA_FACTORY_CLASS.equals(bsm.getOwner())) { // This invokeDynamic implements a lambda or method reference usage. // Need to register method usage for the corresponding SAM-type. // First three arguments to the bootstrap methods are provided automatically by VM. // Arguments in args array are expected to be as following: // [0]: Type: Signature and return type of method to be implemented by the function object. // [1]: Handle: implementation method handle // [2]: Type: The signature and return type that should be enforced dynamically at invocation time. May be the same as samMethodType, or may be a specialization of it // [...]: optional additional arguments if (returnType.getSort() == Type.OBJECT && bsmArgs.length >= 3) { if (bsmArgs[0] instanceof Type) { final Type samMethodType = (Type)bsmArgs[0]; if (samMethodType.getSort() == Type.METHOD) { registerMethodUsage(returnType.getInternalName(), methodName, samMethodType.getDescriptor()); // reflect dynamic proxy instantiation with NewClassUsage myUsages.add(UsageRepr.createClassNewUsage(myContext, myContext.get(returnType.getInternalName()))); } } } } super.visitInvokeDynamicInsn(methodName, desc, bsm, bsmArgs); }
visitInvokeDynamicInsn
1,321
void (Handle handle) { final String memberOwner = handle.getOwner(); if (memberOwner != null && !memberOwner.equals(myClassNameHolder.get())) { // do not register access to own class members final String memberName = handle.getName(); final String memberDescriptor = handle.getDesc(); final int opCode = getFieldAccessOpcode(handle); if (opCode > 0) { registerFieldUsage(opCode, memberOwner, memberName, memberDescriptor); } else { registerMethodUsage(memberOwner, memberName, memberDescriptor); } } }
processMethodHandle
1,322
void (int opcode, String owner, String fName, String desc) { final int fieldName = myContext.get(fName); final int fieldOwner = myContext.get(owner); final int descr = myContext.get(desc); if (opcode == Opcodes.PUTFIELD || opcode == Opcodes.PUTSTATIC) { myUsages.add(UsageRepr.createFieldAssignUsage(myContext, fieldName, fieldOwner, descr)); } if (opcode == Opcodes.GETFIELD || opcode == Opcodes.GETSTATIC) { addClassUsage(TypeRepr.getType(myContext, descr)); } myUsages.add(UsageRepr.createFieldUsage(myContext, fieldName, fieldOwner, descr)); }
registerFieldUsage
1,323
void (String owner, String name, @Nullable String desc) { final int methodOwner = myContext.get(owner); final int methodName = myContext.get(name); myUsages.add(UsageRepr.createMetaMethodUsage(myContext, methodName, methodOwner)); if (desc != null) { myUsages.add(UsageRepr.createMethodUsage(myContext, methodName, methodOwner, desc)); addClassUsage(TypeRepr.getType(myContext, Type.getReturnType(desc))); } }
registerMethodUsage
1,324
void (final TypeRepr.AbstractType type) { TypeRepr.ClassType classType = null; if (type instanceof TypeRepr.ClassType) { classType = (TypeRepr.ClassType)type; } else if (type instanceof TypeRepr.ArrayType) { final TypeRepr.AbstractType elemType = ((TypeRepr.ArrayType)type).getDeepElementType(); if (elemType instanceof TypeRepr.ClassType) { classType = (TypeRepr.ClassType)elemType; } } if (classType != null) { myUsages.add(UsageRepr.createClassUsage(myContext, classType.className)); } }
addClassUsage
1,325
int (Handle handle) { switch (handle.getTag()) { case Opcodes.H_GETFIELD: return Opcodes.GETFIELD; case Opcodes.H_GETSTATIC: return Opcodes.GETSTATIC; case Opcodes.H_PUTFIELD: return Opcodes.PUTFIELD; case Opcodes.H_PUTSTATIC: return Opcodes.PUTSTATIC; default: return -1; } }
getFieldAccessOpcode
1,326
void (String name, String outerName, String innerName, int access) { if (name != null && name.equals(myClassNameHolder.get())) { // set outer class name only if we are parsing the real inner class and // not the reference to inner class inside some top-level class myAccess |= access; // information about some access flags for the inner class is missing from the mask passed to 'visit' method if (outerName != null) { myOuterClassName.set(outerName); } if (innerName == null) { myAnonymousClassFlag.set(true); } } }
visitInnerClass
1,327
void (final String owner, final String name, final String desc) { myOuterClassName.set(owner); if (name != null) { myLocalClassFlag.set(true); } }
visitOuterClass
1,328
void (String name) { }
visitFormalTypeParameter
1,329
SignatureVisitor () { return super.visitClassBound(); }
visitClassBound
1,330
SignatureVisitor () { return super.visitInterfaceBound(); }
visitInterfaceBound
1,331
SignatureVisitor () { return super.visitSuperclass(); }
visitSuperclass
1,332
SignatureVisitor () { return super.visitInterface(); }
visitInterface
1,333
SignatureVisitor () { return super.visitParameterType(); }
visitParameterType
1,334
SignatureVisitor () { return super.visitReturnType(); }
visitReturnType
1,335
SignatureVisitor () { return super.visitExceptionType(); }
visitExceptionType
1,336
void (char descriptor) { }
visitBaseType
1,337
void (String name) { }
visitTypeVariable
1,338
SignatureVisitor () { return super.visitArrayType(); }
visitArrayType
1,339
void (String name) { }
visitInnerClassType
1,340
void () { super.visitTypeArgument(); }
visitTypeArgument
1,341
SignatureVisitor (char wildcard) { return this; }
visitTypeArgument
1,342
void () { super.visitEnd(); }
visitEnd
1,343
void (String name) { int className = myContext.get(name); myUsages.add(UsageRepr.createClassUsage(myContext, className)); }
visitClassType
1,344
ClassFileRepr (int fileName, ClassReader cr, boolean isGenerated) { ClassCrawler visitor = new ClassCrawler(fileName, isGenerated); try { cr.accept(visitor, 0); } catch (RuntimeException e) { throw new RuntimeException("Corrupted .class file: " + myContext.getValue(fileName), e); } return visitor.getResult(); }
analyze
1,345
boolean (final K key) { return myMap.containsKey(key); }
containsKey
1,346
Collection<V> (final K key) { return myMap.get(key); }
get
1,347
void (ObjectObjectMultiMaplet<K, V> m) { m.forEachEntry((key, value) -> { put(key, value); return true; }); }
putAll
1,348
void (final K 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,349
void (K key, Collection<V> value) { if (value == null || value.isEmpty()) { myMap.remove(key); } else { myMap.put(key, value); } }
replace
1,350
void (final K 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,351
void (final K 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,352
void (K 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,353
void (final K key) { myMap.remove(key); }
remove
1,354
void (ObjectObjectMultiMaplet<K, V> m) { m.forEachEntry((key, value) -> { replace(key, value); return true; }); }
replaceAll
1,355
void (@NotNull PairProcessor<? super K, ? super Collection<V>> procedure) { for (Map.Entry<K, Collection<V>> entry : myMap.entrySet()) { if (!procedure.process(entry.getKey(), entry.getValue())) break; } }
forEachEntry
1,356
void () { myMap.clear(); // free memory }
close
1,357
void (boolean memoryCachesOnly) { }
flush
1,358
void (final DataOutput out) { try { DataInputOutputUtil.writeINT(out, access); DataInputOutputUtil.writeINT(out, signature); DataInputOutputUtil.writeINT(out, name); RW.save(annotations, out); } catch (IOException e) { throw new BuildDataCorruptedException(e); } }
save
1,359
boolean () { return (Opcodes.ACC_PUBLIC & access) != 0; }
isPublic
1,360
boolean () { return (Opcodes.ACC_PROTECTED & access) != 0; }
isProtected
1,361
boolean () { return (access & (Opcodes.ACC_PRIVATE | Opcodes.ACC_PROTECTED | Opcodes.ACC_PUBLIC)) == 0; }
isPackageLocal
1,362
boolean () { return (Opcodes.ACC_PRIVATE & access) != 0; }
isPrivate
1,363
boolean () { return (Opcodes.ACC_ABSTRACT & access) != 0; }
isAbstract
1,364
boolean () { return (Opcodes.ACC_BRIDGE & access) != 0; }
isBridge
1,365
boolean () { return (Opcodes.ACC_SYNTHETIC & access) != 0; }
isSynthetic
1,366
boolean () { return (Opcodes.ACC_ANNOTATION & access) != 0; }
isAnnotation
1,367
boolean () { return (Opcodes.ACC_FINAL & access) != 0; }
isFinal
1,368
boolean () { return (Opcodes.ACC_STATIC & access) != 0; }
isStatic
1,369
boolean (Proto anotherProto) { if (anotherProto.isPrivate()) { return this.isPackageLocal() || this.isProtected() || this.isPublic(); } if (anotherProto.isPackageLocal()) { return this.isProtected() || this.isPublic(); } if (anotherProto.isProtected()) { return this.isPublic(); } return false; }
isMoreAccessibleThan
1,370
Difference (final Proto past) { int diff = Difference.NONE; if (past.access != access) { diff |= Difference.ACCESS; } if (past.signature != signature) { diff |= Difference.SIGNATURE; } final Difference.Specifier<TypeRepr.ClassType, Difference> ann = Difference.make(past.annotations, annotations); if (!ann.unchanged()) { diff |= Difference.ANNOTATIONS; } final int base = diff; return new Difference() { @Override public int base() { return base; } @Override public boolean no() { return base == NONE; } @Override public int addedModifiers() { return ~past.access & access; } @Override public int removedModifiers() { return ~access & past.access; } @Override public boolean packageLocalOn() { return !past.isPackageLocal() && Proto.this.isPackageLocal(); } @Override public boolean hadValue() { return false; } @Override public boolean accessRestricted() { return Difference.weakerAccess(access, past.access); } @Override public boolean accessExpanded() { return Difference.weakerAccess(past.access, access); } @Override public Specifier<TypeRepr.ClassType, Difference> annotations() { return ann; } }; }
difference
1,371
int () { return base; }
base
1,372
boolean () { return base == NONE; }
no
1,373
int () { return ~past.access & access; }
addedModifiers
1,374
int () { return ~access & past.access; }
removedModifiers
1,375
boolean () { return !past.isPackageLocal() && Proto.this.isPackageLocal(); }
packageLocalOn
1,376
boolean () { return false; }
hadValue
1,377
boolean () { return Difference.weakerAccess(access, past.access); }
accessRestricted
1,378
boolean () { return Difference.weakerAccess(past.access, access); }
accessExpanded
1,379
void (final DependencyContext context, final PrintStream stream) { final String d = this instanceof ClassRepr ? " " : " "; if (this instanceof ClassRepr) { stream.print(" Class "); stream.println(context.getValue(name)); } else if (this instanceof MethodRepr) { stream.print(" Method "); stream.println(context.getValue(name)); } else if (this instanceof FieldRepr) { stream.print(" Field "); stream.println(context.getValue(name)); } else if (this instanceof ModuleRepr) { stream.print(" Module "); stream.println(context.getValue(name)); } stream.print(d); stream.print("Access : "); stream.println(access); stream.print(d); stream.print("Signature : "); stream.println(context.getValue(signature)); }
toStream
1,380
void (final DependencyContext context, final int owner, final Set<? super UsageRepr.Usage> s) { myType.updateClassUsages(context, owner, s); }
updateClassUsages
1,381
boolean (final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final FieldRepr fieldRepr = (FieldRepr)o; return name == fieldRepr.name; }
equals
1,382
int () { return 31 * name; }
hashCode
1,383
DataExternalizer<FieldRepr> (final DependencyContext context) { return new DataExternalizer<FieldRepr>() { @Override public void save(final @NotNull DataOutput out, final FieldRepr value) { value.save(out); } @Override public FieldRepr read(final @NotNull DataInput in) { return new FieldRepr(context, in); } }; }
externalizer
1,384
void (final @NotNull DataOutput out, final FieldRepr value) { value.save(out); }
save
1,385
FieldRepr (final @NotNull DataInput in) { return new FieldRepr(context, in); }
read
1,386
ConstantRef (String ownerClass, String fieldName, String descriptor) { return new ConstantRef() { @Override public String getOwner() { return ownerClass; } @Override public String getName() { return fieldName; } @Override public String getDescriptor() { return descriptor; } }; }
createConstantReference
1,387
String () { return ownerClass; }
getOwner
1,388
String () { return fieldName; }
getName
1,389
String () { return descriptor; }
getDescriptor
1,390
boolean () { return myKnown; }
isKnown
1,391
Collection<File> () { return myAffectedFiles; }
getAffectedFiles
1,392
ConstantAffection (final Collection<? extends ConstantAffection> affections) { if (affections.isEmpty()) { return new ConstantAffection(Collections.emptyList()); // return a 'known' affection here } if (affections.size() == 1) { return affections.iterator().next(); } for (ConstantAffection a : affections) { if (!a.isKnown()) { return EMPTY; } } final Collection<File> affected = new SmartList<>(); for (ConstantAffection affection : affections) { affected.addAll(affection.getAffectedFiles()); } return new ConstantAffection(affected); }
compose
1,393
int () { return myVersion; }
getVersion
1,394
Set<ModuleRequiresRepr> () { return myRequires; }
getRequires
1,395
Set<ModulePackageRepr> () { return myExports; }
getExports
1,396
void (DataOutput out) { super.save(out); try { DataInputOutputUtil.writeINT(out, myVersion); RW.save(myRequires, out); RW.save(myExports, out); } catch (IOException e) { throw new BuildDataCorruptedException(e); } }
save
1,397
void (DependencyContext context, Set<? super UsageRepr.Usage> s) { for (ModuleRequiresRepr require : myRequires) { if (require.name != name) { s.add(UsageRepr.createModuleUsage(context, require.name)); } } }
updateClassUsages
1,398
void (DependencyContext context, PrintStream stream) { super.toStream(context, stream); stream.println(" Requires:"); streamProtoCollection(context, stream, myRequires); stream.println(" End Of Requires"); stream.println(" Exports:"); streamProtoCollection(context, stream, myExports); stream.println(" End Of Exports"); }
toStream
1,399
boolean (int requirementName) { for (ModuleRequiresRepr require : myRequires) { if (require.name == requirementName) { return require.isTransitive(); } } return false; }
requiresTransitevely