Merge pull request #287 from pierlauro/master

Protected visibility for JavaSourceLoaderImpl's internal methods and classes
This commit is contained in:
Julian Dolby 2018-04-13 17:02:24 -04:00 committed by GitHub
commit 883b7282f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 28 additions and 28 deletions

View File

@ -165,17 +165,17 @@ public abstract class JavaSourceLoaderImpl extends ClassLoaderImpl {
return result; return result;
} }
private void addMethod(CAstEntity methodEntity, IClass owner, AbstractCFG<?, ?> cfg, SymbolTable symtab, boolean hasCatchBlock, protected void addMethod(CAstEntity methodEntity, IClass owner, AbstractCFG<?, ?> cfg, SymbolTable symtab, boolean hasCatchBlock,
Map<IBasicBlock<SSAInstruction>, TypeReference[]> caughtTypes, boolean hasMonitorOp, AstLexicalInformation lexicalInfo, DebuggingInformation debugInfo) { Map<IBasicBlock<SSAInstruction>, TypeReference[]> caughtTypes, boolean hasMonitorOp, AstLexicalInformation lexicalInfo, DebuggingInformation debugInfo) {
declaredMethods.put(Util.methodEntityToSelector(methodEntity), new ConcreteJavaMethod(methodEntity, owner, cfg, symtab, declaredMethods.put(Util.methodEntityToSelector(methodEntity), new ConcreteJavaMethod(methodEntity, owner, cfg, symtab,
hasCatchBlock, caughtTypes, hasMonitorOp, lexicalInfo, debugInfo)); hasCatchBlock, caughtTypes, hasMonitorOp, lexicalInfo, debugInfo));
} }
private void addMethod(CAstEntity methodEntity, IClass owner) { protected void addMethod(CAstEntity methodEntity, IClass owner) {
declaredMethods.put(Util.methodEntityToSelector(methodEntity), new AbstractJavaMethod(methodEntity, owner)); declaredMethods.put(Util.methodEntityToSelector(methodEntity), new AbstractJavaMethod(methodEntity, owner));
} }
private void addField(CAstEntity fieldEntity) { protected void addField(CAstEntity fieldEntity) {
declaredFields.put(Util.fieldEntityToAtom(fieldEntity), new JavaField(fieldEntity, JavaSourceLoaderImpl.this, this, JavaSourceLoaderImpl.this.getAnnotations(fieldEntity))); declaredFields.put(Util.fieldEntityToAtom(fieldEntity), new JavaField(fieldEntity, JavaSourceLoaderImpl.this, this, JavaSourceLoaderImpl.this.getAnnotations(fieldEntity)));
} }
@ -199,7 +199,7 @@ public abstract class JavaSourceLoaderImpl extends ClassLoaderImpl {
} }
} }
private Collection<Annotation> getAnnotations(CAstEntity e) { protected Collection<Annotation> getAnnotations(CAstEntity e) {
Collection<CAstAnnotation> annotations = e.getAnnotations(); Collection<CAstAnnotation> annotations = e.getAnnotations();
if (annotations == null || annotations.isEmpty()) { if (annotations == null || annotations.isEmpty()) {
return null; return null;
@ -227,8 +227,8 @@ public abstract class JavaSourceLoaderImpl extends ClassLoaderImpl {
* *
* @author rfuhrer * @author rfuhrer
*/ */
private class JavaField extends AstField { protected class JavaField extends AstField {
private JavaField(CAstEntity fieldEntity, IClassLoader loader, IClass declaringClass, Collection<Annotation> annotations) { protected JavaField(CAstEntity fieldEntity, IClassLoader loader, IClass declaringClass, Collection<Annotation> annotations) {
super(FieldReference.findOrCreate(declaringClass.getReference(), Atom.findOrCreateUnicodeAtom(fieldEntity.getName()), super(FieldReference.findOrCreate(declaringClass.getReference(), Atom.findOrCreateUnicodeAtom(fieldEntity.getName()),
TypeReference.findOrCreate(loader.getReference(), TypeName.string2TypeName(fieldEntity.getType().getName()))), TypeReference.findOrCreate(loader.getReference(), TypeName.string2TypeName(fieldEntity.getType().getName()))),
fieldEntity.getQualifiers(), declaringClass, declaringClass.getClassHierarchy(), annotations); fieldEntity.getQualifiers(), declaringClass, declaringClass.getClassHierarchy(), annotations);
@ -241,7 +241,7 @@ public abstract class JavaSourceLoaderImpl extends ClassLoaderImpl {
* *
* @author rfuhrer * @author rfuhrer
*/ */
private abstract class JavaEntityMethod extends AstMethod { protected abstract class JavaEntityMethod extends AstMethod {
private final TypeReference[] parameterTypes; private final TypeReference[] parameterTypes;
private final TypeReference[] exceptionTypes; private final TypeReference[] exceptionTypes;
@ -276,7 +276,7 @@ public abstract class JavaSourceLoaderImpl extends ClassLoaderImpl {
return parameterTypes[i]; return parameterTypes[i];
} }
private TypeReference[] computeParameterTypes(CAstEntity methodEntity) { protected TypeReference[] computeParameterTypes(CAstEntity methodEntity) {
TypeReference[] types; TypeReference[] types;
CAstType.Function type = (Function) methodEntity.getType(); CAstType.Function type = (Function) methodEntity.getType();
int argCount = type.getArgumentTypes().size(); int argCount = type.getArgumentTypes().size();
@ -303,7 +303,7 @@ public abstract class JavaSourceLoaderImpl extends ClassLoaderImpl {
return exceptionTypes; return exceptionTypes;
} }
private TypeReference[] computeExceptionTypes(CAstEntity methodEntity) { protected TypeReference[] computeExceptionTypes(CAstEntity methodEntity) {
CAstType.Function fType = (Function) methodEntity.getType(); CAstType.Function fType = (Function) methodEntity.getType();
Collection<CAstType> exceptionTypes = fType.getExceptionTypes(); Collection<CAstType> exceptionTypes = fType.getExceptionTypes();
@ -329,7 +329,7 @@ public abstract class JavaSourceLoaderImpl extends ClassLoaderImpl {
* *
* @author rfuhrer * @author rfuhrer
*/ */
private class AbstractJavaMethod extends JavaEntityMethod { protected class AbstractJavaMethod extends JavaEntityMethod {
public AbstractJavaMethod(CAstEntity methodEntity, IClass owner) { public AbstractJavaMethod(CAstEntity methodEntity, IClass owner) {
super(methodEntity, owner); super(methodEntity, owner);
} }
@ -528,7 +528,7 @@ public abstract class JavaSourceLoaderImpl extends ClassLoaderImpl {
((JavaClass) owner).addField(n); ((JavaClass) owner).addField(n);
} }
private static TypeName toWALATypeName(CAstType type) { protected static TypeName toWALATypeName(CAstType type) {
return TypeName.string2TypeName(type.getName()); return TypeName.string2TypeName(type.getName());
} }
@ -659,7 +659,7 @@ public abstract class JavaSourceLoaderImpl extends ClassLoaderImpl {
} }
} }
private static final InstructionFactory insts = new InstructionFactory(); protected static final InstructionFactory insts = new InstructionFactory();
@Override @Override
public InstructionFactory getInstructionFactory() { public InstructionFactory getInstructionFactory() {