Skip to content

Conversation

@matthiasblaesing
Copy link
Contributor

Usage: Select exactly two folder entries in the project/files/favorites, open the context menu and select "Tools" -> "Tree diff"

grafik

This results in a flattened view of the difference between the two trees:

grafik

  • Entries with red background are present in the source, but not in the target
  • Entries with blue background are present in both locations but differ
  • Entries with green background are present in the target, but not in the source

The list of modified files/folder can be display as hierarchy:

grafik

When a modified file is selected the diff view shows both versions and allows to update the target:

grafik

Additionally actions can be invoked directly on the difference entries:

grafik

grafik

grafik

Closes: #8349

@matthiasblaesing matthiasblaesing added the ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) label Jun 24, 2025
@mbien mbien added Editor UI User Interface labels Jun 24, 2025
@matthiasblaesing
Copy link
Contributor Author

As this has little side effects and would be trivial to remove, I intent to merge at the end of week, unless someone objects.

@ebarboni
Copy link
Contributor

LGTM

@matthiasblaesing matthiasblaesing added this to the NB27 milestone Jul 13, 2025
@matthiasblaesing matthiasblaesing merged commit 99dc234 into apache:master Jul 13, 2025
31 checks passed
@matthiasblaesing matthiasblaesing deleted the treediff branch July 16, 2025 17:26
@neilcsmith-net
Copy link
Member

For info, this addition seems to be causing an exception to be thrown in a platform application. I need to look more to see if it can be triggered in the IDE. The application is calling Mode::getTopComponents which then ends up throwing -

Class: class org.netbeans.modules.diff.tree.TreeDiffViewerTopComponent
Source: MultiFileObject@9a12497[Windows2Local/Components/TreeDiffViewerTopComponent.settings]
Caused: java.lang.NoSuchMethodException: org.netbeans.modules.diff.tree.TreeDiffViewerTopComponent.<init>()

@matthiasblaesing
Copy link
Contributor Author

@neilcsmith-net do you have a full stack trace?

@neilcsmith-net
Copy link
Member

@matthiasblaesing this should cover it from the mode impl up -

INFO [org.netbeans.core.windows.persistence]: [PersistenceManager.getTopComponentForID] Problem when deserializing TopComponent for tcID:'TreeDiffViewerTopComponent'. Reason: null
Content: 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE settings PUBLIC "-//NetBeans//DTD Session settings 1.0//EN" "http://www.netbeans.org/dtds/sessionsettings-1_0.dtd">
<settings version="1.0">
  <instance class="org.netbeans.modules.diff.tree.TreeDiffViewerTopComponent"/>
</settings>
Class: class org.netbeans.modules.diff.tree.TreeDiffViewerTopComponent
Source: MultiFileObject@6c5efbe8[Windows2Local/Components/TreeDiffViewerTopComponent.settings]
Content: 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE settings PUBLIC "-//NetBeans//DTD Session settings 1.0//EN" "http://www.netbeans.org/dtds/sessionsettings-1_0.dtd">
<settings version="1.0">
  <instance class="org.netbeans.modules.diff.tree.TreeDiffViewerTopComponent"/>
</settings>
Class: class org.netbeans.modules.diff.tree.TreeDiffViewerTopComponent
Source: MultiFileObject@6c5efbe8[Windows2Local/Components/TreeDiffViewerTopComponent.settings]
Caused: java.lang.NoSuchMethodException: org.netbeans.modules.diff.tree.TreeDiffViewerTopComponent.<init>()
	at java.base/java.lang.Class.getConstructor0(Class.java:3218)
	at java.base/java.lang.Class.getDeclaredConstructor(Class.java:2493)
	at org.netbeans.modules.settings.convertors.XMLSettingsSupport.newInstance(XMLSettingsSupport.java:73)
	at org.netbeans.modules.settings.convertors.XMLSettingsSupport$SettingsRecognizer.instanceCreate(XMLSettingsSupport.java:610)
Caused: java.io.IOException
	at org.netbeans.modules.settings.convertors.XMLSettingsSupport$SettingsRecognizer.instanceCreate(XMLSettingsSupport.java:612)
	at org.netbeans.modules.settings.convertors.SerialDataConvertor$SettingsInstance.instanceCreate(SerialDataConvertor.java:399)
[catch] at org.netbeans.core.windows.persistence.PersistenceManager.getTopComponentPersistentForID(PersistenceManager.java:547)
	at org.netbeans.core.windows.persistence.PersistenceManager.getTopComponentForID(PersistenceManager.java:657)
	at org.netbeans.core.windows.PersistenceHandler.getTopComponentForID(PersistenceHandler.java:453)
	at org.netbeans.core.windows.WindowManagerImpl.getTopComponentForID(WindowManagerImpl.java:995)
	at org.netbeans.core.windows.model.TopComponentSubModel.getTopComponent(TopComponentSubModel.java:353)
	at org.netbeans.core.windows.model.TopComponentSubModel.getTopComponents(TopComponentSubModel.java:65)
	at org.netbeans.core.windows.model.DefaultModeModel.getTopComponents(DefaultModeModel.java:415)
	at org.netbeans.core.windows.model.DefaultModel.getModeTopComponents(DefaultModel.java:907)
	at org.netbeans.core.windows.Central.getModeTopComponents(Central.java:1541)
	at org.netbeans.core.windows.ModeImpl.getTopComponents(ModeImpl.java:200)

I'm going to replace the call with something else in the application, but I'm not sure if anything else in the IDE or elsewhere may hit part of this stack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) Editor UI User Interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Diff for folders

4 participants