diff --git a/substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/constraints/UnsupportedFeatures.java b/substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/constraints/UnsupportedFeatures.java index 61a9b54a7310..85f71121b68b 100644 --- a/substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/constraints/UnsupportedFeatures.java +++ b/substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/constraints/UnsupportedFeatures.java @@ -121,11 +121,13 @@ public void report(BigBang bb) { printStream.close(); String unsupportedFeaturesMessage; + String output = outputStream.toString(); + String detailedMessage = output.isEmpty() ? "" : "\nDetailed message:\n" + output; if (singleEntry) { - unsupportedFeaturesMessage = entries.get(0).message + "\nDetailed message:\n" + outputStream.toString(); + unsupportedFeaturesMessage = entries.get(0).message + detailedMessage; throw new UnsupportedFeatureException(unsupportedFeaturesMessage, entries.get(0).originalException); } else { - unsupportedFeaturesMessage = "Unsupported features in " + entries.size() + " methods" + "\nDetailed message:\n" + outputStream.toString(); + unsupportedFeaturesMessage = "Unsupported features in " + entries.size() + " methods" + detailedMessage; throw new UnsupportedFeatureException(unsupportedFeaturesMessage); }