@Override public void visit(Method obj) { if (DEBUG) { System.out.println("Checking " + getClassName() + "." + obj.getName()); } if (Const.CONSTRUCTOR_NAME.equals(getMethodName()) && (obj.isPublic() || obj.isProtected())) { publicOrProtectedConstructor = true; } pendingGetField = null; saState = 0; super.visit(obj); int flags = obj.getAccessFlags(); if ((flags & Const.ACC_NATIVE) != 0) { hasNativeMethods = true; } }
@Override public void visit(Code obj) { if (Const.CONSTRUCTOR_NAME.equals(getMethodName()) && (getMethod().isPublic() || getMethod().isProtected())) { super.visit(obj); bugAccumulator.reportAccumulatedBugs(); } }
@Override public void visit(Code obj) { if (!getMethod().isPublic() && !getMethod().isProtected()) { return;
|| getMethod().isProtected() && !samePackage(getDottedClassName(), superclassName)) { return;
&& (obj.isPublic() || obj.isProtected()) && !hasBadMethodNames ? NORMAL_PRIORITY : LOW_PRIORITY) .addClassAndMethod(this));
if (method.isPublic()) { priority = NORMAL_PRIORITY; } else if (method.isProtected() || isDefaultAccess) { priority = NORMAL_PRIORITY;
private List<FieldOrMethod> getMembers(JavaClass javaClass, List<JavaClass> interfaces) { Set<String> methodNames = new HashSet<>(); ArrayList<FieldOrMethod> members = new ArrayList<>(); List<Method> allInterfacesMethods = getAllInterfacesMethods(interfaces); List<Method> methods = new ArrayList<>(); methods.addAll(Arrays.asList(javaClass.getMethods())); methods.addAll(allInterfacesMethods); for (Method m : methods) { if ((m.isPublic() || m.isProtected()) && !m.isSynthetic()) { members.add(m); methodNames.add(m.getName()); } } for (Field f : javaClass.getFields()) { if ((f.isPublic() || f.isProtected()) && !f.isSynthetic() && !methodNames.contains(f.getName())) { members.add(f); } } return members; }
@Override public void visit(Method obj) { if (DEBUG) { System.out.println("Checking " + getClassName() + "." + obj.getName()); } if ("<init>".equals(getMethodName()) && (obj.isPublic() || obj.isProtected())) { publicOrProtectedConstructor = true; } pendingGetField = null; saState = 0; super.visit(obj); int flags = obj.getAccessFlags(); if ((flags & ACC_NATIVE) != 0) { hasNativeMethods = true; } }
@Override public void visit(Code obj) { if ("<init>".equals(getMethodName()) && (getMethod().isPublic() || getMethod().isProtected())) { super.visit(obj); bugAccumulator.reportAccumulatedBugs(); } }
private void processMethod(Method m, JavaClass clazz, TypeDefinition typeDefinition, boolean isInterface, Set<String> methodsSet) { String name = m.getName(); if (isPrivateGoogleApiMember(name)) return; if (m.isSynthetic() || (!m.isPublic() && !m.isProtected())) { return; } // TODO: Pete: won't generate static initializers as invalid typescript properties if (clazz.isInterface() && name.equals("<clinit>")) { return; } loadBaseMethods(clazz); //loaded in "baseMethodNames" and "baseMethods" String tabs = getTabs(this.indent + 1); cacheMethodBySignature(m); //cached in "mapNameMethod" //generate base method content if (baseMethodNames.contains(name)) { for (Method bm : baseMethods) { if (bm.getName().equals(name)) { String sig = getMethodFullSignature(bm); if (!mapNameMethod.containsKey(sig)) { mapNameMethod.put(sig, bm); methodsSet.add(generateMethodContent(clazz, typeDefinition, isInterface, tabs, bm)); } } } } methodsSet.add(generateMethodContent(clazz, typeDefinition, isInterface, tabs, m)); }
if (!m.isSynthetic() && (m.isPublic() || m.isProtected())) { } else { for (Method m : currClass.getMethods()) { if (!m.isSynthetic() && (m.isPublic() || m.isProtected())) { baseMethods.add(m); baseMethodNames.add(m.getName());
@Override public void visit(Code obj) { if (!getMethod().isPublic() && !getMethod().isProtected()) { return;
|| getMethod().isProtected() && !samePackage(getDottedClassName(), superclassName)) { return;
&& (obj.isPublic() || obj.isProtected()) && !hasBadMethodNames ? NORMAL_PRIORITY : LOW_PRIORITY) .addClassAndMethod(this));
if (method.isPublic()) { priority = NORMAL_PRIORITY; } else if (method.isProtected() || isDefaultAccess) { priority = NORMAL_PRIORITY;
try { Method m = getMethod(); if ((!m.isPublic() && !m.isProtected()) || m.isAbstract() || m.isSynthetic()) { return;
try { Method m = getMethod(); if ((!m.isPublic() && !m.isProtected()) || m.isAbstract() || m.isSynthetic()) { return;
maxone++; if (obj.isProtected()) { maxone++; " exactly one of its ACC_PUBLIC and ACC_PRIVATE modifiers set."); if (obj.isProtected() || obj.isFinal() || obj.isSynchronized() || obj.isProtected() || obj.isStatic() || obj.isFinal()
int maxone=0; if (obj.isPrivate()) maxone++; if (obj.isProtected()) maxone++; if (obj.isPublic()) maxone++; if (maxone > 1){ obj.isProtected() || obj.isStatic() || obj.isFinal() ||