Skip to content

Commit aeb4517

Browse files
committed
Cleanups
1 parent 1467604 commit aeb4517

File tree

17 files changed

+202
-405
lines changed

17 files changed

+202
-405
lines changed

compiler/mx.compiler/mx_graal_tools.py

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ def run_netbeans_app(app_name, jdkhome, args=None, dist=None):
6767
if jdkhome:
6868
launch += ['--jdkhome', jdkhome]
6969

70-
if not mx.get_opts().verbose:
71-
launch.append('-J-Dnetbeans.logger.console=false')
70+
# log to console if mx -v is specified
71+
if mx.get_opts().verbose:
72+
args.append('-J-Dnetbeans.logger.console=true')
7273
if mx.get_os() == 'linux':
7374
# Mitigates X server crashes on Linux
7475
launch.append('-J-Dsun.java2d.xrender=false')
@@ -79,12 +80,10 @@ def run_netbeans_app(app_name, jdkhome, args=None, dist=None):
7980
def igv(args):
8081
"""run the Ideal Graph Visualizer
8182
82-
The current version prefers to be run with JDK 11 as it's based on
83-
NetBeans 14 and JDK 11 is the only supported LTS release with that
84-
version. Other releases might work but there have been various
85-
reports of breakage so your mileage may vary. It will attempt to
86-
find a JDK 11 from EXTRA_JAVA_HOMES first and if that fails it will
87-
select something from TOOLS_JAVA_HOME.
83+
The current version is based on NetBeans 22 which officially supports JDK 17 through JDK 22. A
84+
supported JDK will be chosen from the JDKs known to mx but it will fall back to whatever is
85+
configured as JAVA_HOME if a supported JDK can't be found. It's not recommended to run igv with
86+
pre-release JDKs.
8887
8988
You can directly control which JDK is used to launch IGV using
9089
@@ -94,27 +93,31 @@ def igv(args):
9493
9594
Extra NetBeans specific options can be passed as well. mx igv --help will show the
9695
help for the NetBeans launcher.
96+
9797
"""
98-
v11 = mx.VersionSpec("11")
99-
v12 = mx.VersionSpec("12")
98+
v17 = mx.VersionSpec("17")
99+
v23 = mx.VersionSpec("23")
100100
def _igvJdkVersionCheck(version):
101-
return v11 <= version < v12
101+
return v17 <= version < v23
102102

103103
jdkhome = None
104104
if not '--jdkhome' in args:
105105
def _do_not_abort(msg):
106106
pass
107107

108108
# try to find a fully supported version first
109-
jdk = mx.get_jdk(versionCheck=_igvJdkVersionCheck, versionDescription='IGV prefers JDK 11', abortCallback=_do_not_abort)
109+
jdk = mx.get_tools_jdk(versionCheck=_igvJdkVersionCheck, versionDescription='IGV prefers JDK 17 through JDK 22', abortCallback=_do_not_abort)
110110
if jdk is None:
111-
# try TOOLS_JAVA_HOME as this should point at a more stable JDK than JDK latest
112-
jdk = mx.get_tools_jdk()
113-
114-
if not _igvJdkVersionCheck(jdk.version):
115-
mx.warn(f'{jdk.home} is not an officially supported JDK for IGV.')
116-
mx.warn('If you experience any problems try to use a JDK 11 instead.')
117-
mx.warn(f'mx help igv provides more details.')
111+
# try any JDK
112+
jdk = mx.get_jdk()
113+
114+
if jdk:
115+
jdkhome = jdk.home
116+
mx.log(f'Launching IGV with {jdkhome}')
117+
if not _igvJdkVersionCheck(jdk.version):
118+
mx.warn(f'{jdk.home} is not an officially supported JDK for IGV.')
119+
mx.warn('If you experience any problems try to use a JDK 17 or JDK 21 instead.')
120+
mx.warn(f'mx help igv provides more details.')
118121

119122
run_netbeans_app('IdealGraphVisualizer', jdkhome, args=args, dist='IDEALGRAPHVISUALIZER_DIST')
120123

compiler/mx.compiler/suite.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@
6565
"packedResource": True,
6666
},
6767
"IDEALGRAPHVISUALIZER_DIST" : {
68-
"urls" : ["https://lafo.ssw.uni-linz.ac.at/pub/idealgraphvisualizer/idealgraphvisualizer-0.31-cb98bbf5fef-all.zip"],
69-
"digest" : "sha512:ca30052094ce03a8ab88b4666261cfe66ee369c4e876528efd42facd98e53dea3ee1ae622dda6234cf79fe16698f2418e40f025ee859ca3534308be70a47794a",
68+
"urls" : ["https://lafo.ssw.uni-linz.ac.at/pub/idealgraphvisualizer/idealgraphvisualizer-1.20-SNAPSHOT-1467604189c.zip"],
69+
"digest" : "sha512:cef12577f32e39ced9a27254e1ede79acda94cd60df68ab221de2d71e067df803e7c001f7f7858b467838d49d35a02eb0ee9edd8b561c197657f71c438efe9ef",
7070
"packedResource": True,
7171
},
7272

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# marker file to keep NetBeans mx support from recognizing this directory as part of an mx project

visualizer/IdealGraphVisualizer/Data/src/main/java/org/graalvm/visualizer/data/serialization/lazy/LazyModelBuilder.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
/*
2+
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation.
8+
*
9+
* This code is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
* version 2 for more details (a copy is included in the LICENSE file that
13+
* accompanied this code).
14+
*
15+
* You should have received a copy of the GNU General Public License version
16+
* 2 along with this work; if not, write to the Free Software Foundation,
17+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18+
*
19+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20+
* or visit www.oracle.com if you need additional information or have any
21+
* questions.
22+
*/
123
package org.graalvm.visualizer.data.serialization.lazy;
224

325
import org.graalvm.visualizer.data.serialization.BinaryMap;
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,100 @@
1-
/*
2-
* Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved.
3-
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4-
*
5-
* This code is free software; you can redistribute it and/or modify it
6-
* under the terms of the GNU General Public License version 2 only, as
7-
* published by the Free Software Foundation.
8-
*
9-
* This code is distributed in the hope that it will be useful, but WITHOUT
10-
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11-
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12-
* version 2 for more details (a copy is included in the LICENSE file that
13-
* accompanied this code).
14-
*
15-
* You should have received a copy of the GNU General Public License version
16-
* 2 along with this work; if not, write to the Free Software Foundation,
17-
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18-
*
19-
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20-
* or visit www.oracle.com if you need additional information or have any
21-
* questions.
22-
*/
1+
/*
2+
* Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation.
8+
*
9+
* This code is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
* version 2 for more details (a copy is included in the LICENSE file that
13+
* accompanied this code).
14+
*
15+
* You should have received a copy of the GNU General Public License version
16+
* 2 along with this work; if not, write to the Free Software Foundation,
17+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18+
*
19+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20+
* or visit www.oracle.com if you need additional information or have any
21+
* questions.
22+
*/
2323

24-
package org.graalvm.visualizer.difference.impl;
24+
package org.graalvm.visualizer.difference.impl;
2525

26-
import java.util.Collection;
27-
import java.util.concurrent.CompletableFuture;
28-
import java.util.concurrent.ExecutionException;
29-
import java.util.concurrent.Future;
26+
import java.util.Collection;
27+
import java.util.concurrent.CompletableFuture;
28+
import java.util.concurrent.ExecutionException;
29+
import java.util.concurrent.Future;
3030

31-
import org.openide.util.Exceptions;
31+
import org.openide.util.Exceptions;
3232

33-
import jdk.graal.compiler.graphio.parsing.model.Group;
34-
import jdk.graal.compiler.graphio.parsing.model.InputGraph;
35-
import jdk.graal.compiler.graphio.parsing.model.InputNode;
33+
import jdk.graal.compiler.graphio.parsing.model.Group;
34+
import jdk.graal.compiler.graphio.parsing.model.InputGraph;
35+
import jdk.graal.compiler.graphio.parsing.model.InputNode;
3636

