Skip to content

Commit cc1ba27

Browse files
fjalvingholamy
authored andcommitted
Misunderstood the very, very, VERY odd "errorsAsWarnings" option.
1 parent b381de3 commit cc1ba27

File tree

1 file changed

+9
-9
lines changed
  • plexus-compilers/plexus-compiler-eclipse/src/main/java/org/codehaus/plexus/compiler/eclipse

1 file changed

+9
-9
lines changed

plexus-compilers/plexus-compiler-eclipse/src/main/java/org/codehaus/plexus/compiler/eclipse/EcjResponseParser.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class EcjResponseParser {
2626
/**
2727
* Scan the specified response file for compilation messages.
2828
*/
29-
public List<CompilerMessage> parse(File xmltf, boolean warningsAsErrors) throws Exception {
29+
public List<CompilerMessage> parse(File xmltf, boolean errorsAsWarnings) throws Exception {
3030
//if(xmltf.length() < 80)
3131
// return;
3232

@@ -39,14 +39,14 @@ public List<CompilerMessage> parse(File xmltf, boolean warningsAsErrors) throws
3939
while(xsr.hasNext()) {
4040
int type = xsr.next();
4141
if(type == XMLStreamConstants.START_ELEMENT && "source".equals(xsr.getLocalName())) {
42-
decodeSourceElement(list, xsr, warningsAsErrors);
42+
decodeSourceElement(list, xsr, errorsAsWarnings);
4343
}
4444
}
4545
}
4646
return list;
4747
}
4848

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 {
5050
String filename = xsr.getAttributeValue(null, "path");
5151

5252
//-- Got a file- call handler
@@ -55,7 +55,7 @@ private void decodeSourceElement(List<CompilerMessage> list, XMLStreamReader xsr
5555
int type = xsr.nextTag();
5656
if(type == XMLStreamConstants.START_ELEMENT) {
5757
if("problems".equals(xsr.getLocalName())) {
58-
decodeProblems(list, path.toString(), xsr, warningsAsErrors);
58+
decodeProblems(list, path.toString(), xsr, errorsAsWarnings);
5959
} else
6060
ignoreTillEnd(xsr);
6161

@@ -68,12 +68,12 @@ private void decodeSourceElement(List<CompilerMessage> list, XMLStreamReader xsr
6868
/**
6969
* Locate "problem" nodes.
7070
*/
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 {
7272
while(xsr.hasNext()) {
7373
int type = xsr.nextTag();
7474
if(type == XMLStreamConstants.START_ELEMENT) {
7575
if("problem".equals(xsr.getLocalName())) {
76-
decodeProblem(list, sourcePath, xsr, warningsAsErrors);
76+
decodeProblem(list, sourcePath, xsr, errorsAsWarnings);
7777
} else
7878
ignoreTillEnd(xsr);
7979

@@ -84,7 +84,7 @@ private void decodeProblems(List<CompilerMessage> list, String sourcePath, XMLSt
8484
}
8585

8686

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 {
8888
String id = xsr.getAttributeValue(null, "optionKey"); // Key for the problem
8989
int startline = getInt(xsr, "line");
9090
int column = getInt(xsr, "charStart");
@@ -108,9 +108,9 @@ private void decodeProblem(List<CompilerMessage> list, String sourcePath, XMLStr
108108

109109
Kind msgtype;
110110
if("warning".equalsIgnoreCase(sev))
111-
msgtype = warningsAsErrors ? Kind.ERROR : Kind.WARNING;
111+
msgtype = Kind.WARNING;
112112
else if("error".equalsIgnoreCase(sev))
113-
msgtype = Kind.ERROR;
113+
msgtype = errorsAsWarnings ? Kind.WARNING : Kind.ERROR;
114114
else if("info".equalsIgnoreCase(sev))
115115
msgtype = Kind.NOTE;
116116
else {

0 commit comments

Comments
 (0)