Code cleanup, related to fix for Issue 99.
diff --git a/com.google.eclipse.protobuf/META-INF/MANIFEST.MF b/com.google.eclipse.protobuf/META-INF/MANIFEST.MF
index 41e5b07..b6c702e 100644
--- a/com.google.eclipse.protobuf/META-INF/MANIFEST.MF
+++ b/com.google.eclipse.protobuf/META-INF/MANIFEST.MF
@@ -21,6 +21,7 @@
org.apache.commons.logging
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Export-Package: com.google.eclipse.protobuf,
+ com.google.eclipse.protobuf.conversion,
com.google.eclipse.protobuf.grammar,
com.google.eclipse.protobuf.parseTreeConstruction,
com.google.eclipse.protobuf.parser.antlr,
diff --git a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/conversion/STRINGValueConverter.java b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/conversion/STRINGValueConverter.java
index ac50185..f8030dc 100644
--- a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/conversion/STRINGValueConverter.java
+++ b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/conversion/STRINGValueConverter.java
@@ -8,7 +8,6 @@
*/
package com.google.eclipse.protobuf.conversion;
-import static com.google.eclipse.protobuf.util.Strings.removeLineBreaksFrom;
import static org.eclipse.xtext.util.Strings.*;
import org.eclipse.xtext.conversion.ValueConverterException;
@@ -45,6 +44,11 @@
}
}
+ private static String removeLineBreaksFrom(String s) {
+ if (s == null) return s;
+ return s.replaceAll("\"[\t\r\n]+\"|'[\t\r\n]+'", "");
+ }
+
private ValueConverterException parsingError(String string, INode node, Exception cause) {
return new ValueConverterException("Couldn't convert '" + string + "' to String.", node, cause);
}
diff --git a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/ProtobufImportUriResolver.java b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/ProtobufImportUriResolver.java
index e1cfbc8..8c32dbf 100644
--- a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/ProtobufImportUriResolver.java
+++ b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/scoping/ProtobufImportUriResolver.java
@@ -8,8 +8,6 @@
*/
package com.google.eclipse.protobuf.scoping;
-import static com.google.eclipse.protobuf.util.Strings.removeLineBreaksFrom;
-
import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.scoping.impl.ImportUriResolver;
@@ -46,7 +44,7 @@
}
private String resolveImportUri(Import anImport) {
- String importURI = removeLineBreaksFrom(anImport.getImportURI());
+ String importURI = anImport.getImportURI();
return delegate.resolveUri(importURI, anImport.eResource());
}
}
diff --git a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/util/Strings.java b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/util/Strings.java
index 1d4e8eb..b3b079e 100644
--- a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/util/Strings.java
+++ b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/util/Strings.java
@@ -33,15 +33,5 @@
return new String(chars);
}
- /**
- * Removes any line breaks from the given {@code String}.
- * @param s the given {@code String}.
- * @return the given {@code String} with all line breaks removed.
- */
- public static String removeLineBreaksFrom(String s) {
- if (s == null) return s;
- return s.replaceAll("\"[\t\r\n]+\"|'[\t\r\n]+'", "");
- }
-
private Strings() {}
}