Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGunnar Wagenknecht2020-10-01 20:08:03 +0000
committerGunnar Wagenknecht2020-11-17 12:46:14 +0000
commit099c3234ad711be08e2576635e68f4c922710331 (patch)
tree6f798f6ac8a06d9975aa95f554ec14e5331d73f5
parent0d3fd3f9c0ef224702ac87921a0e54992db66223 (diff)
downloadeclipse.jdt.core-099c3234ad711be08e2576635e68f4c922710331.tar.gz
eclipse.jdt.core-099c3234ad711be08e2576635e68f4c922710331.tar.xz
eclipse.jdt.core-099c3234ad711be08e2576635e68f4c922710331.zip
Bug 567532 - Add toString methods
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IUpdatableModule.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IUpdatableModule.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IUpdatableModule.java
index 82e3bd10cc..ed99f5c191 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IUpdatableModule.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IUpdatableModule.java
@@ -79,6 +79,11 @@ public interface IUpdatableModule {
}
return hash;
}
+ @Override
+ public String toString() {
+ return "add-exports " + CharOperation.charToString(this.name) + "=" + CharOperation.charToString(CharOperation.concatWith(this.targets, ',')); //$NON-NLS-1$//$NON-NLS-2$
+ }
+
}
class AddReads implements Consumer<IUpdatableModule> {
@@ -113,6 +118,10 @@ public interface IUpdatableModule {
public int hashCode() {
return CharOperation.hashCode(this.targetModule);
}
+ @Override
+ public String toString() {
+ return "add-read " + CharOperation.charToString(this.targetModule); //$NON-NLS-1$
+ }
}
/** Structure for update operations, sorted by {@link UpdateKind}. */
class UpdatesByKind {
@@ -132,6 +141,21 @@ public interface IUpdatableModule {
throw new IllegalArgumentException("Unknown enum value "+kind); //$NON-NLS-1$
}
}
+ @Override
+ public String toString() {
+ StringBuilder result = new StringBuilder();
+ for (Consumer<IUpdatableModule> consumer : this.moduleUpdates) {
+ if(result.length() > 0)
+ result.append("\n"); //$NON-NLS-1$
+ result.append(consumer);
+ }
+ for (Consumer<IUpdatableModule> consumer : this.packageUpdates) {
+ if(result.length() > 0)
+ result.append("\n"); //$NON-NLS-1$
+ result.append(consumer);
+ }
+ return result.toString();
+ }
}
/** Answer the name of the module to update. */

Back to the top