List of usage examples for org.eclipse.jdt.core.compiler CategorizedProblem getCategoryID
public abstract int getCategoryID();
From source file:astview.ProblemNode.java
License:Open Source License
private String getCategoryCode() { CategorizedProblem categorized = (CategorizedProblem) fProblem; int categoryID = categorized.getCategoryID(); StringBuffer buf = new StringBuffer(); switch (categoryID) { case CategorizedProblem.CAT_UNSPECIFIED: buf.append("Unspecified"); break;/*from w w w. j a va 2 s . c o m*/ case CategorizedProblem.CAT_BUILDPATH: buf.append("Buildpath"); break; case CategorizedProblem.CAT_SYNTAX: buf.append("Syntax"); break; case CategorizedProblem.CAT_IMPORT: buf.append("Import"); break; case CategorizedProblem.CAT_TYPE: buf.append("Type"); break; case CategorizedProblem.CAT_MEMBER: buf.append("Member"); break; case CategorizedProblem.CAT_INTERNAL: buf.append("Internal"); break; case CategorizedProblem.CAT_JAVADOC: buf.append("Javadoc"); break; case CategorizedProblem.CAT_CODE_STYLE: buf.append("Code Style"); break; case CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM: buf.append("Potential Programming Problem"); break; case CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT: buf.append("Name Shadowing Conflict"); break; case CategorizedProblem.CAT_DEPRECATION: buf.append("Deprecation"); break; case CategorizedProblem.CAT_UNNECESSARY_CODE: buf.append("Unnecessary Code"); break; case CategorizedProblem.CAT_UNCHECKED_RAW: buf.append("Unchecked Raw"); break; case CategorizedProblem.CAT_NLS: buf.append("NLS"); break; case CategorizedProblem.CAT_RESTRICTION: buf.append("Restriction"); break; default: buf.append("<UNKNOWN CATEGORY>"); break; } buf.append(" = ").append(categoryID); return buf.toString(); }
From source file:com.google.appengine.eclipse.core.validators.java.GaeCheckerTest.java
License:Open Source License
private static String toString(List<? extends CategorizedProblem> problems) { StringBuilder sb = new StringBuilder(); for (CategorizedProblem problem : problems) { sb.append("{\n"); sb.append(" categoryId : " + problem.getCategoryID() + "\n"); sb.append(" id : " + problem.getID() + "\n"); sb.append(" markerType : " + problem.getMarkerType() + "\n"); sb.append(" message : " + problem.getMessage() + "\n"); sb.append(" sourceEnd : " + problem.getSourceEnd() + "\n"); sb.append(" sourceLine : " + problem.getSourceLineNumber() + "\n"); sb.append(" sourceStart : " + problem.getSourceStart() + "\n"); sb.append("}\n"); sb.append(", "); }/*from w w w .j av a 2s . com*/ return sb.toString(); }
From source file:com.google.gwt.dev.javac.SerializableCategorizedProblem.java
License:Apache License
SerializableCategorizedProblem(CategorizedProblem problem) { this.categoryId = problem.getCategoryID(); this.markerType = problem.getMarkerType(); this.arguments = problem.getArguments(); this.message = problem.getMessage(); this.originatingFileName = problem.getOriginatingFileName(); this.sourceEnd = problem.getSourceEnd(); this.sourceLineNumber = problem.getSourceLineNumber(); this.sourceStart = problem.getSourceStart(); this.isError = problem.isError(); this.isWarning = problem.isWarning(); this.formattedString = problem.toString(); }
From source file:fromastview.ProblemNode.java
License:Open Source License
private String getCategoryCode() { CategorizedProblem categorized = (CategorizedProblem) fProblem; int categoryID = categorized.getCategoryID(); StringBuffer buf = new StringBuffer(); switch (categoryID) { case CategorizedProblem.CAT_UNSPECIFIED: buf.append("Unspecified"); break;/*from www . jav a 2s . com*/ case CategorizedProblem.CAT_BUILDPATH: buf.append("Buildpath"); break; case CategorizedProblem.CAT_SYNTAX: buf.append("Syntax"); break; case CategorizedProblem.CAT_IMPORT: buf.append("Import"); break; case CategorizedProblem.CAT_TYPE: buf.append("Type"); break; case CategorizedProblem.CAT_MEMBER: buf.append("Member"); break; case CategorizedProblem.CAT_INTERNAL: buf.append("Internal"); break; case CategorizedProblem.CAT_JAVADOC: buf.append("Javadoc"); break; case CategorizedProblem.CAT_CODE_STYLE: buf.append("Code Style"); break; case CategorizedProblem.CAT_POTENTIAL_PROGRAMMING_PROBLEM: buf.append("Potential Programming Problem"); break; case CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT: buf.append("Name Shadowing Conflict"); break; case CategorizedProblem.CAT_DEPRECATION: buf.append("Deprecation"); break; case CategorizedProblem.CAT_UNNECESSARY_CODE: buf.append("Unnecessary Code"); break; case CategorizedProblem.CAT_UNCHECKED_RAW: buf.append("Unchecked Raw"); break; case CategorizedProblem.CAT_NLS: buf.append("NLS"); break; case CategorizedProblem.CAT_RESTRICTION: buf.append("Restriction"); break; default: buf.append("<UNKNOWN CATEGORY>"); break; } buf.append(" = ").append(categoryID); return buf.toString(); }
From source file:net.sf.j2s.core.builder.AbstractImageBuilder.java
License:Open Source License
/** * Creates a marker from each problem and adds it to the resource. * The marker is as follows:// www . j ava2 s.c om * - its type is T_PROBLEM * - its plugin ID is the JavaBuilder's plugin ID * - its message is the problem's message * - its priority reflects the severity of the problem * - its range is the problem's range * - it has an extra attribute "ID" which holds the problem's id * - it's {@link IMarker#SOURCE_ID} attribute is positioned to {@link JavaBuilder#SOURCE_ID} if * the problem was generated by JDT; else the {@link IMarker#SOURCE_ID} attribute is * carried from the problem to the marker in extra attributes, if present. */ protected void storeProblemsFor(SourceFile sourceFile, CategorizedProblem[] problems) throws CoreException { if (sourceFile == null || problems == null || problems.length == 0) return; // once a classpath error is found, ignore all other problems for this project so the user can see the main error // but still try to compile as many source files as possible to help the case when the base libraries are in source if (!this.keepStoringProblemMarkers) return; // only want the one error recorded on this source file HashSet managedMarkerTypes = JavaModelManager.getJavaModelManager().compilationParticipants .managedMarkerTypes(); problems: for (int i = 0, l = problems.length; i < l; i++) { CategorizedProblem problem = problems[i]; int id = problem.getID(); // we may use a different resource for certain problems such as IProblem.MissingNonNullByDefaultAnnotationOnPackage // but at the start of the next problem we should reset it to the source file's resource IResource resource = sourceFile.resource; // handle missing classfile situation if (id == IProblem.IsClassPathCorrect) { String missingClassfileName = problem.getArguments()[0]; if (JavaBuilder.DEBUG) System.out.println(Messages.bind(Messages.build_incompleteClassPath, missingClassfileName)); boolean isInvalidClasspathError = JavaCore.ERROR .equals(this.javaBuilder.javaProject.getOption(JavaCore.CORE_INCOMPLETE_CLASSPATH, true)); // insert extra classpath problem, and make it the only problem for this project (optional) if (isInvalidClasspathError && JavaCore.ABORT.equals( this.javaBuilder.javaProject.getOption(JavaCore.CORE_JAVA_BUILD_INVALID_CLASSPATH, true))) { JavaBuilder.removeProblemsAndTasksFor(this.javaBuilder.currentProject); // make this the only problem for this project this.keepStoringProblemMarkers = false; } IMarker marker = this.javaBuilder.currentProject .createMarker(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER); marker.setAttributes( new String[] { IMarker.MESSAGE, IMarker.SEVERITY, IJavaModelMarker.CATEGORY_ID, IMarker.SOURCE_ID }, new Object[] { Messages.bind(Messages.build_incompleteClassPath, missingClassfileName), new Integer(isInvalidClasspathError ? IMarker.SEVERITY_ERROR : IMarker.SEVERITY_WARNING), new Integer(CategorizedProblem.CAT_BUILDPATH), JavaBuilder.SOURCE_ID }); // even if we're not keeping more markers, still fall through rest of the problem reporting, so that offending // IsClassPathCorrect problem gets recorded since it may help locate the offending reference } String markerType = problem.getMarkerType(); boolean managedProblem = false; if (IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER.equals(markerType) || (managedProblem = managedMarkerTypes.contains(markerType))) { if (id == IProblem.MissingNonNullByDefaultAnnotationOnPackage && !(CharOperation.equals(sourceFile.getMainTypeName(), TypeConstants.PACKAGE_INFO_NAME))) { // for this kind of problem, marker needs to be created on the package instead of on the source file // see bug 372012 char[] fileName = sourceFile.getFileName(); int pkgEnd = CharOperation.lastIndexOf('/', fileName); if (pkgEnd == -1) pkgEnd = CharOperation.lastIndexOf(File.separatorChar, fileName); PackageFragment pkg = null; if (pkgEnd != -1) pkg = (PackageFragment) Util.getPackageFragment(sourceFile.getFileName(), pkgEnd, -1 /*no jar separator for java files*/); if (pkg != null) { try { IMarker[] existingMarkers = pkg.resource().findMarkers( IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, false, IResource.DEPTH_ZERO); int len = existingMarkers.length; for (int j = 0; j < len; j++) { if (((Integer) existingMarkers[j].getAttribute(IJavaModelMarker.ID)) .intValue() == IProblem.MissingNonNullByDefaultAnnotationOnPackage) { continue problems; // marker already present } } } catch (CoreException e) { // marker retrieval failed, cannot do much if (JavaModelManager.VERBOSE) { e.printStackTrace(); } } IResource tempRes = pkg.resource(); if (tempRes != null) { resource = tempRes; } } } IMarker marker = resource.createMarker(markerType); String[] attributeNames = JAVA_PROBLEM_MARKER_ATTRIBUTE_NAMES; int standardLength = attributeNames.length; String[] allNames = attributeNames; int managedLength = managedProblem ? 0 : 1; String[] extraAttributeNames = problem.getExtraMarkerAttributeNames(); int extraLength = extraAttributeNames == null ? 0 : extraAttributeNames.length; if (managedLength > 0 || extraLength > 0) { allNames = new String[standardLength + managedLength + extraLength]; System.arraycopy(attributeNames, 0, allNames, 0, standardLength); if (managedLength > 0) allNames[standardLength] = IMarker.SOURCE_ID; System.arraycopy(extraAttributeNames, 0, allNames, standardLength + managedLength, extraLength); } Object[] allValues = new Object[allNames.length]; // standard attributes int index = 0; allValues[index++] = problem.getMessage(); // message allValues[index++] = problem.isError() ? S_ERROR : S_WARNING; // severity allValues[index++] = new Integer(id); // ID allValues[index++] = new Integer(problem.getSourceStart()); // start allValues[index++] = new Integer(problem.getSourceEnd() + 1); // end allValues[index++] = new Integer(problem.getSourceLineNumber()); // line allValues[index++] = Util.getProblemArgumentsForMarker(problem.getArguments()); // arguments allValues[index++] = new Integer(problem.getCategoryID()); // category ID // SOURCE_ID attribute for JDT problems if (managedLength > 0) allValues[index++] = JavaBuilder.SOURCE_ID; // optional extra attributes if (extraLength > 0) System.arraycopy(problem.getExtraMarkerAttributeValues(), 0, allValues, index, extraLength); marker.setAttributes(allNames, allValues); if (!this.keepStoringProblemMarkers) return; // only want the one error recorded on this source file } } }
From source file:org.conqat.engine.java.ecj.EcjASTAccessTest.java
License:Apache License
/** * When only the boot class path is provided the compiler should be able to * find all system classes but not our referenced classes. *//*w ww. j a v a 2s . c o m*/ public void testWithBootClasspath() throws IOException { CollectingCompilerRequestor requestor = compile(EcjUtils.obtainClasspath()); assertEquals(1, requestor.getClassFiles().size()); assertEquals("MainClass", EcjUtils.getFQName(CollectionUtils.getAny(requestor.getClassFiles()).getCompoundName())); // the compiler should be able to find all system classes but not our // referenced classes assertEquals(3, requestor.getErrors().size()); for (CategorizedProblem problem : requestor.getErrors()) { assertEquals(50, problem.getCategoryID()); } }
From source file:org.eclipse.ajdt.internal.builder.UIBuildListener.java
License:Open Source License
public void postAJBuild(int kind, final IProject project, boolean noSourceChanges, Map<IFile, List<CategorizedProblem>> newProblems) { if (noSourceChanges) { return;/* ww w. j ava 2 s . c o m*/ } // The message to feature in the problems view of depending projects String buildPrereqsMessage = NLS.bind(UIMessages.buildPrereqsMessage, project.getName()); boolean buildCancelled = ((IAJCompilerMonitor) AspectJPlugin.getDefault().getCompilerFactory() .getCompilerForProject(project).getBuildProgressMonitor()).buildWasCancelled(); if (buildCancelled) { markReferencingProjects(project, buildPrereqsMessage); } else { removeMarkerOnReferencingProjects(project, buildPrereqsMessage); } // Bug22258: Get the compiler monitor to display any issues with // that compile. IBuildMessageHandler messageHandler = AspectJPlugin.getDefault().getCompilerFactory() .getCompilerForProject(project).getMessageHandler(); if (messageHandler instanceof UIMessageHandler) { ((UIMessageHandler) messageHandler).showOutstandingProblems(project); } // before returning, check to see if the project sent its output // to an outjar and if so, then update any depending projects checkOutJarEntry(project); checkInpathOutFolder(project); // update the markers on files, but only the ones that have changed DeleteAndUpdateAJMarkersJob deleteUpdateMarkers; CoreCompilerConfiguration compilerConfig = getCompilerConfiguration(project); switch (kind) { case IncrementalProjectBuilder.CLEAN_BUILD: deleteUpdateMarkers = new DeleteAndUpdateAJMarkersJob(project); deleteUpdateMarkers.doDeleteOnly(true); deleteUpdateMarkers.setPriority(Job.BUILD); deleteUpdateMarkers.schedule(); break; case IncrementalProjectBuilder.FULL_BUILD: deleteUpdateMarkers = new DeleteAndUpdateAJMarkersJob(project); deleteUpdateMarkers.setPriority(Job.BUILD); deleteUpdateMarkers.schedule(); break; case IncrementalProjectBuilder.AUTO_BUILD: case IncrementalProjectBuilder.INCREMENTAL_BUILD: File[] touchedFiles = compilerConfig.getCompiledSourceFiles(); if (touchedFiles == null /* recreate all markers */ || touchedFiles.length > 0) { deleteUpdateMarkers = new DeleteAndUpdateAJMarkersJob(project, touchedFiles); deleteUpdateMarkers.schedule(); } } // sanity check the model if the event trace viewer is open if (DebugTracing.DEBUG_MODEL) { AJModelChecker.doModelCheckIfRequired(AJProjectModelFactory.getInstance().getModelForProject(project)); } if (AspectJUIPlugin.getDefault().getDisplay().isDisposed()) { AJLog.log("Not updating vis, xref, or changes views as display is disposed!"); //$NON-NLS-1$ } else { AspectJUIPlugin.getDefault().getDisplay().asyncExec(new Runnable() { public void run() { AJLog.logStart("Update visualizer, xref, advice listeners for (separate thread): " + project.getName()); // TODO: can we determine whether there were // actually changes to the set of advised elements? Object[] listeners = fListeners.getListeners(); for (int i = 0; i < listeners.length; i++) { ((IAdviceChangedListener) listeners[i]).adviceChanged(); } // refresh Cross References if (AspectJUIPlugin.usingXref) { XReferenceUIPlugin.refresh(); } // refresh Visualiser if (AspectJUIPlugin.usingVisualiser) { Bundle vis = Platform.getBundle(AspectJUIPlugin.VISUALISER_ID); // avoid activating the bundle if it's not active already if ((vis != null) && (vis.getState() == Bundle.ACTIVE)) { if (ProviderManager.getContentProvider() instanceof AJDTContentProvider) { AJDTContentProvider provider = (AJDTContentProvider) ProviderManager .getContentProvider(); provider.reset(); VisualiserPlugin.refresh(); } } } AJLog.logEnd(AJLog.BUILDER, "Update visualizer, xref, advice listeners for (separate thread): " + project.getName()); } }); } // finally, create markers for extra problems coming from compilation participants for (Entry<IFile, List<CategorizedProblem>> problemsForFile : newProblems.entrySet()) { try { IFile file = problemsForFile.getKey(); for (CategorizedProblem problem : problemsForFile.getValue()) { String markerType = problem.getMarkerType(); IMarker marker = file.createMarker(markerType); String[] attributeNames = AbstractImageBuilder.JAVA_PROBLEM_MARKER_ATTRIBUTE_NAMES; String[] extraAttributeNames = problem.getExtraMarkerAttributeNames(); int extraLength = extraAttributeNames == null ? 0 : extraAttributeNames.length; int standardLength = attributeNames.length + 1; String[] allNames = new String[standardLength]; System.arraycopy(attributeNames, 0, allNames, 0, standardLength - 1); allNames[standardLength - 1] = IMarker.SOURCE_ID; if (extraLength > 0) { allNames = new String[standardLength + extraLength]; System.arraycopy(extraAttributeNames, 0, allNames, standardLength + 1, extraLength); } Object[] allValues = new Object[allNames.length]; // standard attributes int index = 0; allValues[index++] = problem.getMessage(); // message allValues[index++] = problem.isError() ? IMarker.SEVERITY_ERROR : IMarker.SEVERITY_WARNING; // severity allValues[index++] = new Integer(problem.getID()); // ID allValues[index++] = new Integer(problem.getSourceStart()); // start int end = problem.getSourceEnd(); allValues[index++] = new Integer(end > 0 ? end + 1 : end); // end allValues[index++] = new Integer(problem.getSourceLineNumber()); // line allValues[index++] = Util.getProblemArgumentsForMarker(problem.getArguments()); // arguments allValues[index++] = new Integer(problem.getCategoryID()); // category ID // SOURCE_ID attribute for JDT problems allValues[index++] = JavaBuilder.SOURCE_ID; // optional extra attributes if (extraLength > 0) System.arraycopy(problem.getExtraMarkerAttributeValues(), 0, allValues, index, extraLength); marker.setAttributes(allNames, allValues); } } catch (CoreException e) { } } }
From source file:org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.java
License:Open Source License
/** * Creates a marker from each problem and adds it to the resource. * The marker is as follows:/* w w w .ja v a 2 s . c o m*/ * - its type is T_PROBLEM * - its plugin ID is the JavaBuilder's plugin ID * - its message is the problem's message * - its priority reflects the severity of the problem * - its range is the problem's range * - it has an extra attribute "ID" which holds the problem's id * - it's {@link IMarker#SOURCE_ID} attribute is positioned to {@link JavaBuilder#SOURCE_ID} if * the problem was generated by JDT; else the {@link IMarker#SOURCE_ID} attribute is * carried from the problem to the marker in extra attributes, if present. */ protected void storeProblemsFor(SourceFile sourceFile, CategorizedProblem[] problems) throws CoreException { if (sourceFile == null || problems == null || problems.length == 0) return; // once a classpath error is found, ignore all other problems for this project so the user can see the main error // but still try to compile as many source files as possible to help the case when the base libraries are in source if (!this.keepStoringProblemMarkers) return; // only want the one error recorded on this source file IResource resource = sourceFile.resource; HashSet managedMarkerTypes = JavaModelManager.getJavaModelManager().compilationParticipants .managedMarkerTypes(); for (int i = 0, l = problems.length; i < l; i++) { CategorizedProblem problem = problems[i]; int id = problem.getID(); // handle missing classfile situation if (id == IProblem.IsClassPathCorrect) { String missingClassfileName = problem.getArguments()[0]; if (JavaBuilder.DEBUG) System.out.println(Messages.bind(Messages.build_incompleteClassPath, missingClassfileName)); boolean isInvalidClasspathError = JavaCore.ERROR .equals(this.javaBuilder.javaProject.getOption(JavaCore.CORE_INCOMPLETE_CLASSPATH, true)); // insert extra classpath problem, and make it the only problem for this project (optional) if (isInvalidClasspathError && JavaCore.ABORT.equals( this.javaBuilder.javaProject.getOption(JavaCore.CORE_JAVA_BUILD_INVALID_CLASSPATH, true))) { JavaBuilder.removeProblemsAndTasksFor(this.javaBuilder.currentProject); // make this the only problem for this project this.keepStoringProblemMarkers = false; } IMarker marker = this.javaBuilder.currentProject .createMarker(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER); marker.setAttributes( new String[] { IMarker.MESSAGE, IMarker.SEVERITY, IJavaModelMarker.CATEGORY_ID, IMarker.SOURCE_ID }, new Object[] { Messages.bind(Messages.build_incompleteClassPath, missingClassfileName), new Integer(isInvalidClasspathError ? IMarker.SEVERITY_ERROR : IMarker.SEVERITY_WARNING), new Integer(CategorizedProblem.CAT_BUILDPATH), JavaBuilder.SOURCE_ID }); // even if we're not keeping more markers, still fall through rest of the problem reporting, so that offending // IsClassPathCorrect problem gets recorded since it may help locate the offending reference } String markerType = problem.getMarkerType(); boolean managedProblem = false; if (IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER.equals(markerType) || (managedProblem = managedMarkerTypes.contains(markerType))) { IMarker marker = resource.createMarker(markerType); String[] attributeNames = JAVA_PROBLEM_MARKER_ATTRIBUTE_NAMES; int standardLength = attributeNames.length; String[] allNames = attributeNames; int managedLength = managedProblem ? 0 : 1; String[] extraAttributeNames = problem.getExtraMarkerAttributeNames(); int extraLength = extraAttributeNames == null ? 0 : extraAttributeNames.length; if (managedLength > 0 || extraLength > 0) { allNames = new String[standardLength + managedLength + extraLength]; System.arraycopy(attributeNames, 0, allNames, 0, standardLength); if (managedLength > 0) allNames[standardLength] = IMarker.SOURCE_ID; System.arraycopy(extraAttributeNames, 0, allNames, standardLength + managedLength, extraLength); } Object[] allValues = new Object[allNames.length]; // standard attributes int index = 0; allValues[index++] = problem.getMessage(); // message allValues[index++] = problem.isError() ? S_ERROR : S_WARNING; // severity allValues[index++] = new Integer(id); // ID allValues[index++] = new Integer(problem.getSourceStart()); // start int end = problem.getSourceEnd(); allValues[index++] = new Integer(end > 0 ? end + 1 : end); // end allValues[index++] = new Integer(problem.getSourceLineNumber()); // line allValues[index++] = Util.getProblemArgumentsForMarker(problem.getArguments()); // arguments allValues[index++] = new Integer(problem.getCategoryID()); // category ID // SOURCE_ID attribute for JDT problems if (managedLength > 0) allValues[index++] = JavaBuilder.SOURCE_ID; // optional extra attributes if (extraLength > 0) System.arraycopy(problem.getExtraMarkerAttributeValues(), 0, allValues, index, extraLength); marker.setAttributes(allNames, allValues); if (!this.keepStoringProblemMarkers) return; // only want the one error recorded on this source file } } }
From source file:org.jboss.tools.arquillian.core.internal.compiler.ArquillianCompilationParticipant.java
License:Open Source License
private void storeProblem(CategorizedProblem problem, IFile resource) throws CoreException { if ((problem.getID() & IProblem.TypeRelated) == 0 && (problem.getID() & IProblem.ImportRelated) == 0) { // ignore return;//from ww w. ja v a 2s. c om } String typePreference = ArquillianUtility .getPreference(ArquillianConstants.TYPE_IS_NOT_INCLUDED_IN_ANY_DEPLOYMENT, resource.getProject()); String importPreference = ArquillianUtility .getPreference(ArquillianConstants.IMPORT_IS_NOT_INCLUDED_IN_ANY_DEPLOYMENT, resource.getProject()); if (JavaCore.IGNORE.equals(typePreference) && JavaCore.IGNORE.equals(importPreference)) { return; } int id = problem.getID(); if (id != IProblem.IsClassPathCorrect && id != IProblem.UndefinedType && id != IProblem.ImportNotFound) { // ignore return; } IMarker marker = resource.createMarker(ArquillianConstants.MARKER_CLASS_ID); String[] attributeNames = AbstractImageBuilder.JAVA_PROBLEM_MARKER_ATTRIBUTE_NAMES; int standardLength = attributeNames.length; String[] allNames = attributeNames; int managedLength = 1; String[] extraAttributeNames = problem.getExtraMarkerAttributeNames(); int extraLength = extraAttributeNames == null ? 0 : extraAttributeNames.length; if (managedLength > 0 || extraLength > 0) { allNames = new String[standardLength + managedLength + extraLength + 1]; System.arraycopy(attributeNames, 0, allNames, 0, standardLength); if (managedLength > 0) allNames[standardLength] = IMarker.SOURCE_ID; System.arraycopy(extraAttributeNames, 0, allNames, standardLength + managedLength, extraLength); } allNames[allNames.length - 1] = ArquillianConstants.MARKER_CLASS_NAME; Object[] allValues = new Object[allNames.length]; // standard attributes int index = 0; String[] arguments = problem.getArguments(); String message = "Arquillian: " + problem.getMessage(); Integer severity = null; if (arguments != null && arguments.length > 0) { if (id == IProblem.IsClassPathCorrect) { // Pb(324) The type org.jboss.tools.examples.service.MemberRegistration cannot be resolved. It is indirectly referenced from required .class files message = "Arquillian: The " + arguments[0] + " type is not included in any deployment. It is indirectly referenced from required .class files"; severity = ArquillianUtility.getSeverity(typePreference); } else if (id == IProblem.UndefinedType) { // Pb(2) MemberRegistration cannot be resolved to a type message = "Arquillian: The " + arguments[0] + " type is not included in any deployment."; severity = ArquillianUtility.getSeverity(typePreference); } else if (id == IProblem.ImportNotFound) { // Pb(390) The import org.jboss.tools.examples.service.MemberRegistration cannot be resolved message = "Arquillian: The " + arguments[0] + " import is not included in any deployment."; severity = ArquillianUtility.getSeverity(importPreference); } allValues[allNames.length - 1] = arguments[0]; } if (severity == null) { return; } allValues[index++] = message; // message allValues[index++] = severity; allValues[index++] = new Integer(problem.getID()); // ID allValues[index++] = new Integer(problem.getSourceStart()); // start int end = problem.getSourceEnd(); allValues[index++] = new Integer(end > 0 ? end + 1 : end); // end allValues[index++] = new Integer(problem.getSourceLineNumber()); // line allValues[index++] = Util.getProblemArgumentsForMarker(problem.getArguments()); // arguments allValues[index++] = new Integer(problem.getCategoryID()); // category ID allValues[index++] = ArquillianConstants.SOURCE_ID; // optional extra attributes if (extraLength > 0) System.arraycopy(problem.getExtraMarkerAttributeValues(), 0, allValues, index, extraLength); marker.setAttributes(allNames, allValues); }