diff --git a/NOTICE b/NOTICE
index 0e2b9e3b9952..b09ec350398a 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,5 +1,5 @@
Apache NetBeans
-Copyright 2017-2025 The Apache Software Foundation
+Copyright 2017-2026 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
diff --git a/README.md b/README.md
index 68a439d3f094..a73b134d9098 100644
--- a/README.md
+++ b/README.md
@@ -161,8 +161,8 @@ This gives you just few log entries including the initial checkin and
change of the file headers to Apache. But then the magic comes:
```bash
-$ git remote add emilian https://github.com/emilianbold/netbeans-releases.git
-$ git fetch emilian # this takes a while, the history is huge!
+$ git remote add archive https://github.com/codelerity/netbeans-releases.git
+$ git fetch archive # this takes a while, the history is huge!
$ git replace 6daa72c98 32042637 # the 1st donation
$ git replace 6035076ee 32042637 # the 2nd donation
```
@@ -174,6 +174,6 @@ $ git log platform/uihandler/arch.xml
$ git blame platform/uihandler/arch.xml
```
-Many thanks to Emilian Bold who converted the ancient history to his
-[Git repository](https://github.com/emilianbold/netbeans-releases)
-and made the magic possible!
+You can browse the archived repo [here](https://github.com/codelerity/netbeans-releases).
+
+Many thanks to Emilian Bold who created the original archive repository.
diff --git a/java/java.api.common/src/org/netbeans/modules/java/api/common/project/ui/customizer/Bundle.properties b/java/java.api.common/src/org/netbeans/modules/java/api/common/project/ui/customizer/Bundle.properties
index 9758aab92ba5..c1e8cd9ebd21 100644
--- a/java/java.api.common/src/org/netbeans/modules/java/api/common/project/ui/customizer/Bundle.properties
+++ b/java/java.api.common/src/org/netbeans/modules/java/api/common/project/ui/customizer/Bundle.properties
@@ -69,7 +69,7 @@ TITLE_InvalidRoot=Invalid Source Roots
LBL_SourceFolder_DialogTitle=Add Source Folder
LBL_TestFolder_DialogTitle=Add Test Folder
LBL_ModuleFolder_DialogTitle=Add Module Folder
-LBL_TestFolder_DialogTitle=Add Test Module Folder
+LBL_TestModuleFolder_DialogTitle=Add Test Module Folder
LBL_InvalidRoot=Already used package folders:
MNE_InvalidRoot=A
AD_InvalidRoot=N/A
diff --git a/java/java.completion/src/org/netbeans/modules/java/completion/JavaCompletionTask.java b/java/java.completion/src/org/netbeans/modules/java/completion/JavaCompletionTask.java
index c3001cffcd39..7cf25ed54e07 100644
--- a/java/java.completion/src/org/netbeans/modules/java/completion/JavaCompletionTask.java
+++ b/java/java.completion/src/org/netbeans/modules/java/completion/JavaCompletionTask.java
@@ -5996,7 +5996,7 @@ private Set extends TypeMirror> getSmartTypesImpl(Env env) throws IOException
path = new TreePath(path, mid);
TypeMirror typeMirror = controller.getTrees().getTypeMirror(path);
final ExecutableType midTM = typeMirror != null && typeMirror.getKind() == TypeKind.EXECUTABLE ? (ExecutableType) typeMirror : null;
- final ExecutableElement midEl = midTM == null ? null : (ExecutableElement) controller.getTrees().getElement(path);
+ final ExecutableElement midEl = midTM != null && controller.getTrees().getElement(path) instanceof ExecutableElement ee ? ee : null;
switch (mid.getKind()) {
case MEMBER_SELECT: {
String name = ((MemberSelectTree) mid).getIdentifier().toString();
diff --git a/java/java.hints/src/org/netbeans/modules/java/hints/Bundle.properties b/java/java.hints/src/org/netbeans/modules/java/hints/Bundle.properties
index 62288327ac1d..693c631f1b43 100644
--- a/java/java.hints/src/org/netbeans/modules/java/hints/Bundle.properties
+++ b/java/java.hints/src/org/netbeans/modules/java/hints/Bundle.properties
@@ -283,7 +283,9 @@ HINT_SerialVersionUID_Generated=Add generated serialVersionUID
FieldForUnusedParamCustomizer.finalFields.text=Fields are final
ACSD_Final_Fields=Make fields created by this hint final.
-DSC_StaticImport=Convert a static method/field/enum-field reference to use a static import. Feedback to http://www.netbeans.org/issues/show_bug.cgi?id=89258
+DSC_StaticImport=Convert a static method/field/enum-field reference to use a static import.\
+
Math.abs(-1) -> abs(-1)
"); //NOI18N if (doc.containsKey(DocTree.Kind.DEPRECATED)) { - sb.append("").append(NbBundle.getMessage(ElementJavadoc.class, "JCD-deprecated")).append(" ").append(doc.get(DocTree.Kind.DEPRECATED)).append("
"); //NOI18N + sb.append("").append(NbBundle.getMessage(ElementJavadoc.class, "JCD-deprecated")).append("
"); //NOI18N } if (doc.containsKey(null)) { sb.append(doc.get(null)); diff --git a/java/maven/src/org/netbeans/modules/maven/classpath/ClassPathProviderImpl.java b/java/maven/src/org/netbeans/modules/maven/classpath/ClassPathProviderImpl.java index fda13392d1e8..02041461a6ee 100644 --- a/java/maven/src/org/netbeans/modules/maven/classpath/ClassPathProviderImpl.java +++ b/java/maven/src/org/netbeans/modules/maven/classpath/ClassPathProviderImpl.java @@ -514,8 +514,7 @@ public ClassPath getActiveClassPath() { if(moduleInfoFile.exists()) { FileObject moduleInfo = FileUtil.toFileObject(moduleInfoFile); String sourceLevel = SourceLevelQuery.getSourceLevel2(moduleInfo).getSourceLevel(); - String ide_jdkvers = System.getProperty("java.version"); //NOI18N - if(!sourceLevel.startsWith("1.") && !ide_jdkvers.startsWith("1.")) { //NOI18N + if (sourceLevel != null && !sourceLevel.startsWith("1.")) { //NOI18N // both sourceLevel and ideJDK are 9+ ret = hasModuleInfoCP.get(); } diff --git a/nbbuild/notice-stub.txt b/nbbuild/notice-stub.txt index 7cdf9ca76df0..33c832f5719c 100644 --- a/nbbuild/notice-stub.txt +++ b/nbbuild/notice-stub.txt @@ -1,5 +1,5 @@ Apache NetBeans -Copyright 2017-2025 The Apache Software Foundation +Copyright 2017-2026 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (http://www.apache.org/). diff --git a/platform/favorites/src/org/netbeans/modules/favorites/Bundle.properties b/platform/favorites/src/org/netbeans/modules/favorites/Bundle.properties index af71a113b450..08be9f58a4fa 100644 --- a/platform/favorites/src/org/netbeans/modules/favorites/Bundle.properties +++ b/platform/favorites/src/org/netbeans/modules/favorites/Bundle.properties @@ -50,3 +50,6 @@ OpenIDE-Module-Long-Description=Favorites module enables you to create a view of # Options Export Favorites.Options.Export.displayName=Favorites + +# Automatically open when first file opened for editing +Favorites.openOnFirstFile=true diff --git a/platform/favorites/src/org/netbeans/modules/favorites/Module.java b/platform/favorites/src/org/netbeans/modules/favorites/Module.java index 90bd2cd0159b..80d5e7296916 100644 --- a/platform/favorites/src/org/netbeans/modules/favorites/Module.java +++ b/platform/favorites/src/org/netbeans/modules/favorites/Module.java @@ -32,24 +32,35 @@ import org.netbeans.swing.plaf.LFCustoms; import org.openide.filesystems.FileObject; import org.openide.filesystems.FileUtil; +import org.openide.loaders.DataObject; +import org.openide.util.NbBundle; import org.openide.util.NbPreferences; -import org.openide.windows.Mode; import org.openide.windows.OnShowing; +import org.openide.windows.TopComponent; import org.openide.windows.WindowManager; /** * For lifecycle tasks. + * * @author mbien */ public final class Module { private static final String INITIAL_OPEN_DONE_KEY = "initial-open-done"; //NOI18N + private static final String INITIAL_OPEN_BRANDING_KEY = "Favorites.openOnFirstFile"; //NOI18N private Module() {} @OnShowing public final static class EDTInit implements Runnable { + private final boolean openOnFirstFile; + + public EDTInit() { + openOnFirstFile = Boolean.parseBoolean( + NbBundle.getMessage(Module.class, INITIAL_OPEN_BRANDING_KEY)); + } + @Override public void run() { registerFavAppenderFunction(); @@ -73,19 +84,23 @@ private void registerFavAppenderFunction() { UIManager.put(LFCustoms.FILECHOOSER_SHORTCUTS_FILESFUNCTION, favAppender); } - // very first on-editor-open event will also open the Favorites tab + // very first file editor opened will also open the Favorites tab private void attachFirstEditorOpenListener() { + if (!openOnFirstFile) { + return; + } Preferences prefs = NbPreferences.forModule(Module.class); if (prefs.getBoolean(INITIAL_OPEN_DONE_KEY, false)) { return; } - WindowManager wm = WindowManager.getDefault(); - wm.addPropertyChangeListener(new PropertyChangeListener() { + TopComponent.Registry registry = TopComponent.getRegistry(); + registry.addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { - if ("activeMode".equals(evt.getPropertyName()) //NOI18N - && evt.getNewValue() instanceof Mode mode - && wm.isEditorMode(mode)) { + if (TopComponent.Registry.PROP_TC_OPENED.equals(evt.getPropertyName()) + && evt.getNewValue() instanceof TopComponent tc + && hasFileReference(tc) + && WindowManager.getDefault().isEditorTopComponent(tc)) { try { Tab favTab = Tab.findDefault(); if (favTab != null && !favTab.wasOpened() && !favTab.isOpened()) { @@ -95,13 +110,18 @@ public void propertyChange(PropertyChangeEvent evt) { prefs.putBoolean(INITIAL_OPEN_DONE_KEY, true); PropertyChangeListener thisListener = this; SwingUtilities.invokeLater(() -> { - wm.removePropertyChangeListener(thisListener); + registry.removePropertyChangeListener(thisListener); }); } } + } }); } + + private boolean hasFileReference(TopComponent tc) { + return tc.getLookup().lookup(DataObject.class) != null; + } } } diff --git a/platform/masterfs/test/unit/src/org/netbeans/modules/masterfs/filebasedfs/fileobjects/StatFilesTest.java b/platform/masterfs/test/unit/src/org/netbeans/modules/masterfs/filebasedfs/fileobjects/StatFilesTest.java index 440017aae2a5..e24bd3c4bd14 100644 --- a/platform/masterfs/test/unit/src/org/netbeans/modules/masterfs/filebasedfs/fileobjects/StatFilesTest.java +++ b/platform/masterfs/test/unit/src/org/netbeans/modules/masterfs/filebasedfs/fileobjects/StatFilesTest.java @@ -18,6 +18,7 @@ */ package org.netbeans.modules.masterfs.filebasedfs.fileobjects; +import java.awt.GraphicsEnvironment; import java.io.File; import java.io.IOException; @@ -26,6 +27,7 @@ import java.util.List; import java.util.Stack; import org.netbeans.junit.NbTestCase; +import org.netbeans.junit.RandomlyFails; import org.netbeans.modules.masterfs.filebasedfs.FileBasedFileSystem; import org.netbeans.modules.masterfs.filebasedfs.naming.FileNaming; import org.netbeans.modules.masterfs.filebasedfs.naming.NamingFactory; @@ -49,6 +51,7 @@ public StatFilesTest(String testName) { @Override protected void setUp() throws java.lang.Exception { + GraphicsEnvironment.isHeadless(); // may cause file reads in a static initializer on linux FileObjectFactory.WARNINGS = false; clearWorkDir(); testFile = new File(getWorkDir(), "testLockFile.txt"); @@ -151,6 +154,7 @@ public void testGetChildrenCaches() throws IOException { monitor.getResults().assertResult(1, StatFiles.READ); } + @RandomlyFails // JDK update releases caused failures public void testLockFile() throws IOException { FileObject fobj = getFileObject(testFile); monitor.reset();