fix tools build
diff --git a/plugins/org.eclipse.wtp.releng.fixups/src/org/eclipse/wtp/releng/fixups/CheckAndFixConsistency.java b/plugins/org.eclipse.wtp.releng.fixups/src/org/eclipse/wtp/releng/fixups/CheckAndFixConsistency.java
index 8ef0860..a7410a9 100644
--- a/plugins/org.eclipse.wtp.releng.fixups/src/org/eclipse/wtp/releng/fixups/CheckAndFixConsistency.java
+++ b/plugins/org.eclipse.wtp.releng.fixups/src/org/eclipse/wtp/releng/fixups/CheckAndFixConsistency.java
@@ -311,11 +311,15 @@
bw = new StringWriter();
String oneline = null;
+ boolean foundMatch = false;
do {
oneline = br.readLine();
if (oneline != null) {
- if (oneline.startsWith(LICENSE_KEY)) {
+ if (oneline.matches(LICENSE_KEY)) {
+ foundMatch = true;
// flush old input to end of property
+ // TODO: not sure this is right logic if key and value
+// are on exactly one line?
while ((oneline != null) && oneline.matches(".*" + CONTINUATION)) {
oneline = br.readLine();
}
@@ -342,10 +346,19 @@
while (oneline != null);
closereader(br);
- StringBufferInputStream newcontent = new StringBufferInputStream(bw.toString());
- featureProperties.setContents(newcontent, true, true, null);
- // if we got through all that without exception, all is ok
- result = true;
+
+ if (foundMatch) {
+ StringBufferInputStream newcontent = new StringBufferInputStream(bw.toString());
+ featureProperties.setContents(newcontent, true, true, null);
+ // if we get to here without exception, all is ok
+ result = true;
+ }
+ else {
+ System.out.println("Error: detected license needed changing, but could not change it.");
+ System.out.println(" Probably an unexpected key/value format in properties file.");
+ System.out.println(" Check file: " + featureProperties.getFullPath());
+ result = false;
+ }
}
catch (FileNotFoundException e) {