Lines 666-696
Link Here
|
666 |
|| (managedProblem = managedMarkerTypes.contains(markerType))) { |
666 |
|| (managedProblem = managedMarkerTypes.contains(markerType))) { |
667 |
IMarker marker = resource.createMarker(markerType); |
667 |
IMarker marker = resource.createMarker(markerType); |
668 |
|
668 |
|
669 |
// standard attributes |
669 |
String[] attributeNames = JAVA_PROBLEM_MARKER_ATTRIBUTE_NAMES; |
670 |
marker.setAttributes( |
670 |
int standardLength = attributeNames.length; |
671 |
JAVA_PROBLEM_MARKER_ATTRIBUTE_NAMES, |
671 |
String[] allNames = attributeNames; |
672 |
new Object[] { |
672 |
int managedLength = managedProblem ? 0 : 1; |
673 |
problem.getMessage(), // message |
|
|
674 |
problem.isError() ? S_ERROR : S_WARNING, // severity |
675 |
new Integer(id), // ID |
676 |
new Integer(problem.getSourceStart()), // start |
677 |
new Integer(problem.getSourceEnd() + 1), // end |
678 |
new Integer(problem.getSourceLineNumber()), // line |
679 |
Util.getProblemArgumentsForMarker(problem.getArguments()), // arguments |
680 |
new Integer(problem.getCategoryID()) // category ID |
681 |
} |
682 |
); |
683 |
// GENERATED_BY attribute for JDT problems |
684 |
if (!managedProblem) { |
685 |
marker.setAttribute(IMarker.SOURCE_ID, JavaBuilder.SOURCE_ID); |
686 |
} |
687 |
// optional extra attributes |
688 |
String[] extraAttributeNames = problem.getExtraMarkerAttributeNames(); |
673 |
String[] extraAttributeNames = problem.getExtraMarkerAttributeNames(); |
689 |
int extraLength = extraAttributeNames == null ? 0 : extraAttributeNames.length; |
674 |
int extraLength = extraAttributeNames == null ? 0 : extraAttributeNames.length; |
690 |
if (extraLength > 0) { |
675 |
if (managedLength > 0 || extraLength > 0) { |
691 |
marker.setAttributes(extraAttributeNames, problem.getExtraMarkerAttributeValues()); |
676 |
allNames = new String[standardLength + managedLength + extraLength]; |
|
|
677 |
System.arraycopy(attributeNames, 0, allNames, 0, standardLength); |
678 |
if (managedLength > 0) |
679 |
allNames[standardLength] = IMarker.SOURCE_ID; |
680 |
System.arraycopy(extraAttributeNames, 0, allNames, standardLength + managedLength, extraLength); |
692 |
} |
681 |
} |
693 |
|
682 |
|
|
|
683 |
Object[] allValues = new Object[allNames.length]; |
684 |
// standard attributes |
685 |
int index = 0; |
686 |
allValues[index++] = problem.getMessage(); // message |
687 |
allValues[index++] = problem.isError() ? S_ERROR : S_WARNING; // severity |
688 |
allValues[index++] = new Integer(id); // ID |
689 |
allValues[index++] = new Integer(problem.getSourceStart()); // start |
690 |
allValues[index++] = new Integer(problem.getSourceEnd() + 1); // end |
691 |
allValues[index++] = new Integer(problem.getSourceLineNumber()); // line |
692 |
allValues[index++] = Util.getProblemArgumentsForMarker(problem.getArguments()); // arguments |
693 |
allValues[index++] = new Integer(problem.getCategoryID()); // category ID |
694 |
// GENERATED_BY attribute for JDT problems |
695 |
if (managedLength > 0) |
696 |
allValues[index++] = JavaBuilder.SOURCE_ID; |
697 |
// optional extra attributes |
698 |
if (extraLength > 0) |
699 |
System.arraycopy(problem.getExtraMarkerAttributeValues(), 0, allValues, index, extraLength); |
700 |
|
701 |
marker.setAttributes(allNames, allValues); |
702 |
|
694 |
if (!this.keepStoringProblemMarkers) return; // only want the one error recorded on this source file |
703 |
if (!this.keepStoringProblemMarkers) return; // only want the one error recorded on this source file |
695 |
} |
704 |
} |
696 |
} |
705 |
} |
Lines 710-731
Link Here
|
710 |
priority = P_HIGH; |
719 |
priority = P_HIGH; |
711 |
else if (JavaCore.COMPILER_TASK_PRIORITY_LOW.equals(compilerPriority)) |
720 |
else if (JavaCore.COMPILER_TASK_PRIORITY_LOW.equals(compilerPriority)) |
712 |
priority = P_LOW; |
721 |
priority = P_LOW; |
713 |
marker.setAttributes( |
722 |
|
714 |
JAVA_TASK_MARKER_ATTRIBUTE_NAMES, |
723 |
String[] attributeNames = JAVA_TASK_MARKER_ATTRIBUTE_NAMES; |
715 |
new Object[] { |
724 |
int standardLength = attributeNames.length; |
716 |
task.getMessage(), |
725 |
String[] allNames = attributeNames; |
717 |
priority, |
|
|
718 |
new Integer(task.getID()), |
719 |
new Integer(task.getSourceStart()), |
720 |
new Integer(task.getSourceEnd() + 1), |
721 |
new Integer(task.getSourceLineNumber()), |
722 |
Boolean.FALSE, |
723 |
JavaBuilder.SOURCE_ID |
724 |
}); |
725 |
String[] extraAttributeNames = task.getExtraMarkerAttributeNames(); |
726 |
String[] extraAttributeNames = task.getExtraMarkerAttributeNames(); |
726 |
int extraLength = extraAttributeNames == null ? 0 : extraAttributeNames.length; |
727 |
int extraLength = extraAttributeNames == null ? 0 : extraAttributeNames.length; |
|
|
728 |
if (extraLength > 0) { |
729 |
allNames = new String[standardLength + extraLength]; |
730 |
System.arraycopy(attributeNames, 0, allNames, 0, standardLength); |
731 |
System.arraycopy(extraAttributeNames, 0, allNames, standardLength, extraLength); |
732 |
} |
733 |
|
734 |
Object[] allValues = new Object[allNames.length]; |
735 |
// standard attributes |
736 |
int index = 0; |
737 |
allValues[index++] = task.getMessage(); |
738 |
allValues[index++] = priority; |
739 |
allValues[index++] = new Integer(task.getID()); |
740 |
allValues[index++] = new Integer(task.getSourceStart()); |
741 |
allValues[index++] = new Integer(task.getSourceEnd() + 1); |
742 |
allValues[index++] = new Integer(task.getSourceLineNumber()); |
743 |
allValues[index++] = Boolean.FALSE; |
744 |
allValues[index++] = JavaBuilder.SOURCE_ID; |
745 |
// optional extra attributes |
727 |
if (extraLength > 0) |
746 |
if (extraLength > 0) |
728 |
marker.setAttributes(extraAttributeNames, task.getExtraMarkerAttributeValues()); |
747 |
System.arraycopy(task.getExtraMarkerAttributeValues(), 0, allValues, index, extraLength); |
|
|
748 |
|
749 |
marker.setAttributes(allNames, allValues); |
729 |
} |
750 |
} |
730 |
} |
751 |
} |
731 |
} |
752 |
} |