HashSet handledProblems= new HashSet(locations.length); for (int i= 0; i < locations.length; i++) { IProblemLocation curr= locations[i]; Integer id= new Integer(curr.getProblemId()); if (handledProblems.add(id)) { process(context, curr, resultingCollections); }
switch (id) { case IProblem.UnterminatedString: String quoteLabel= CorrectionMessages.getString("JavaCorrectionProcessor.addquote.description"); int pos= moveBack(problem.getOffset() + problem.getLength(), problem.getOffset(), "\n\r", context.getCompilationUnit()); proposals.add(new ReplaceCorrectionProposal(quoteLabel, context.getCompilationUnit(), pos, 0, "\"", 0)); break; case IProblem.UnusedImport: case IProblem.DuplicateImport: case IProblem.CannotImportPackage: case IProblem.ConflictingImport: case IProblem.ImportNotFound: ReorgCorrectionsSubProcessor.removeImportStatementProposals(context, problem, proposals); break; case IProblem.UndefinedMethod: UnresolvedElementsSubProcessor.getMethodProposals(context, problem, false, proposals); break; case IProblem.UndefinedConstructor: UnresolvedElementsSubProcessor.getConstructorProposals(context, problem, proposals); break; case IProblem.ParameterMismatch: UnresolvedElementsSubProcessor.getMethodProposals(context, problem, true, proposals); break; case IProblem.MethodButWithConstructorName: ReturnTypeSubProcessor.addMethodWithConstrNameProposals(context, problem, proposals); break; case IProblem.UndefinedField: case IProblem.UndefinedName: UnresolvedElementsSubProcessor.getVariableProposals(context, problem, proposals); break; case IProblem.FieldTypeAmbiguous: case IProblem.ArgumentTypeAmbiguous: case IProblem.ExceptionTypeAmbiguous: case IProblem.ReturnTypeAmbiguous: case IProblem.SuperclassAmbiguous: case IProblem.InterfaceAmbiguous: case IProblem.AmbiguousType: UnresolvedElementsSubProcessor.getAmbiguosTypeReferenceProposals(context, problem, proposals); break; case IProblem.PublicClassMustMatchFileName: ReorgCorrectionsSubProcessor.getWrongTypeNameProposals(context, problem, proposals); break; case IProblem.PackageIsNotExpectedPackage: ReorgCorrectionsSubProcessor.getWrongPackageDeclNameProposals(context, problem, proposals); break; case IProblem.UndefinedType: case IProblem.FieldTypeNotFound: case IProblem.ArgumentTypeNotFound: case IProblem.ReturnTypeNotFound: case IProblem.SuperclassNotFound: case IProblem.ExceptionTypeNotFound: case IProblem.InterfaceNotFound: UnresolvedElementsSubProcessor.getTypeProposals(context, problem, proposals); break; case IProblem.TypeMismatch: LocalCorrectionsSubProcessor.addCastProposals(context, problem, proposals); break; case IProblem.UnhandledException: LocalCorrectionsSubProcessor.addUncaughtExceptionProposals(context, problem, proposals); break; case IProblem.UnreachableCatch: LocalCorrectionsSubProcessor.addUnreachableCatchProposals(context, problem, proposals); break; case IProblem.VoidMethodReturnsValue: ReturnTypeSubProcessor.addVoidMethodReturnsProposals(context, problem, proposals); break; case IProblem.MissingReturnType: ReturnTypeSubProcessor.addMissingReturnTypeProposals(context, problem, proposals); break; case IProblem.ShouldReturnValue: ReturnTypeSubProcessor.addMissingReturnStatementProposals(context, problem, proposals); break; case IProblem.NonExternalizedStringLiteral: LocalCorrectionsSubProcessor.addNLSProposals(context, problem, proposals); break; case IProblem.NonStaticAccessToStaticField: case IProblem.NonStaticAccessToStaticMethod: LocalCorrectionsSubProcessor.addInstanceAccessToStaticProposals(context, problem, proposals); break; case IProblem.StaticMethodRequested: case IProblem.NonStaticFieldFromStaticInvocation: case IProblem.InstanceMethodDuringConstructorInvocation: case IProblem.InstanceFieldDuringConstructorInvocation: ModifierCorrectionSubProcessor.addNonAccessibleMemberProposal(context, problem, proposals, ModifierCorrectionSubProcessor.TO_STATIC, 5); break; case IProblem.NotVisibleMethod: case IProblem.NotVisibleConstructor: case IProblem.NotVisibleType: case IProblem.SuperclassNotVisible: case IProblem.InterfaceNotVisible: case IProblem.FieldTypeNotVisible: case IProblem.ArgumentTypeNotVisible: case IProblem.ReturnTypeNotVisible: case IProblem.ExceptionTypeNotVisible: case IProblem.NotVisibleField: case IProblem.ImportNotVisible: ModifierCorrectionSubProcessor.addNonAccessibleMemberProposal(context, problem, proposals, ModifierCorrectionSubProcessor.TO_VISIBLE, 5); break; case IProblem.BodyForAbstractMethod: case IProblem.AbstractMethodInAbstractClass: ModifierCorrectionSubProcessor.addAbstractMethodProposals(context, problem, proposals); break; case IProblem.AbstractMethodMustBeImplemented: LocalCorrectionsSubProcessor.addUnimplementedMethodsProposals(context, problem, proposals); break; case IProblem.BodyForNativeMethod: ModifierCorrectionSubProcessor.addNativeMethodProposals(context, problem, proposals); break; case IProblem.MethodRequiresBody: ModifierCorrectionSubProcessor.addMethodRequiresBodyProposals(context, problem, proposals); break; case IProblem.OuterLocalMustBeFinal: ModifierCorrectionSubProcessor.addNonFinalLocalProposal(context, problem, proposals); break; case IProblem.UninitializedLocalVariable: LocalCorrectionsSubProcessor.addUninitializedLocalVariableProposal(context, problem, proposals); break; case IProblem.UnhandledExceptionInDefaultConstructor: case IProblem.UndefinedConstructorInDefaultConstructor: case IProblem.NotVisibleConstructorInDefaultConstructor: LocalCorrectionsSubProcessor.addConstructorFromSuperclassProposal(context, problem, proposals); break; case IProblem.UnusedPrivateMethod: case IProblem.UnusedPrivateConstructor: case IProblem.UnusedPrivateField: case IProblem.UnusedPrivateType: case IProblem.LocalVariableIsNeverUsed: case IProblem.ArgumentIsNeverUsed: LocalCorrectionsSubProcessor.addUnusedMemberProposal(context, problem, proposals); break; case IProblem.NeedToEmulateFieldReadAccess: case IProblem.NeedToEmulateFieldWriteAccess: case IProblem.NeedToEmulateMethodAccess: case IProblem.NeedToEmulateConstructorAccess: ModifierCorrectionSubProcessor.addNonAccessibleMemberProposal(context, problem, proposals, ModifierCorrectionSubProcessor.TO_NON_PRIVATE, 5); break; default:
	public void process(IAssistContext context, IProblemLocation[] locations, Collection resultingCollections) throws CoreException {		if (locations == null || locations.length == 0) {			return;		}				HashSet handledProblems= new HashSet(locations.length);		for (int i= 0; i < locations.length; i++) {			IProblemLocation curr= locations[i];			Integer id= new Integer(curr.getProblemId());			if (handledProblems.add(id)) {				process(context, curr, resultingCollections);			}		}	}