private static boolean isEnumTypeFinal(IMember member) throws JavaModelException { if (!(isEnum(member) && member.getElementType() == IJavaElement.TYPE)) return false; // An enum type is implicitly final unless it contains at least one enum constant that has a class body. IJavaElement[] children= member.getChildren(); for (IJavaElement child : children) { if (isEnumConstant((IMember) child) && ((IField) child).getChildren().length != 0) { return false; } } return true; }
private static boolean isEnumTypeFinal(IMember member) throws JavaModelException { if (!(isEnum(member) && member.getElementType() == IJavaElement.TYPE)) return false; // An enum type is implicitly final unless it contains at least one enum constant that has a class body. IJavaElement[] children= member.getChildren(); for (IJavaElement child : children) { if (isEnumConstant((IMember) child) && ((IField) child).getChildren().length != 0) { return false; } } return true; }
private static boolean isEnumTypeFinal(IMember member) throws JavaModelException { if (!(isEnum(member) && member.getElementType() == IJavaElement.TYPE)) { return false; } // An enum type is implicitly final unless it contains at least one enum constant that has a class body. IJavaElement[] children= member.getChildren(); for (IJavaElement child : children) { if (isEnumConstant((IMember) child) && ((IField) child).getChildren().length != 0) { return false; } } return true; }
private void collectChildrenWithMissingSerialVersionId(IJavaElement[] children, IType serializable, List result) throws JavaModelException { for (int i= 0; i < children.length; i++) { IJavaElement child= children[i]; if (child instanceof IType) { IType type= (IType)child; if (type.isClass()) { IField field= type.getField(NAME_FIELD); if (!field.exists()) { ITypeHierarchy hierarchy= type.newSupertypeHierarchy(new NullProgressMonitor()); IType[] interfaces= hierarchy.getAllSuperInterfaces(type); for (int j= 0; j < interfaces.length; j++) { if (interfaces[j].equals(serializable)) { result.add(type); break; } } } } collectChildrenWithMissingSerialVersionId(type.getChildren(), serializable, result); } else if (child instanceof IMethod) { collectChildrenWithMissingSerialVersionId(((IMethod)child).getChildren(), serializable, result); } else if (child instanceof IField) { collectChildrenWithMissingSerialVersionId(((IField)child).getChildren(), serializable, result); } } } }
private void collectChildrenWithMissingSerialVersionId(IJavaElement[] children, IType serializable, List<IType> result) throws JavaModelException { for (int i= 0; i < children.length; i++) { IJavaElement child= children[i]; if (child instanceof IType) { IType type= (IType)child; if (type.isClass()) { IField field= type.getField(NAME_FIELD); if (!field.exists()) { ITypeHierarchy hierarchy= type.newSupertypeHierarchy(new NullProgressMonitor()); IType[] interfaces= hierarchy.getAllSuperInterfaces(type); for (int j= 0; j < interfaces.length; j++) { if (interfaces[j].equals(serializable)) { result.add(type); break; } } } } collectChildrenWithMissingSerialVersionId(type.getChildren(), serializable, result); } else if (child instanceof IMethod) { collectChildrenWithMissingSerialVersionId(((IMethod)child).getChildren(), serializable, result); } else if (child instanceof IField) { collectChildrenWithMissingSerialVersionId(((IField)child).getChildren(), serializable, result); } } } }
private void collectChildrenWithMissingSerialVersionId(IJavaElement[] children, IType serializable, List<IType> result) throws JavaModelException { for (int i = 0; i < children.length; i++) { IJavaElement child = children[i]; if (child instanceof IType) { IType type = (IType) child; if (type.isClass()) { IField field = type.getField(NAME_FIELD); if (!field.exists()) { ITypeHierarchy hierarchy = type.newSupertypeHierarchy(new NullProgressMonitor()); IType[] interfaces = hierarchy.getAllSuperInterfaces(type); for (int j = 0; j < interfaces.length; j++) { if (interfaces[j].equals(serializable)) { result.add(type); break; } } } } collectChildrenWithMissingSerialVersionId(type.getChildren(), serializable, result); } else if (child instanceof IMethod) { collectChildrenWithMissingSerialVersionId(((IMethod) child).getChildren(), serializable, result); } else if (child instanceof IField) { collectChildrenWithMissingSerialVersionId(((IField) child).getChildren(), serializable, result); } } } }
private void collectChildrenWithMissingSerialVersionId(IJavaElement[] children, IType serializable, List<IType> result) throws JavaModelException { for (int i= 0; i < children.length; i++) { IJavaElement child= children[i]; if (child instanceof IType) { IType type= (IType)child; if (type.isClass()) { IField field= type.getField(NAME_FIELD); if (!field.exists()) { ITypeHierarchy hierarchy= type.newSupertypeHierarchy(new NullProgressMonitor()); IType[] interfaces= hierarchy.getAllSuperInterfaces(type); for (int j= 0; j < interfaces.length; j++) { if (interfaces[j].equals(serializable)) { result.add(type); break; } } } } collectChildrenWithMissingSerialVersionId(type.getChildren(), serializable, result); } else if (child instanceof IMethod) { collectChildrenWithMissingSerialVersionId(((IMethod)child).getChildren(), serializable, result); } else if (child instanceof IField) { collectChildrenWithMissingSerialVersionId(((IField)child).getChildren(), serializable, result); } } } }