Bug 573093: Make it explicit the plug-in/class is unknown
The existing code would make it look like the Status came
from Status class when the plug-in ID or Class could
not be determined. This change makes it explicit
using the unknownId to indicate that the ID is unknown.
Change-Id: I8fde28f856bb849b02a9038c2499f8141501032c
Signed-off-by: Jonah Graham <jonah@kichwacoders.com>
Reviewed-on: https://git.eclipse.org/r/c/equinox/rt.equinox.bundles/+/179698
Tested-by: Thomas Watson <tjwatson@us.ibm.com>
Reviewed-by: Thomas Watson <tjwatson@us.ibm.com>
diff --git a/bundles/org.eclipse.equinox.common.tests/src/org/eclipse/equinox/common/tests/StatusTest.java b/bundles/org.eclipse.equinox.common.tests/src/org/eclipse/equinox/common/tests/StatusTest.java
index 15d6235..692ade2 100644
--- a/bundles/org.eclipse.equinox.common.tests/src/org/eclipse/equinox/common/tests/StatusTest.java
+++ b/bundles/org.eclipse.equinox.common.tests/src/org/eclipse/equinox/common/tests/StatusTest.java
@@ -130,7 +130,7 @@
assertEquals("org.eclipse.equinox.common.tests", new Status(IStatus.WARNING, StatusTest.class, "").getPlugin());
assertEquals("org.eclipse.equinox.common", new Status(IStatus.ERROR, IStatus.class, "", null).getPlugin());
assertEquals("java.lang.String", new Status(IStatus.WARNING, String.class, 0, "", null).getPlugin());
- assertEquals("org.eclipse.core.runtime.Status", new Status(IStatus.WARNING, (Class<?>) null, "").getPlugin());
+ assertEquals("unknown", new Status(IStatus.WARNING, (Class<?>) null, "").getPlugin());
assertEquals(TestClass.class.getName(),
new Status(IStatus.WARNING, installNoBSNBundle().loadClass(TestClass.class.getName()), "").getPlugin());
}
@@ -139,7 +139,7 @@
assertEquals("org.eclipse.equinox.common", new MultiStatus(IStatus.class, 0, "").getPlugin());
assertEquals("org.eclipse.equinox.common.tests", new MultiStatus(StatusTest.class, 0, "").getPlugin());
assertEquals("java.lang.String", new MultiStatus(String.class, 0, new Status[0], "", null).getPlugin());
- assertEquals("org.eclipse.core.runtime.MultiStatus", new MultiStatus((Class<?>) null, 0, "").getPlugin());
+ assertEquals("unknown", new MultiStatus((Class<?>) null, 0, "").getPlugin());
assertEquals(TestClass.class.getName(),
new MultiStatus(installNoBSNBundle().loadClass(TestClass.class.getName()), 0, "").getPlugin());
}
diff --git a/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/Status.java b/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/Status.java
index aa63c3f..aad490f 100644
--- a/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/Status.java
+++ b/bundles/org.eclipse.equinox.common/src/org/eclipse/core/runtime/Status.java
@@ -214,7 +214,7 @@
.map(b -> b.getSymbolicName())//
.orElseGet(() -> Optional.ofNullable(caller)//
.map(c -> c.getName())//
- .orElse(getClass().getName()));
+ .orElse(unknownId));
}
@Override