[jira] [Updated] (NETBEANS-6458) Cyclic reference. Somebody is trying to get value from FolderInstance (org.openide.awt.Toolbar$Folder) from the same thread that is processing the instance.
[ https://issues.apache.org/jira/browse/NETBEANS-6458?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] ASF GitHub Bot updated NETBEANS-6458: - Labels: pull-request-available (was: ) > Cyclic reference. Somebody is trying to get value from FolderInstance > (org.openide.awt.Toolbar$Folder) from the same thread that is processing the > instance. > > > Key: NETBEANS-6458 > URL: https://issues.apache.org/jira/browse/NETBEANS-6458 > Project: NetBeans > Issue Type: Bug > Components: platform - Other >Reporter: Martin Entlicher >Assignee: Martin Entlicher >Priority: Critical > Labels: pull-request-available > Time Spent: 10m > Remaining Estimate: 0h > > {code} > INFO [org.openide.loaders.FolderInstance.Toolbars]: Cannot create > org.openide.loaders.FolderInstance$HoldInstance@1d0068b[Toolbars/File] > [junit] java.io.IOException: Cyclic reference. Somebody is trying to get > value from FolderInstance (org.openide.awt.Toolbar$Folder) from the same > thread that is processing the instance > [junit] at > org.openide.loaders.FolderInstance.instanceCreate(FolderInstance.java:274) > [junit] at > org.openide.loaders.FolderInstance.instanceForCookie(FolderInstance.java:555) > [junit] at > org.openide.loaders.FolderInstance$HoldInstance.instanceCreate(FolderInstance.java:1132) > [junit] [catch] at > org.openide.loaders.FolderInstance$1R.instances(FolderInstance.java:675) > [junit] at > org.openide.loaders.FolderInstance$1R.run(FolderInstance.java:696) > [junit] at > org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418) > [junit] at > org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45) > [junit] at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278) > [junit] at > org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033) > [junit] INFO [org.openide.awt.Toolbar]: Too long AWTTask: 1,811 ms for > org.openide.awt.Toolbar$Folder@512070e2(FolderList{MultiFileObject@3a04eb7f[Toolbars/UndoRedo]}) > {code} > It has happened during test > org.netbeans.modules.debugger.jpda.truffle.DebugRubyTest. > See https://app.travis-ci.com/github/apache/netbeans/jobs/559303759 for > details. -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[netbeans] branch master updated: Cleanup deprecated constructor use (#3649)
This is an automated email from the ASF dual-hosted git repository. bwalker pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/netbeans.git The following commit(s) were added to refs/heads/master by this push: new 05c385c Cleanup deprecated constructor use (#3649) 05c385c is described below commit 05c385c6b86b12e27c462b52b4dac81485f1a5e0 Author: Brad Walker AuthorDate: Sun Feb 20 21:26:21 2022 -0500 Cleanup deprecated constructor use (#3649) Cleaning some old code to make it more current.. - removed use of old deprecated constructor use - use autobox/unbox for encapsulation - change chain-of-if statement to switch w/ string - some code cleanup --- .../modules/junit/AbstractTestGenerator.java | 78 + .../lib/profiler/heap/ClassDumpSegment.java| 192 ++--- .../lib/profiler/server/ProfilerRuntimeCPU.java| 75 3 files changed, 212 insertions(+), 133 deletions(-) diff --git a/java/junit/src/org/netbeans/modules/junit/AbstractTestGenerator.java b/java/junit/src/org/netbeans/modules/junit/AbstractTestGenerator.java index b28af8f..23798db 100644 --- a/java/junit/src/org/netbeans/modules/junit/AbstractTestGenerator.java +++ b/java/junit/src/org/netbeans/modules/junit/AbstractTestGenerator.java @@ -180,7 +180,7 @@ abstract class AbstractTestGenerator implements CancellableTask{ private final boolean isNewTestClass; -private ListprocessedClassNames; +private List processedClassNames; /** * cached value of JUnitSettings.getGenerateMainMethodBody() @@ -467,26 +467,30 @@ abstract class AbstractTestGenerator implements CancellableTask{ } List members; -if (membersCount == 0) { -members = Collections.emptyList(); -} else if (membersCount == 1) { -if (constructor != null) { -members = Collections.singletonList(constructor); -} else { -members = Collections.singletonList( -generateAbstractMethodImpl(abstractMethods.get(0), - workingCopy)); -} -} else { -members = new ArrayList(membersCount); -if (constructor != null) { -members.add(constructor); -} -for (ExecutableElement abstractMethod : abstractMethods) { -members.add(generateAbstractMethodImpl(abstractMethod, - workingCopy)); -} - +switch (membersCount) { +case 0: +members = Collections.emptyList(); +break; + +case 1: +if (constructor != null) { +members = Collections.singletonList(constructor); +} else { +members = Collections.singletonList( +generateAbstractMethodImpl(abstractMethods.get(0), +workingCopy)); +} +break; + +default: +members = new ArrayList(membersCount); +if (constructor != null) { +members.add(constructor); +} for (ExecutableElement abstractMethod : abstractMethods) { +members.add(generateAbstractMethodImpl(abstractMethod, +workingCopy)); +} +break; } final TreeMaker maker = workingCopy.getTreeMaker(); @@ -494,8 +498,7 @@ abstract class AbstractTestGenerator implements CancellableTask{ switch(srcClass.getKind()) { case INTERFACE: case ANNOTATION_TYPE: -List implemetnts = -new ArrayList(); +List implemetnts = new ArrayList<>(); implemetnts.add(maker.QualIdent(srcClass)); return maker.Class( maker.Modifiers(Collections.singleton(PUBLIC)), @@ -921,7 +924,7 @@ abstract class AbstractTestGenerator implements CancellableTask{ trees); List tstMembersOrig = tstClass.getMembers(); -List tstMembers = new ArrayList(tstMembersOrig.size() + 4); +List tstMembers = new ArrayList<>(tstMembersOrig.size() + 4); tstMembers.addAll(tstMembersOrig); if (generateMissingInitMembers) { @@ -1044,7 +1047,7 @@ abstract class AbstractTestGenerator implements CancellableTask{ Iterator srcMethodsIt = srcMethods.iterator(); Iterator tstMethodNamesIt = testMethodNames.iterator(); -List testMethods = new ArrayList(srcMethods.size()); +List testMethods = new ArrayList<>(srcMethods.size()); while (srcMethodsIt.hasNext()) { assert tstMethodNamesIt.hasNext(); @@ -1458,7 +1461
[netbeans] branch master updated: Cleanup floating-point constructor use (#3648)
This is an automated email from the ASF dual-hosted git repository. bwalker pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/netbeans.git The following commit(s) were added to refs/heads/master by this push: new 4ae01ea Cleanup floating-point constructor use (#3648) 4ae01ea is described below commit 4ae01ea70f4530443343beee3292e880a74099bd Author: Brad Walker AuthorDate: Sun Feb 20 14:19:55 2022 -0500 Cleanup floating-point constructor use (#3648) Cleaned up the deprecated use of old constructors. The compiler/VM will now autobox this into a proper class. So this change removes warnings like this: [repeat] /home/bwalker/src/netbeans/profiler/lib.profiler/src/org/netbeans/lib/profiler/heap/HprofInstanceValue.java:93: warning: [deprecation] Byte(byte) in Byte has been deprecated [repeat] return new Byte(bt); [repeat]^ Also, added a couple of override annotations since I was here.. --- .../lib/profiler/heap/HprofInstanceValue.java | 48 ++ 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/profiler/lib.profiler/src/org/netbeans/lib/profiler/heap/HprofInstanceValue.java b/profiler/lib.profiler/src/org/netbeans/lib/profiler/heap/HprofInstanceValue.java index 9bf4d2b..9e45143 100644 --- a/profiler/lib.profiler/src/org/netbeans/lib/profiler/heap/HprofInstanceValue.java +++ b/profiler/lib.profiler/src/org/netbeans/lib/profiler/heap/HprofInstanceValue.java @@ -40,14 +40,17 @@ class HprofInstanceValue extends HprofObject implements FieldValue { //~ Methods -- +@Override public Instance getDefiningInstance() { return field.classDump.getHprof().getInstanceByOffset(new long[] {instanceOffset}); } +@Override public Field getField() { return field; } +@Override public String getValue() { return getTypeValue().toString(); } @@ -62,50 +65,41 @@ class HprofInstanceValue extends HprofObject implements FieldValue { static Object getTypeValue(final HprofByteBuffer dumpBuffer, final long position, final byte type) { switch (type) { case HprofHeap.OBJECT: - long obj = dumpBuffer.getID(position); - -return new Long(obj); +return obj; + case HprofHeap.BOOLEAN: - byte b = dumpBuffer.get(position); - -return Boolean.valueOf(b != 0); +return b != 0; + case HprofHeap.CHAR: - char ch = dumpBuffer.getChar(position); - -return Character.valueOf(ch); +return ch; + case HprofHeap.FLOAT: - float f = dumpBuffer.getFloat(position); - -return new Float(f); +return f; + case HprofHeap.DOUBLE: - double d = dumpBuffer.getDouble(position); - -return new Double(d); +return d; + case HprofHeap.BYTE: - byte bt = dumpBuffer.get(position); - -return new Byte(bt); +return bt; + case HprofHeap.SHORT: - short sh = dumpBuffer.getShort(position); - -return new Short(sh); +return sh; + case HprofHeap.INT: - int i = dumpBuffer.getInt(position); - -return Integer.valueOf(i); +return i; + case HprofHeap.LONG: - long lg = dumpBuffer.getLong(position); - -return new Long(lg); +return lg; + default: return "Invalid type " + type; // NOI18N } - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[jira] [Commented] (NETBEANS-2360) HiDPI scaling (and anti-aliasing on KDE) not applied automatically on Linux
[ https://issues.apache.org/jira/browse/NETBEANS-2360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17495209#comment-17495209 ] Eirik Bakke commented on NETBEANS-2360: --- Thanks, Michal! I have updated the NetBeans launcher script at https://github.com/apache/netbeans/pull/3113 to try to detect the condition you described. Could you try to see if it works? Specifically, could you: 1) Try to launch NetBeans with the new version of the launcher script, and see if the "Detected 192 DPI on all screens in xdpyinfo" message is shown and NetBeans is now scaled appropriately? 2) Temporarily turn off 2x HiDPI scaling on your window system, and relaunch NetBeans, confirming that the message above no longer appears and NetBeans no longer scales 2x? 3) Turn 2x HIDPI scaling back on on your window system, and relaunch NetBeans, and seeing that the message once again appears and NetBeans is scaled appropriately? Thanks for your help! -- Eirik > HiDPI scaling (and anti-aliasing on KDE) not applied automatically on Linux > --- > > Key: NETBEANS-2360 > URL: https://issues.apache.org/jira/browse/NETBEANS-2360 > Project: NetBeans > Issue Type: Bug > Components: platform - Launchers&CLI >Affects Versions: 11.0, 12.2 > Environment: Kubuntu 18.03 > Oracle JDK 11.0.2 >Reporter: Eirik Bakke >Priority: Major > Labels: HiDPI, Linux, pull-request-available > Attachments: CheckHiDpi.java, image-2021-09-12-21-01-33-807.png, > image-2021-09-12-21-05-06-852.png, kubunt.jpg > > Time Spent: 1h > Remaining Estimate: 0h > > Running NetBeans 11 on Kubuntu 18.03, GUI text size does not seem to take > into account the system's default HiDPI scaling. This was reported in a > Twitter thread on https://twitter.com/nicktail/status/1114789604337405952 . > Note that Window decorations seem to be the correct size. > Setting the GDK_SCALE environment variable seems to fix the problem, if I > understand the originally reporter correctly. This could probably be done > easily from the NetBeans launcher script (netbeans/bin). But it wouldn't fix > the problem in multi-monitor setups. We should investigate what could be done > to make scaling work properly in multi-monitor setups involving one HiDPI > screen and one non-HiDPI screen. > Before merging a patch to the launcher script, it should be tested on a > couple of different Linux environments, using both HiDPI and non-HiDPI > screens. Note that the UNIX launcher script is also used on MacOS. -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[netbeans] branch master updated: update VariableMirrorTranslator to bring it up to standards (#3647)
This is an automated email from the ASF dual-hosted git repository. bwalker pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/netbeans.git The following commit(s) were added to refs/heads/master by this push: new de854f8 update VariableMirrorTranslator to bring it up to standards (#3647) de854f8 is described below commit de854f82fea30533dae7f462bb1886e4405921bb Author: Brad Walker AuthorDate: Sun Feb 20 13:17:21 2022 -0500 update VariableMirrorTranslator to bring it up to standards (#3647) I initially started cleaning up VariableMirrorTranslator.java as part of some mass deprecation cleanup work I am doing. The changes for handling the autobox/unbox of the floating-point class turned into a general cleanup of the VariableMirrorTranslator class. - updated autobox/unbox - using multi-catch now - using strings in switch - update a couple of places should be using diamond operator --- .../jpda/models/VariableMirrorTranslator.java | 149 ++--- 1 file changed, 70 insertions(+), 79 deletions(-) diff --git a/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/models/VariableMirrorTranslator.java b/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/models/VariableMirrorTranslator.java index dbbbd7a..26612f0 100644 --- a/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/models/VariableMirrorTranslator.java +++ b/java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/models/VariableMirrorTranslator.java @@ -87,12 +87,12 @@ public class VariableMirrorTranslator { private static final Logger logger = Logger.getLogger(VariableMirrorTranslator.class.getName()); -private static final Object NO_MIRROR = new String("NO_MIRROR"); +private static final Object NO_MIRROR = "NO_MIRROR"; private VariableMirrorTranslator() {} static Object createMirrorObject(Value value) { -return createMirrorObject(value, new HashMap()); +return createMirrorObject(value, new HashMap<>()); } private static Object createMirrorObject(Value value, Map mirrorsMap) { @@ -112,33 +112,33 @@ public class VariableMirrorTranslator { return ShortenedStrings.getStringWithLengthControl((StringReference) value); } return createMirrorObject((ObjectReference) value, (ReferenceType) type, clazz, mirrorsMap); -} catch (ClassNotFoundException ex) { -} catch (ClassNotPreparedExceptionWrapper ex) { +} catch (ClassNotFoundException | ClassNotPreparedExceptionWrapper ex) { } } else { -if ("boolean".equals(typeStr)) { -return Boolean.valueOf(((BooleanValue) value).booleanValue()); -} else if ("byte".equals(typeStr)) { -return new Byte(((ByteValue) value).byteValue()); -} else if ("char".equals(typeStr)) { -return new Character(((CharValue) value).charValue()); -} else if ("short".equals(typeStr)) { -return new Short(((ShortValue) value).shortValue()); -} else if ("int".equals(typeStr)) { -return new Integer(((IntegerValue) value).intValue()); -} else if ("long".equals(typeStr)) { -return new Long(((LongValue) value).longValue()); -} else if ("float".equals(typeStr)) { -return new Float(((FloatValue) value).floatValue()); -} else if ("double".equals(typeStr)) { -return new Double(((DoubleValue) value).doubleValue()); -} else { -throw new IllegalArgumentException("Unknown primitive type: "+typeStr+" from "+type); +if (null == typeStr) { +throw new IllegalArgumentException("Unknown primitive type: " + typeStr + " from " + type); +} else switch (typeStr) { +case "boolean": +return ((BooleanValue) value).booleanValue(); +case "byte": +return ((ByteValue) value).byteValue(); +case "char": +return ((CharValue) value).charValue(); +case "short": +return ((ShortValue) value).shortValue(); +case "int": +return ((IntegerValue) value).intValue(); +case "long": +return ((LongValue) value).longValue(); +case "float": +return ((FloatValue) value).floatValue(); +case "double": +return ((DoubleValue) value).doubleValue(); +default: +throw new IllegalArgume
[jira] [Created] (NETBEANS-6469) Freezing When First Opened
Kendra Bills created NETBEANS-6469: -- Summary: Freezing When First Opened Key: NETBEANS-6469 URL: https://issues.apache.org/jira/browse/NETBEANS-6469 Project: NetBeans Issue Type: Bug Environment: --- >Log Session: Sunday, February 20, 2022 at 12:23:19 PM Eastern Standard Time >System Info: Product Version = Apache NetBeans IDE 12.3 Operating System= Windows 10 version 10.0 running on amd64 Java; VM; Vendor= 16; Java HotSpot(TM) 64-Bit Server VM 16+36-2231; Oracle Corporation Runtime = Java(TM) SE Runtime Environment 16+36-2231 Java Home = C:\Program Files\Java\jdk-16 System Locale; Encoding = en_US (nb); Cp1252 Home Directory = C:\Users\Kendra Current Directory = C:\Program Files\NetBeans-12.3 User Directory = C:\Users\Kendra\AppData\Roaming\NetBeans\12.3 Cache Directory = C:\Users\Kendra\AppData\Local\NetBeans\Cache\12.3 Installation= C:\Program Files\NetBeans-12.3\netbeans\nb C:\Program Files\NetBeans-12.3\netbeans\ergonomics C:\Program Files\NetBeans-12.3\netbeans\ide C:\Program Files\NetBeans-12.3\netbeans\extide C:\Program Files\NetBeans-12.3\netbeans\java C:\Program Files\NetBeans-12.3\netbeans\apisupport C:\Program Files\NetBeans-12.3\netbeans\webcommon C:\Program Files\NetBeans-12.3\netbeans\websvccommon C:\Program Files\NetBeans-12.3\netbeans\enterprise C:\Program Files\NetBeans-12.3\netbeans\profiler C:\Program Files\NetBeans-12.3\netbeans\php C:\Program Files\NetBeans-12.3\netbeans\harness C:\Program Files\NetBeans-12.3\netbeans\cpplite C:\Program Files\NetBeans-12.3\netbeans\groovy C:\Program Files\NetBeans-12.3\netbeans\javafx C:\Program Files\NetBeans-12.3\netbeans\platform Boot & Ext. Classpath = Application Classpath = C:\Program Files\NetBeans-12.3\netbeans\platform\lib\boot.jar;C:\Program Files\NetBeans-12.3\netbeans\platform\lib\org-openide-modules.jar;C:\Program Files\NetBeans-12.3\netbeans\platform\lib\org-openide-util-lookup.jar;C:\Program Files\NetBeans-12.3\netbeans\platform\lib\org-openide-util-ui.jar;C:\Program Files\NetBeans-12.3\netbeans\platform\lib\org-openide-util.jar Startup Classpath = C:\Program Files\NetBeans-12.3\netbeans\platform\core\asm-8.0.1.jar;C:\Program Files\NetBeans-12.3\netbeans\platform\core\asm-commons-8.0.1.jar;C:\Program Files\NetBeans-12.3\netbeans\platform\core\asm-tree-8.0.1.jar;C:\Program Files\NetBeans-12.3\netbeans\platform\core\core-base.jar;C:\Program Files\NetBeans-12.3\netbeans\platform\core\core.jar;C:\Program Files\NetBeans-12.3\netbeans\platform\core\org-netbeans-libs-asm.jar;C:\Program Files\NetBeans-12.3\netbeans\platform\core\org-openide-filesystems-compat8.jar;C:\Program Files\NetBeans-12.3\netbeans\platform\core\org-openide-filesystems.jar;C:\Program Files\NetBeans-12.3\netbeans\nb\core\org-netbeans-upgrader.jar;C:\Program Files\NetBeans-12.3\netbeans\nb\core\locale\core_nb.jar --- INFO [org.netbeans.modules.netbinox]: Install area set to file:/C:/Program Files/NetBeans-12.3/netbeans/ WARNING [org.netbeans.core.modules]: the modules [org.netbeans.modules.xml.text] use org.netbeans.modules.editor.deprecated.pre65formatting which is deprecated. WARNING [org.netbeans.core.modules]: the modules [org.netbeans.modules.ide.kit, org.netbeans.modules.xml.text] use org.netbeans.modules.editor.structure which is deprecated. WARNING [org.netbeans.core.modules]: the modules [org.netbeans.modules.ant.hints, org.netbeans.modules.java.hints, org.netbeans.modules.jshell.support, org.netbeans.modules.maven.hints] use org.netbeans.modules.java.hints.legacy.spi which is deprecated: Use Java Hints SPI (org.netbeans.spi.java.hints) instead. INFO [org.netbeans.core.startup.NbEvents]: Turning on modules: slf4j.jdk14 [1.7.28 1.7.28] slf4j.api [1.7.28 1.7.28] org.openide.util.lookup [8.45 12.3-c3d4f6fa6c956cf1b5a35e8da4f44a96ab76f6a9] org.openide.util [9.18 12.3-c3d4f6fa6c956cf1b5a35e8da4f44a96ab76f6a9] org.openide.util.ui [9.19 12.3-c3d4f6fa6c956cf1b5a35e8da4f44a96ab76f6a9] org.openide.modules [7.59 12.3-c3d4f6fa6c956cf1b5a35e8da4f44a96ab76f6a9] org.netbeans.api.annotations.common/1 [1.38 12.3-c3d4f6fa6c956cf1b5a35e8da4f44a96ab76f6a9] org.openide.filesystems [9
[netbeans] branch master updated: [NETBEANS-6468] Fix LAF detection on Windows 11 and Java 17.
This is an automated email from the ASF dual-hosted git repository. ebakke pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/netbeans.git The following commit(s) were added to refs/heads/master by this push: new 31085b5 [NETBEANS-6468] Fix LAF detection on Windows 11 and Java 17. 31085b5 is described below commit 31085b508268cdec1c55b6de618c6b748f32ac18 Author: Eirik Bakke AuthorDate: Sat Feb 19 14:40:00 2022 -0500 [NETBEANS-6468] Fix LAF detection on Windows 11 and Java 17. --- .../windows/view/ui/CloseButtonTabbedPane.java | 7 +- .../src/org/netbeans/swing/plaf/Startup.java | 11 +++--- .../src/org/openide/awt/CloseButtonFactory.java| 25 +++--- .../src/org/netbeans/lib/profiler/ui/UIUtils.java | 2 +- 4 files changed, 28 insertions(+), 17 deletions(-) diff --git a/platform/core.windows/src/org/netbeans/core/windows/view/ui/CloseButtonTabbedPane.java b/platform/core.windows/src/org/netbeans/core/windows/view/ui/CloseButtonTabbedPane.java index c38c9c1..31a7ac2 100644 --- a/platform/core.windows/src/org/netbeans/core/windows/view/ui/CloseButtonTabbedPane.java +++ b/platform/core.windows/src/org/netbeans/core/windows/view/ui/CloseButtonTabbedPane.java @@ -339,6 +339,11 @@ final class CloseButtonTabbedPane extends JTabbedPane implements PropertyChangeL || (osName.equals( "Windows NT (unknown)" ) && "10.0".equals( System.getProperty("os.version") )); } +private static boolean isWindows11() { +String osName = System.getProperty ("os.name"); +return osName.indexOf("Windows 11") >= 0; +} + private boolean isWindowsVistaLaF() { String osName = System.getProperty ("os.name"); return osName.indexOf("Vista") >= 0 @@ -551,7 +556,7 @@ final class CloseButtonTabbedPane extends JTabbedPane implements PropertyChangeL @Override public void setText(String text) { super.setText(text); -if (isWindowsLaF() && isWindows10()) { +if (isWindowsLaF() && (isWindows10() || isWindows11())) { int r = text.endsWith(" ") || text.endsWith(" ") ? 0 : 3; // NOI18N setBorder(BorderFactory.createEmptyBorder(0, 0, 0, r)); } diff --git a/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/Startup.java b/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/Startup.java index 069d2c8..3b49194 100644 --- a/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/Startup.java +++ b/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/Startup.java @@ -436,7 +436,7 @@ public final class Startup { buf.append("Nb."); //NOI18N buf.append(UIManager.getLookAndFeel().getID()); if (UIUtils.isXPLF()) { -if (isWindows8() || isWindows10()) { +if (isWindows8() || isWindows10() || isWindows11()) { buf.append("Windows8LFCustoms"); //NOI18N } else if (isWindowsVista() || isWindows7()) { buf.append("VistaLFCustoms"); //NOI18N @@ -461,7 +461,7 @@ public final class Startup { switch (Arrays.asList(knownLFs).indexOf(UIManager.getLookAndFeel().getID())) { case 1 : if (UIUtils.isXPLF()) { -if( isWindows8() || isWindows10() ) { +if( isWindows8() || isWindows10() || isWindows11() ) { result = new Windows8LFCustoms(); } else if (isWindowsVista() || isWindows7()) { result = new VistaLFCustoms(); @@ -487,7 +487,7 @@ public final class Startup { default : // #79401 check if it's XP style LnF, for example jGoodies if (UIUtils.isXPLF()) { -if (isWindows8() || isWindows10()) { +if (isWindows8() || isWindows10() || isWindows11()) { result = new Windows8LFCustoms(); } else if (isWindowsVista() || isWindows7()) { result = new VistaLFCustoms(); @@ -576,6 +576,11 @@ public final class Startup { || (osName.equals( "Windows NT (unknown)" ) && "10.0".equals( System.getProperty("os.version") )); } +private static boolean isWindows11() { +String osName = System.getProperty ("os.name"); +return osName.indexOf("Windows 11") >= 0; +} + private static boolean isMac() { String osName = System.getProperty ("os.name"); boolean result = osName.startsWith ("Darwin") || "Mac OS X".equals(osName); diff --git a/platform/openide.awt/src/org/openide/awt/CloseButtonFactory.java b/platform/openide.awt/src/org/openide/awt/CloseButtonFactory.java index 3f244b3..48f1a99 100644 --- a/platform/openide.awt/src/org/openide/
[netbeans] branch master updated: LSPBindings synchronization fix
This is an automated email from the ASF dual-hosted git repository. vieiro pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/netbeans.git The following commit(s) were added to refs/heads/master by this push: new 8e5d7cc LSPBindings synchronization fix new 646f84c Merge pull request #3644 from vieiro/hotfix/lsp-client-sync 8e5d7cc is described below commit 8e5d7cc170a056b6759952b893ca994459b3c0ae Author: Antonio Vieiro AuthorDate: Sat Feb 19 21:46:33 2022 +0100 LSPBindings synchronization fix --- .../netbeans/modules/lsp/client/LSPBindings.java | 31 -- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/ide/lsp.client/src/org/netbeans/modules/lsp/client/LSPBindings.java b/ide/lsp.client/src/org/netbeans/modules/lsp/client/LSPBindings.java index 2fcb1cd..b2e7e06 100644 --- a/ide/lsp.client/src/org/netbeans/modules/lsp/client/LSPBindings.java +++ b/ide/lsp.client/src/org/netbeans/modules/lsp/client/LSPBindings.java @@ -51,7 +51,6 @@ import java.util.logging.Logger; import java.util.stream.Collectors; import javax.swing.event.ChangeListener; import org.eclipse.lsp4j.ClientCapabilities; -import org.eclipse.lsp4j.CompletionCapabilities; import org.eclipse.lsp4j.DocumentSymbolCapabilities; import org.eclipse.lsp4j.InitializeParams; import org.eclipse.lsp4j.InitializeResult; @@ -346,9 +345,11 @@ public class LSPBindings { lc.setBindings(bindings); -workspace2Extension2Server.put(root, -Arrays.stream(extensions) -.collect(Collectors.toMap(k -> k, v -> bindings))); +synchronized(LSPBindings.class) { +workspace2Extension2Server.put(root, +Arrays.stream(extensions) +.collect(Collectors.toMap(k -> k, v -> bindings))); +} WORKER.post(() -> cs.fireChange()); } catch (InterruptedException | ExecutionException | IOException ex) { Exceptions.printStackTrace(ex); @@ -506,18 +507,20 @@ public class LSPBindings { @Override @SuppressWarnings("AccessingNonPublicFieldOfAnotherObject") public void run() { -for (Map mime2Bindings : project2MimeType2Server.values()) { -for (ServerDescription description : mime2Bindings.values()) { -LSPBindings b = description.bindings != null ? description.bindings.get() : null; -if (b != null && b.process != null) { -b.process.destroy(); +synchronized(LSPBindings.class) { +for (Map mime2Bindings : project2MimeType2Server.values()) { +for (ServerDescription description : mime2Bindings.values()) { +LSPBindings b = description.bindings != null ? description.bindings.get() : null; +if (b != null && b.process != null) { +b.process.destroy(); +} } } -} -for (Map mime2Bindings : workspace2Extension2Server.values()) { -for (LSPBindings b : mime2Bindings.values()) { -if (b != null && b.process != null) { -b.process.destroy(); +for (Map mime2Bindings : workspace2Extension2Server.values()) { +for (LSPBindings b : mime2Bindings.values()) { +if (b != null && b.process != null) { +b.process.destroy(); +} } } } - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists