RFR: 8261931: IGV: quick search fails on multi-line node labels
Xin Liu
xliu at openjdk.java.net
Tue Mar 9 23:11:07 UTC 2021
On Tue, 9 Mar 2021 14:25:04 GMT, Nils Eliasson <neliasso at openjdk.org> wrote:
>> This change makes it possible to match any field of a multi-line node label, by removing line breaks from the `label` node property that is searched on by default.
>>
>> Tested manually using different node label configurations (configurable in `Tools` -> `Options` -> `General`), with and without line breaks.
>
> Does this solution work on all platforms?
Thank you for fixing this problem.
> Does this solution work on all platforms?
I think "\\R" here refers to the "Line Breaker Matcher"
> Any Unicode linebreak sequence, is equivalent to \u000D\u000A|[\u000A\u000B\u000C\u000D\u0085\u2028\u2029]
As the document says, it matches any linebreak sequence in Unicode. I assume this linebreak sequence comes from the text control. All platforms should have the similar linebreaks. Therefore, it's portable. I also verified this patch on MacOS. It works.
Instead of replacing \R with " " for label only, Is it a better place to do that in resolveString()?
diff --git a/src/utils/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Figure.java b/src/utils/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Figure.java
index 49c5d57348a..9c2735ce50a 100644
--- a/src/utils/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Figure.java
+++ b/src/utils/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Figure.java
@@ -325,7 +325,7 @@ public class Figure extends Properties.Entity implements Source.Provider, Vertex
}
}
- return sb.toString();
+ return sb.toString().replaceAll("\\R", " ");
}
The reason is Figure.getWitdh() for lines. I don't think it can get appropriate width if the string contains \R.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2889
More information about the hotspot-compiler-dev
mailing list