@@ -26,7 +26,7 @@ public class EcjResponseParser {
26
26
/**
27
27
* Scan the specified response file for compilation messages.
28
28
*/
29
- public List <CompilerMessage > parse (File xmltf , boolean warningsAsErrors ) throws Exception {
29
+ public List <CompilerMessage > parse (File xmltf , boolean errorsAsWarnings ) throws Exception {
30
30
//if(xmltf.length() < 80)
31
31
// return;
32
32
@@ -39,14 +39,14 @@ public List<CompilerMessage> parse(File xmltf, boolean warningsAsErrors) throws
39
39
while (xsr .hasNext ()) {
40
40
int type = xsr .next ();
41
41
if (type == XMLStreamConstants .START_ELEMENT && "source" .equals (xsr .getLocalName ())) {
42
- decodeSourceElement (list , xsr , warningsAsErrors );
42
+ decodeSourceElement (list , xsr , errorsAsWarnings );
43
43
}
44
44
}
45
45
}
46
46
return list ;
47
47
}
48
48
49
- private void decodeSourceElement (List <CompilerMessage > list , XMLStreamReader xsr , boolean warningsAsErrors ) throws Exception {
49
+ private void decodeSourceElement (List <CompilerMessage > list , XMLStreamReader xsr , boolean errorsAsWarnings ) throws Exception {
50
50
String filename = xsr .getAttributeValue (null , "path" );
51
51
52
52
//-- Got a file- call handler
@@ -55,7 +55,7 @@ private void decodeSourceElement(List<CompilerMessage> list, XMLStreamReader xsr
55
55
int type = xsr .nextTag ();
56
56
if (type == XMLStreamConstants .START_ELEMENT ) {
57
57
if ("problems" .equals (xsr .getLocalName ())) {
58
- decodeProblems (list , path .toString (), xsr , warningsAsErrors );
58
+ decodeProblems (list , path .toString (), xsr , errorsAsWarnings );
59
59
} else
60
60
ignoreTillEnd (xsr );
61
61
@@ -68,12 +68,12 @@ private void decodeSourceElement(List<CompilerMessage> list, XMLStreamReader xsr
68
68
/**
69
69
* Locate "problem" nodes.
70
70
*/
71
- private void decodeProblems (List <CompilerMessage > list , String sourcePath , XMLStreamReader xsr , boolean warningsAsErrors ) throws Exception {
71
+ private void decodeProblems (List <CompilerMessage > list , String sourcePath , XMLStreamReader xsr , boolean errorsAsWarnings ) throws Exception {
72
72
while (xsr .hasNext ()) {
73
73
int type = xsr .nextTag ();
74
74
if (type == XMLStreamConstants .START_ELEMENT ) {
75
75
if ("problem" .equals (xsr .getLocalName ())) {
76
- decodeProblem (list , sourcePath , xsr , warningsAsErrors );
76
+ decodeProblem (list , sourcePath , xsr , errorsAsWarnings );
77
77
} else
78
78
ignoreTillEnd (xsr );
79
79
@@ -84,7 +84,7 @@ private void decodeProblems(List<CompilerMessage> list, String sourcePath, XMLSt
84
84
}
85
85
86
86
87
- private void decodeProblem (List <CompilerMessage > list , String sourcePath , XMLStreamReader xsr , boolean warningsAsErrors ) throws Exception {
87
+ private void decodeProblem (List <CompilerMessage > list , String sourcePath , XMLStreamReader xsr , boolean errorsAsWarnings ) throws Exception {
88
88
String id = xsr .getAttributeValue (null , "optionKey" ); // Key for the problem
89
89
int startline = getInt (xsr , "line" );
90
90
int column = getInt (xsr , "charStart" );
@@ -108,9 +108,9 @@ private void decodeProblem(List<CompilerMessage> list, String sourcePath, XMLStr
108
108
109
109
Kind msgtype ;
110
110
if ("warning" .equalsIgnoreCase (sev ))
111
- msgtype = warningsAsErrors ? Kind . ERROR : Kind .WARNING ;
111
+ msgtype = Kind .WARNING ;
112
112
else if ("error" .equalsIgnoreCase (sev ))
113
- msgtype = Kind .ERROR ;
113
+ msgtype = errorsAsWarnings ? Kind . WARNING : Kind .ERROR ;
114
114
else if ("info" .equalsIgnoreCase (sev ))
115
115
msgtype = Kind .NOTE ;
116
116
else {
0 commit comments