Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2016-09-06 21:20:39 +0000
committerStephan Herrmann2016-09-08 14:02:21 +0000
commite157b21bb74eaf6b41c3411a9206ec3f8b5f29a2 (patch)
treed392e6af62c038aea269b96bef40d069c4d53e10
parent8d3656f24c3e874f200c42da415930e5a37a16ba (diff)
downloadeclipse.jdt.core-e157b21bb74eaf6b41c3411a9206ec3f8b5f29a2.tar.gz
eclipse.jdt.core-e157b21bb74eaf6b41c3411a9206ec3f8b5f29a2.tar.xz
eclipse.jdt.core-e157b21bb74eaf6b41c3411a9206ec3f8b5f29a2.zip
minor toString() improvements
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModuleInfo.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModuleInfo.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModuleInfo.java
index 47c68ca206..dd420a9eec 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModuleInfo.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ModuleInfo.java
@@ -79,7 +79,7 @@ public class ModuleInfo extends SourceTypeElementInfo implements IModule {
}
public String toString() {
StringBuffer buffer = new StringBuffer();
- buffer.append("provides"); //$NON-NLS-1$
+ buffer.append("provides "); //$NON-NLS-1$
buffer.append(this.provides);
buffer.append(" with "); //$NON-NLS-1$
buffer.append(this.with);
@@ -184,21 +184,22 @@ public class ModuleInfo extends SourceTypeElementInfo implements IModule {
buffer.append("\nmodule "); //$NON-NLS-1$
buffer.append(this.name).append(' ');
buffer.append('{').append('\n');
- if (this.requires != null) {
+ if (this.requires != null && this.requires.length > 0) {
+ buffer.append('\n');
for(int i = 0; i < this.requires.length; i++) {
buffer.append("\trequires "); //$NON-NLS-1$
if (this.requires[i].isPublic) {
- buffer.append(" public "); //$NON-NLS-1$
+ buffer.append("public "); //$NON-NLS-1$
}
buffer.append(this.requires[i].name);
buffer.append(';').append('\n');
}
}
- if (this.exports != null) {
+ if (this.exports != null && this.exports.length > 0) {
buffer.append('\n');
for(int i = 0; i < this.exports.length; i++) {
buffer.append("\texports "); //$NON-NLS-1$
- buffer.append(this.exports[i].toString());
+ buffer.append(this.exports[i].toString()).append('\n');
}
}
if (this.uses != null) {
@@ -211,7 +212,7 @@ public class ModuleInfo extends SourceTypeElementInfo implements IModule {
if (this.provides != null) {
buffer.append('\n');
for(Service ser : this.provides) {
- buffer.append(ser.toString());
+ buffer.append('\t').append(ser.toString()).append('\n');
}
}
buffer.append('\n').append('}').toString();

Back to the top