37-
/**
38-
* @author odouda
39-
*/
40-
public class DiffGraph extends InputGraph implements Group.LazyContent<Collection<InputNode>> {
41-
private CompletableFuture<Collection<InputNode>> f;
42-
private final InputGraph a, b;
43-
private final DiffGraphCompletion completer;
37+
/**
38+
* @author odouda
39+
*/
40+
public class DiffGraph extends InputGraph implements Group.LazyContent<Collection<InputNode>> {
41+
private CompletableFuture<Collection<InputNode>> f;
42+
private final InputGraph a, b;
43+
private final DiffGraphCompletion completer;
4444

45-
public interface DiffGraphCompletion {
46-
DiffGraph complete(InputGraph a, InputGraph b, DiffGraph c);
47-
}
45+
public interface DiffGraphCompletion {
46+
DiffGraph complete(InputGraph a, InputGraph b, DiffGraph c);
47+
}
4848

49-
public DiffGraph(Object id, String format, Object[] args, InputGraph a, InputGraph b, DiffGraphCompletion completer) {
50-
super(id, INVALID_INDEX, format, args);
51-
assert completer != null;
52-
assert a.getGraphType().equals(b.getGraphType());
53-
setGraphType(a.getGraphType());
54-
this.a = a;
55-
this.b = b;
56-
this.completer = completer;
57-
}
49+
public DiffGraph(Object id, String format, Object[] args, InputGraph a, InputGraph b, DiffGraphCompletion completer) {
50+
super(id, INVALID_INDEX, format, args);
51+
assert completer != null;
52+
assert a.getGraphType().equals(b.getGraphType());
53+
setGraphType(a.getGraphType());
54+
this.a = a;
55+
this.b = b;
56+
this.completer = completer;
57+
}
5858

59-
private InputGraph completeDiffGraph() {
60-
Object ta = completeLazy(a);
61-
Object tb = completeLazy(b);
62-
completer.complete(a, b, this);
63-
return this;
64-
}
59+
private InputGraph completeDiffGraph() {
60+
Object ta = completeLazy(a);
61+
Object tb = completeLazy(b);
62+
completer.complete(a, b, this);
63+
return this;
64+
}
6565

66-
private static Object completeLazy(InputGraph g) {
67-
if (g instanceof Group.LazyContent) {
68-
Group.LazyContent lg = (Group.LazyContent) g;
69-
if (!lg.isComplete()) {
70-
try {
71-
return lg.completeContents(null).get();
72-
} catch (InterruptedException | ExecutionException ex) {
73-
Exceptions.printStackTrace(ex);
74-
}
66+
private static Object completeLazy(InputGraph g) {
67+
if (g instanceof Group.LazyContent) {
68+
Group.LazyContent lg = (Group.LazyContent) g;
69+
if (!lg.isComplete()) {
70+
try {
71+
return lg.completeContents(null).get();
72+
} catch (InterruptedException | ExecutionException ex) {
73+
Exceptions.printStackTrace(ex);
7574
}
7675
}
77-
return null;
7876
}
77+
return null;
78+
}
7979

80-
@Override
81-
public boolean isComplete() {
82-
if (f == null) {
83-
return false;
84-
}
85-
return f.isDone();
80+
@Override
81+
public boolean isComplete() {
82+
if (f == null) {
83+
return false;
8684
}
85+
return f.isDone();
86+
}
8787

88-
@Override
89-
public Future<Collection<InputNode>> completeContents(Group.Feedback feedback) {
90-
if (f == null) {
91-
f = CompletableFuture.supplyAsync(() -> completeDiffGraph().getNodes());
92-
}
93-
return f;
88+
@Override
89+
public Future<Collection<InputNode>> completeContents(Group.Feedback feedback) {
90+
if (f == null) {
91+
f = CompletableFuture.supplyAsync(() -> completeDiffGraph().getNodes());
9492
}
93+
return f;
94+
}
9595

96-
@Override
97-
public Collection<InputNode> partialData() {
98-
return null;
99-
}
96+
@Override
97+
public Collection<InputNode> partialData() {
98+
return null;
10099
}
100+
}

visualizer/IdealGraphVisualizer/FilterWindow/src/main/java/org/graalvm/visualizer/filterwindow/actions/MoveFilterAction.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ public MoveFilterAction(List<Filter> filters, boolean direction) {
9595
this.filters = filters;
9696
}
9797

98+
@NbBundle.Messages({
99+
"ACTION_MoveFilterDownAction=Move filter downwards"
100+
})
98101
@ActionID(
99102
category = "Filters",
100103
id = "org.graalvm.visualizer.filterwindow.actions.MoveDown"
@@ -104,7 +107,7 @@ public MoveFilterAction(List<Filter> filters, boolean direction) {
104107
@ActionReference(path = "IGV/ContextActions/Filter", position = 300)
105108
})
106109
@ActionRegistration(
107-
displayName = "CTL_MoveFilterDownAction",
110+
displayName = "#ACTION_MoveFilterDownAction",
108111
iconBase = "org/graalvm/visualizer/filterwindow/images/down.png",
109112
enabledOn = @ActionState(
110113
type = Filter.class,
@@ -117,6 +120,9 @@ public Down(List<Filter> context) {
117120
}
118121
}
119122

123+
@NbBundle.Messages({
124+
"ACTION_MoveFilterUpAction=Move filter upwards"
125+
})
120126
@ActionID(
121127
category = "Filters",
122128
id = "org.graalvm.visualizer.filterwindow.actions.MoveUp"
@@ -126,7 +132,7 @@ public Down(List<Filter> context) {
126132
@ActionReference(path = "IGV/ContextActions/Filter", position = 400)
127133
})
128134
@ActionRegistration(
129-
displayName = "CTL_MoveFilterUpAction",
135+
displayName = "#ACTION_MoveFilterUpAction",
130136
iconBase = "org/graalvm/visualizer/filterwindow/images/up.png",
131137
lazy = true,
132138
enabledOn = @ActionState(

visualizer/IdealGraphVisualizer/FilterWindow/src/main/java/org/graalvm/visualizer/filterwindow/actions/RemoveFilterAction.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,15 @@
4343
import java.util.List;
4444
import java.util.Set;
4545

46+
@NbBundle.Messages({
47+
"ACTION_RemoveFilterAction=Remove filter"
48+
})
4649
@ActionID(
4750
category = "Filters",
4851
id = RemoveFilterAction.ID
4952
)
5053
@ActionRegistration(
51-
displayName = "CTL_MoveFilterUpAction",
54+
displayName = "#ACTION_RemoveFilterAction",
5255
iconBase = "org/graalvm/visualizer/filterwindow/images/minus.png",
5356
lazy = true
5457
)

visualizer/IdealGraphVisualizer/FilterWindow/src/main/java/org/graalvm/visualizer/filterwindow/actions/RenameFilterAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
@ActionReference(path = "IGV/ContextActions/Filter", position = 300),
5757
})
5858
@NbBundle.Messages({
59-
"ACTION_RenameFilter=Rename...",
59+
"ACTION_RenameFilter=Rename filter...",
6060
"LABEL_RenameFilter=Filter Name:",
6161
"TITLE_RenameFilter=Rename Filter",
6262
"# {0} - new filter name",

visualizer/IdealGraphVisualizer/View/src/main/java/org/graalvm/visualizer/view/actions/PrevDiagramAction.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,12 @@
3333
import javax.swing.AbstractAction;
3434
import java.awt.event.ActionEvent;
3535

36+
@NbBundle.Messages({
37+
"ACTION_PrevDiagramAction=Show previous graph",
38+
"DESC_SelectPrevDiagram=Show previous graph of current group"
39+
})
3640
@ActionID(category = "Diagram", id = PrevDiagramAction.ID)
37-
@ActionRegistration(displayName = "CTL_PrevDiagramAction",
41+
@ActionRegistration(displayName = "#ACTION_PrevDiagramAction",
3842
iconBase = "org/graalvm/visualizer/view/images/prev_diagram.png",
3943
enabledOn = @ActionState(property = "positions", checkedValue = ActionState.NON_NULL_VALUE, useActionInstance = true)
4044
)
@@ -43,10 +47,6 @@
4347
@ActionReference(path = "NodeGraphViewer/Actions", position = 1000),
4448
@ActionReference(path = "NodeGraphViewer/ContextActions", position = 1000)
4549
})
46-
@NbBundle.Messages({
47-
"ACTION_PrevDiagramAction=Show previous graph",
48-
"DESC_SelectPrevDiagram=Show previous graph of current group"
49-
})
5050
public final class PrevDiagramAction extends AbstractAction {
5151
static final String ID = "org.graalvm.visualizer.view.actions.PrevDiagramAction"; // NOI18N
5252

0 commit comments

Comments
 (0)