protected boolean needsVisibilityAdjustment(final IMember member, final boolean references, final IProgressMonitor monitor, final RefactoringStatus status) throws JavaModelException { if (JdtFlags.isPublic(member) || JdtFlags.isProtected(member)) return false; if (!references) return true; return hasNonMovedReferences(member, monitor, status); } }
protected boolean needsVisibilityAdjustment(final IMember member, final boolean references, final IProgressMonitor monitor, final RefactoringStatus status) throws JavaModelException { if (JdtFlags.isPublic(member) || JdtFlags.isProtected(member)) return false; if (!references) return true; return hasNonMovedReferences(member, monitor, status); } }
public boolean filters(JavaElementMatch match) { Object element= match.getElement(); if (element instanceof IMember) { try { return ! JdtFlags.isPublic((IMember) element); } catch (JavaModelException e) { JavaPlugin.log(e); } } return false; } public String getName() {
@Override public boolean filters(JavaElementMatch match) { Object element= match.getElement(); if (element instanceof IMember) { try { return ! JdtFlags.isPublic((IMember) element); } catch (JavaModelException e) { JavaPlugin.log(e); } } return false; } @Override
public static int getVisibilityCode(IMember member) throws JavaModelException { if (isPublic(member)) return Modifier.PUBLIC; else if (isProtected(member)) return Modifier.PROTECTED; else if (isPackageVisible(member)) return Modifier.NONE; else if (isPrivate(member)) return Modifier.PRIVATE; Assert.isTrue(false); return VISIBILITY_CODE_INVALID; }
public static int getVisibilityCode(BodyDeclaration bodyDeclaration) { if (isPublic(bodyDeclaration)) return Modifier.PUBLIC; else if (isProtected(bodyDeclaration)) return Modifier.PROTECTED; else if (isPackageVisible(bodyDeclaration)) return Modifier.NONE; else if (isPrivate(bodyDeclaration)) return Modifier.PRIVATE; Assert.isTrue(false); return VISIBILITY_CODE_INVALID; }
public static int getVisibilityCode(IBinding binding) { if (isPublic(binding)) return Modifier.PUBLIC; else if (isProtected(binding)) return Modifier.PROTECTED; else if (isPackageVisible(binding)) return Modifier.NONE; else if (isPrivate(binding)) return Modifier.PRIVATE; Assert.isTrue(false); return VISIBILITY_CODE_INVALID; }
public static int getVisibilityCode(IBinding binding) { if (isPublic(binding)) return Modifier.PUBLIC; else if (isProtected(binding)) return Modifier.PROTECTED; else if (isPackageVisible(binding)) return Modifier.NONE; else if (isPrivate(binding)) return Modifier.PRIVATE; Assert.isTrue(false); return VISIBILITY_CODE_INVALID; }
public static int getVisibilityCode(BodyDeclaration bodyDeclaration) { if (isPublic(bodyDeclaration)) return Modifier.PUBLIC; else if (isProtected(bodyDeclaration)) return Modifier.PROTECTED; else if (isPackageVisible(bodyDeclaration)) return Modifier.NONE; else if (isPrivate(bodyDeclaration)) return Modifier.PRIVATE; Assert.isTrue(false); return VISIBILITY_CODE_INVALID; }
int getNewModifiersForCopyInSubclass(int oldModifiers) throws JavaModelException { if (isFieldInfo()) return oldModifiers; if (isToBeDeletedFromDeclaringClass()) return oldModifiers; int modifiers= oldModifiers; if (isNewMethodToBeDeclaredAbstract()) { if (!JdtFlags.isPublic(fMember)) modifiers= Modifier.PROTECTED | JdtFlags.clearAccessModifiers(modifiers); } return modifiers; }
public static int getVisibilityCode(IMember member) throws JavaModelException { if (isPublic(member)) return Modifier.PUBLIC; else if (isProtected(member)) return Modifier.PROTECTED; else if (isPackageVisible(member)) return Modifier.NONE; else if (isPrivate(member)) return Modifier.PRIVATE; Assert.isTrue(false); return VISIBILITY_CODE_INVALID; }
int getNewModifiersForCopyInSubclass(int oldModifiers) throws JavaModelException { if (isFieldInfo()) return oldModifiers; if (isToBeDeletedFromDeclaringClass()) return oldModifiers; int modifiers= oldModifiers; if (isNewMethodToBeDeclaredAbstract()) { if (!JdtFlags.isPublic(fMember)) modifiers= Modifier.PROTECTED | JdtFlags.clearAccessModifiers(modifiers); } return modifiers; }
public static int getVisibilityCode(BodyDeclaration bodyDeclaration) { if (isPublic(bodyDeclaration)) return Modifier.PUBLIC; else if (isProtected(bodyDeclaration)) return Modifier.PROTECTED; else if (isPackageVisible(bodyDeclaration)) return Modifier.NONE; else if (isPrivate(bodyDeclaration)) return Modifier.PRIVATE; Assert.isTrue(false); return VISIBILITY_CODE_INVALID; }
private void analyzeImportedTypes(IType[] types, RefactoringStatus result, IImportDeclaration imp) throws CoreException { for (int i= 0; i < types.length; i++) { //could this be a problem (same package imports)? if (JdtFlags.isPublic(types[i]) && types[i].getElementName().equals(getNewElementName())){ String msg= Messages.format(RefactoringCoreMessages.RenameTypeRefactoring_name_conflict1, new Object[]{JavaModelUtil.getFullyQualifiedName(types[i]), getFullPath(getCompilationUnit(imp))}); result.addError(msg, JavaStatusContext.create(imp)); } } }
private void analyzeImportedTypes(IType[] types, RefactoringStatus result, IImportDeclaration imp) throws CoreException { for (int i = 0; i < types.length; i++) { //could this be a problem (same package imports)? if (JdtFlags.isPublic(types[i]) && types[i].getElementName().equals(getNewElementName())) { String msg = Messages.format(RefactoringCoreMessages.RenameTypeRefactoring_name_conflict1, new Object[] { JavaElementLabels.getElementLabel(types[i], JavaElementLabels.ALL_FULLY_QUALIFIED), BasicElementLabels.getPathLabel(getCompilationUnit(imp).getPath(), false) }); result.addError(msg, JavaStatusContext.create(imp)); } } }
private void analyzeImportedTypes(IType[] types, RefactoringStatus result, IImportDeclaration imp) throws CoreException { for (int i= 0; i < types.length; i++) { //could this be a problem (same package imports)? if (JdtFlags.isPublic(types[i]) && types[i].getElementName().equals(getNewElementName())){ String msg= Messages.format(RefactoringCoreMessages.RenameTypeRefactoring_name_conflict1, new Object[]{ JavaElementLabels.getElementLabel(types[i], JavaElementLabels.ALL_FULLY_QUALIFIED), BasicElementLabels.getPathLabel(getCompilationUnit(imp).getPath(), false)}); result.addError(msg, JavaStatusContext.create(imp)); } } }
private void analyzeImportedTypes(IType[] types, RefactoringStatus result, IImportDeclaration imp) throws CoreException { for (int i= 0; i < types.length; i++) { //could this be a problem (same package imports)? if (JdtFlags.isPublic(types[i]) && types[i].getElementName().equals(getNewElementName())){ String msg= Messages.format(RefactoringCoreMessages.RenameTypeRefactoring_name_conflict1, new Object[]{ JavaElementLabels.getElementLabel(types[i], JavaElementLabels.ALL_FULLY_QUALIFIED), BasicElementLabels.getPathLabel(getCompilationUnit(imp).getPath(), false)}); result.addError(msg, JavaStatusContext.create(imp)); } } }
private BodyDeclaration createNewTypeDeclarationNode(final IType type, final AbstractTypeDeclaration oldType, final CompilationUnit declaringCuNode, final TypeVariableMaplet[] mapping, final ASTRewrite rewrite) throws JavaModelException { final ICompilationUnit declaringCu= getDeclaringType().getCompilationUnit(); if (!JdtFlags.isPublic(type) && !JdtFlags.isProtected(type)) { if (mapping.length > 0) return createPlaceholderForTypeDeclaration(oldType, declaringCu, mapping, rewrite, true); return createPlaceholderForProtectedTypeDeclaration(oldType, declaringCuNode, declaringCu, rewrite, true); } if (mapping.length > 0) return createPlaceholderForTypeDeclaration(oldType, declaringCu, mapping, rewrite, true); return createPlaceholderForTypeDeclaration(oldType, declaringCu, rewrite, true); }
private BodyDeclaration createNewTypeDeclarationNode(final IType type, final AbstractTypeDeclaration oldType, final CompilationUnit declaringCuNode, final TypeVariableMaplet[] mapping, final ASTRewrite rewrite) throws JavaModelException { final ICompilationUnit declaringCu= getDeclaringType().getCompilationUnit(); if (!JdtFlags.isPublic(type) && !JdtFlags.isProtected(type)) { if (mapping.length > 0) return createPlaceholderForTypeDeclaration(oldType, declaringCu, mapping, rewrite, true); return createPlaceholderForProtectedTypeDeclaration(oldType, declaringCuNode, declaringCu, rewrite, true); } if (mapping.length > 0) return createPlaceholderForTypeDeclaration(oldType, declaringCu, mapping, rewrite, true); return createPlaceholderForTypeDeclaration(oldType, declaringCu, rewrite, true); }
private BodyDeclaration createNewTypeDeclarationNode(final IType type, final AbstractTypeDeclaration oldType, final CompilationUnit declaringCuNode, final TypeVariableMaplet[] mapping, final ASTRewrite rewrite) throws JavaModelException { final ICompilationUnit declaringCu= getDeclaringType().getCompilationUnit(); if (!JdtFlags.isPublic(type) && !JdtFlags.isProtected(type)) { if (mapping.length > 0) return createPlaceholderForTypeDeclaration(oldType, declaringCu, mapping, rewrite, true); return createPlaceholderForProtectedTypeDeclaration(oldType, declaringCuNode, declaringCu, rewrite, true); } if (mapping.length > 0) return createPlaceholderForTypeDeclaration(oldType, declaringCu, mapping, rewrite, true); return createPlaceholderForTypeDeclaration(oldType, declaringCu, rewrite, true); }