@@ -53,42 +53,22 @@ public void addReason(final String reason) {
5353 }
5454 }
5555
56- private final String debugFilename = "mb060_run-maven-build_output.txt" ;
57- private final String outputFilenameFull = "buildtimeComparatorFull.log.txt" ;
58- private final String outputFilenameSign = "buildtimeComparatorSignatureOnly.log.txt" ;
59- private final String outputFilenameSignPlusInnerJar = "buildtimeComparatorSignatureOnlyWithInnerJar.log.txt" ;
60- private final String outputFilenameDoc = "buildtimeComparatorDocBundle.log.txt" ;
61- private final String outputFilenameOther = "buildtimeComparatorUnanticipated.log.txt" ;
62- private final String outputFilenamejdtCore = "buildtimeComparatorJDTCore.log.txt" ;
63- private final String buildlogsDirectory = "buildlogs" ;
64- private final String comparatorLogsDirectory = "comparatorlogs" ;
56+ private static final String BUILD_LOGS_DIRECTORY = "buildlogs" ;
57+ private static final String COMPARATOR_LOGS_DIRECTORY = "comparatorlogs" ;
6558 private String comparatorRepo = "comparatorRepo" ;
6659 private String buildDirectory ;
67- private String inputFilename ;
68- private String outputFilenameFullLog ;
69- private String outputFilenameSignLog ;
70- private String outputFilenameDocLog ;
71- private String outputFilenameOtherLog ;
72- private String outputFilenameSignPlusInnerJarLog ;
73- private String outputFilenamejdtCoreLog ;
74- private final String mainregexPattern = "^\\ [WARNING\\ ].*eclipse.platform.releng.aggregator/(.*): baseline and build artifacts have same version but different contents" ;
75- private final Pattern mainPattern = Pattern .compile (mainregexPattern );
76- private final String noclassifierregexPattern = "^.*no-classifier:.*$" ;
77- private final Pattern noclassifierPattern = Pattern .compile (noclassifierregexPattern );
78- private final String classifier_sourcesregexPattern = "^.*classifier-sources:.*$" ;
79- private final Pattern classifier_sourcesPattern = Pattern .compile (classifier_sourcesregexPattern );
80- private final String classifier_sourcesfeatureregexPattern = "^.*classifier-sources-feature:.*$" ;
81- private final Pattern classifier_sourcesfeaturePattern = Pattern .compile (classifier_sourcesfeatureregexPattern );
82-
83- private final String sign1regexPattern = "^.*META-INF/(ECLIPSE_|CODESIGN).RSA.*$" ;
84- private final Pattern sign1Pattern = Pattern .compile (sign1regexPattern );
85- private final String sign2regexPattern = "^.*META-INF/(ECLIPSE_|CODESIGN).SF.*$" ;
86- private final Pattern sign2Pattern = Pattern .compile (sign2regexPattern );
87- private final String docNameregexPattern = "^.*eclipse\\ .platform\\ .common.*\\ .doc\\ ..*$" ;
88- private final Pattern docNamePattern = Pattern .compile (docNameregexPattern );
60+ private static final Pattern MAIN_PATTERN = Pattern .compile (
61+ "^\\ [WARNING\\ ].*eclipse.platform.releng.aggregator/(.*): baseline and build artifacts have same version but different contents" );
62+ private static final Pattern NO_CLASSIFIER_PATTERN = Pattern .compile ("^.*no-classifier:.*$" );
63+ private static final Pattern CLASSIFIER_SOURCES_PATTERN = Pattern .compile ("^.*classifier-sources:.*$" );
64+ private static final Pattern CLASSIFIER_SOURCES_FEATURE_PATTERN = Pattern
65+ .compile ("^.*classifier-sources-feature:.*$" );
66+
67+ private static final Pattern SIGN1_PATTERN = Pattern .compile ("^.*META-INF/(ECLIPSE_|CODESIGN).RSA.*$" );
68+ private static final Pattern SIGN2_PATTERN = Pattern .compile ("^.*META-INF/(ECLIPSE_|CODESIGN).SF.*$" );
69+ private static final Pattern DOC_NAME_PATTERN = Pattern .compile ("^.*eclipse\\ .platform\\ .common.*\\ .doc\\ ..*$" );
8970 // jar pattern added for bug 416701
90- private final String jarregexPattern = "^.*\\ .jar.*$" ;
91- private final Pattern jarPattern = Pattern .compile (jarregexPattern );
71+ private final Pattern JAR_PATTERN = Pattern .compile ("^.*\\ .jar.*$" );
9272 private int count ;
9373 private int countSign ;
9474 private int countDoc ;
@@ -99,7 +79,7 @@ public void addReason(final String reason) {
9979 private boolean docItem (final LogEntry newEntry ) {
10080 boolean result = false ;
10181 final String name = newEntry .name ();
102- final Matcher matcher = docNamePattern .matcher (name );
82+ final Matcher matcher = DOC_NAME_PATTERN .matcher (name );
10383 if (matcher .matches ()) {
10484 result = true ;
10585 }
@@ -115,64 +95,43 @@ public String getBuildDirectory() {
11595 }
11696
11797 private String getInputFilename () {
118- if (inputFilename == null ) {
119- inputFilename = getBuildDirectory () + "/" + buildlogsDirectory + "/" + debugFilename ;
120- }
121- return inputFilename ;
98+ return getBuildDirectory () + "/" + BUILD_LOGS_DIRECTORY + "/" + "mb060_run-maven-build_output.txt" ;
12299 }
123100
124101 private String getOutputFilenameDoc () {
125- if (outputFilenameDocLog == null ) {
126- outputFilenameDocLog = getBuildDirectory () + "/" + buildlogsDirectory + "/" + comparatorLogsDirectory + "/"
127- + outputFilenameDoc ;
128- }
129- return outputFilenameDocLog ;
102+ return getBuildDirectory () + "/" + BUILD_LOGS_DIRECTORY + "/" + COMPARATOR_LOGS_DIRECTORY + "/"
103+ + "buildtimeComparatorDocBundle.log.txt" ;
130104 }
131105
132106 private String getOutputFilenameFull () {
133- if (outputFilenameFullLog == null ) {
134- outputFilenameFullLog = getBuildDirectory () + "/" + buildlogsDirectory + "/" + comparatorLogsDirectory + "/"
135- + outputFilenameFull ;
136- }
137- return outputFilenameFullLog ;
107+ return getBuildDirectory () + "/" + BUILD_LOGS_DIRECTORY + "/" + COMPARATOR_LOGS_DIRECTORY + "/"
108+ + "buildtimeComparatorFull.log.txt" ;
138109 }
139110
140111 private String getOutputFilenameOther () {
141- if (outputFilenameOtherLog == null ) {
142- outputFilenameOtherLog = getBuildDirectory () + "/" + buildlogsDirectory + "/" + comparatorLogsDirectory
143- + "/" + outputFilenameOther ;
144- }
145- return outputFilenameOtherLog ;
112+ return getBuildDirectory () + "/" + BUILD_LOGS_DIRECTORY + "/" + COMPARATOR_LOGS_DIRECTORY + "/"
113+ + "buildtimeComparatorUnanticipated.log.txt" ;
146114 }
147115
148116 private String getOutputFilenameSign () {
149- if (outputFilenameSignLog == null ) {
150- outputFilenameSignLog = getBuildDirectory () + "/" + buildlogsDirectory + "/" + comparatorLogsDirectory + "/"
151- + outputFilenameSign ;
152- }
153- return outputFilenameSignLog ;
117+ return getBuildDirectory () + "/" + BUILD_LOGS_DIRECTORY + "/" + COMPARATOR_LOGS_DIRECTORY + "/"
118+ + "buildtimeComparatorSignatureOnly.log.txt" ;
154119 }
155120
156121 private String getOutputFilenameSignWithInnerJar () {
157- if (outputFilenameSignPlusInnerJarLog == null ) {
158- outputFilenameSignPlusInnerJarLog = getBuildDirectory () + "/" + buildlogsDirectory + "/"
159- + comparatorLogsDirectory + "/" + outputFilenameSignPlusInnerJar ;
160- }
161- return outputFilenameSignPlusInnerJarLog ;
122+ return getBuildDirectory () + "/" + BUILD_LOGS_DIRECTORY + "/" + COMPARATOR_LOGS_DIRECTORY + "/"
123+ + "buildtimeComparatorSignatureOnlyWithInnerJar.log.txt" ;
162124 }
163125
164126 private String getOutputFilenameJDTCore () {
165- if (outputFilenamejdtCoreLog == null ) {
166- outputFilenamejdtCoreLog = getBuildDirectory () + "/" + buildlogsDirectory + "/" + comparatorLogsDirectory
167- + "/" + outputFilenamejdtCore ;
168- }
169- return outputFilenamejdtCoreLog ;
127+ return getBuildDirectory () + "/" + BUILD_LOGS_DIRECTORY + "/" + COMPARATOR_LOGS_DIRECTORY + "/"
128+ + "buildtimeComparatorJDTCore.log.txt" ;
170129 }
171130
172131 public void processBuildfile () throws IOException {
173132
174133 // Make sure directory exists
175- File outputDir = new File (getBuildDirectory () + "/" + buildlogsDirectory , comparatorLogsDirectory );
134+ File outputDir = new File (getBuildDirectory () + "/" + BUILD_LOGS_DIRECTORY , COMPARATOR_LOGS_DIRECTORY );
176135 if (!outputDir .exists ()) {
177136 outputDir .mkdirs ();
178137 }
@@ -215,7 +174,7 @@ public void processBuildfile() throws IOException {
215174 while (inputLine != null ) {
216175 inputLine = input .readLine ();
217176 if (inputLine != null ) {
218- final Matcher matcher = mainPattern .matcher (inputLine );
177+ final Matcher matcher = MAIN_PATTERN .matcher (inputLine );
219178 if (matcher .matches ()) {
220179
221180 final LogEntry newEntry = LogEntry .create (matcher .group (1 ));
@@ -284,11 +243,11 @@ private boolean pureSignature(final LogEntry newEntry) {
284243 boolean result = true ;
285244 final List <String > reasons = newEntry .reasons ();
286245 for (final String reason : reasons ) {
287- final Matcher matcher1 = noclassifierPattern .matcher (reason );
288- final Matcher matcher2 = classifier_sourcesPattern .matcher (reason );
289- final Matcher matcher3 = classifier_sourcesfeaturePattern .matcher (reason );
290- final Matcher matcher4 = sign1Pattern .matcher (reason );
291- final Matcher matcher5 = sign2Pattern .matcher (reason );
246+ final Matcher matcher1 = NO_CLASSIFIER_PATTERN .matcher (reason );
247+ final Matcher matcher2 = CLASSIFIER_SOURCES_PATTERN .matcher (reason );
248+ final Matcher matcher3 = CLASSIFIER_SOURCES_FEATURE_PATTERN .matcher (reason );
249+ final Matcher matcher4 = SIGN1_PATTERN .matcher (reason );
250+ final Matcher matcher5 = SIGN2_PATTERN .matcher (reason );
292251
293252 if (matcher1 .matches () || matcher2 .matches () || matcher3 .matches () || matcher4 .matches ()
294253 || matcher5 .matches ()) {
@@ -309,12 +268,12 @@ private boolean pureSignaturePlusInnerJar(final LogEntry newEntry) {
309268 boolean result = true ;
310269 final List <String > reasons = newEntry .reasons ();
311270 for (final String reason : reasons ) {
312- final Matcher matcher1 = noclassifierPattern .matcher (reason );
313- final Matcher matcher2 = classifier_sourcesPattern .matcher (reason );
314- final Matcher matcher3 = classifier_sourcesfeaturePattern .matcher (reason );
315- final Matcher matcher4 = sign1Pattern .matcher (reason );
316- final Matcher matcher5 = sign2Pattern .matcher (reason );
317- final Matcher matcher6 = jarPattern .matcher (reason );
271+ final Matcher matcher1 = NO_CLASSIFIER_PATTERN .matcher (reason );
272+ final Matcher matcher2 = CLASSIFIER_SOURCES_PATTERN .matcher (reason );
273+ final Matcher matcher3 = CLASSIFIER_SOURCES_FEATURE_PATTERN .matcher (reason );
274+ final Matcher matcher4 = SIGN1_PATTERN .matcher (reason );
275+ final Matcher matcher5 = SIGN2_PATTERN .matcher (reason );
276+ final Matcher matcher6 = JAR_PATTERN .matcher (reason );
318277
319278 if (matcher1 .matches () || matcher2 .matches () || matcher3 .matches () || matcher4 .matches ()
320279 || matcher5 .matches () || matcher6 .matches ()) {
0 commit comments