Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
[FIXED JENKINS-14043] Fixed some false positives for Javac parser.
  • Loading branch information
uhafner committed Jun 11, 2012
1 parent 0a999e4 commit 213661931bd2d7cebfe3106bc3a1ad175077d57f
@@ -16,7 +16,7 @@ public class JavacParser extends RegexpLineParser {
static final String JAVA_LARGE_ICON = WarningsDescriptor.IMAGE_PREFIX + "java-48x48.png";

private static final long serialVersionUID = 7199325311690082782L;
private static final String JAVAC_WARNING_PATTERN = "^(?:\\[WARNING\\]\\s+)?(.*):\\[(\\d*)[.,; 0-9]*\\]\\s*(?:\\[(\\w*)\\])?\\s*(.*)$";
private static final String JAVAC_WARNING_PATTERN = "^(?:\\[WARNING\\]\\s+)?([^\\[]*):\\[(\\d+)[.,; 0-9]*\\]\\s*(?:\\[(\\w+)\\])?\\s*(.*)$";

/**
* Creates a new instance of {@link JavacParser}.
@@ -17,6 +17,20 @@
public class JavacParserTest extends ParserTester {
private static final String WARNING_TYPE = Messages._Warnings_JavaParser_ParserName().toString(Locale.ENGLISH);

/**
* Parses a warning log with two false positives.
*
* @throws IOException
* if the file could not be read
* @see <a href="http://issues.jenkins-ci.org/browse/JENKINS-14043">Issue 14043</a>
*/
@Test
public void issue14043() throws IOException {
Collection<FileAnnotation> warnings = parse("issue14043.txt");

assertEquals(WRONG_NUMBER_OF_WARNINGS_DETECTED, 0, warnings.size());
}

/**
* Parses a warning log with 15 warnings.
*
@@ -0,0 +1,7 @@
10:53:05,516 [INFO] - info.XXX.YYY.persistence.entity.scenario.RemplaceAffectation : _____________doProjette(this: RemplaceAffectation {id: 1, ligne:Ligne {nom: Ligne 2}, entite:Concept {id:2, nom:p2, generalisation:, specialisations:[], prototypes:[], constituants:[], caracteristiques:[], affectations:[]}, quantite:4}, pivot: Concept {id:2, nom:p2, generalisation:, specialisations:[], prototypes:[], constituants:[], caracteristiques:[], affectations: []}, projection: ConceptDto {id:2, nom:p2, caracteristiques: {}, affectations: {}}, date: 05/01/2012)


10:53:07,084 [ERROR] - info.XXX.YYY.service.entite.EntiteService : On trouve plusieurs resultats pour findByField(fieldName:nom, value:aa, klass:class info.stif.mr1.persistence.entity.entite.Entite): results=[Modele {id:101, nom: aa, generalisation:, specialisations:[], archetype:1, prototypes:[201], constituants:[], caracteristiques:[]}, Modele {id:102, nom: aa, generalisation:, specialisations:[], archetype:2, prototypes:[], constituants:[], caracteristiques:[]}, Concept {id:1, nom:aa, generalisation:, specialisations:[], prototypes:[101], constituants:[], caracteristiques:[], affectations:[]}, Concept {id:2, nom:aa, generalisation:, specialisations:[], prototypes:[102], constituants:[], caracteristiques:[], affectations: []}, info.stif.mr1.persistence.entity.entite.ObjetConcret@2a6cd712]

[junit] <misc junit stdout printout> [data within brackets] [] empty bracket

0 comments on commit 2136619

Please sign in to comment.