diff options
author | Gunnar Wagenknecht | 2020-10-01 20:08:03 +0000 |
---|---|---|
committer | Gunnar Wagenknecht | 2020-11-17 12:46:14 +0000 |
commit | 099c3234ad711be08e2576635e68f4c922710331 (patch) | |
tree | 6f798f6ac8a06d9975aa95f554ec14e5331d73f5 | |
parent | 0d3fd3f9c0ef224702ac87921a0e54992db66223 (diff) | |
download | eclipse.jdt.core-099c3234ad711be08e2576635e68f4c922710331.tar.gz eclipse.jdt.core-099c3234ad711be08e2576635e68f4c922710331.tar.xz eclipse.jdt.core-099c3234ad711be08e2576635e68f4c922710331.zip |
Bug 567532 - Add toString methods
Change-Id: Ia2c8fdd002852ef566813ba0ad3559fac95b9963
-rw-r--r-- | org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/env/IUpdatableModule.java | 24 |
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. */ |