Konloch / Konloch/bytecode-viewer

NullPointerException in FileChooser when using "Decompile & Save All"

Open
#581 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
15.6k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

When attempting to use the "Decompile & Save All" feature, the application throws a NullPointerException and fails to open the file save dialog.

To Reproduce
  1. Open a file/project in Bytecode Viewer.
  2. Click on "Decompile & Save All".
  3. The error occurs immediately.
Expected behavior

The file chooser dialog should open to allow selecting a destination folder.

Environment
  • Bytecode Viewer Version: 2.13.2 [Fat Jar]
  • OS: Linux Mint 22.3 Zena XCFE Edition
  • Java: 17.0.19
Error Log

Please send this error log to https://github.com/Konloch/bytecode-viewer/issues or Konloch at https://the.bytecode.club or konloch@gmail.com

If you hold appropriate legal rights to the relevant class/jar/apk file please include that as well.

Bytecode Viewer Version: 2.13.2 [Fat Jar], OS: Linux, Java: 17.0.19

java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "javax.swing.AbstractButton.getText()" because "this.delegate" is null

at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)

at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)

at the.bytecode.club.bytecodeviewer.gui.components.FileChooser.create(FileChooser.java:48)

at the.bytecode.club.bytecodeviewer.gui.components.FileChooser.create(FileChooser.java:43)

at the.bytecode.club.bytecodeviewer.resources.ResourceDecompiling.lambda$decompileSaveAll$0(ResourceDecompiling.java:76)

at java.base/java.lang.Thread.run(Thread.java:840)

Caused by: java.lang.NullPointerException: Cannot invoke "javax.swing.AbstractButton.getText()" because "this.delegate" is null

at com.github.weisj.darklaf.delegate.AbstractButtonLayoutDelegate.getText(AbstractButtonLayoutDelegate.java:67)

at com.github.weisj.darklaf.ui.button.DarkButtonUI$DarkButtonLayout.layout(DarkButtonUI.java:568)

at com.github.weisj.darklaf.ui.button.DarkButtonUI$DarkButtonLayout.layoutContainer(DarkButtonUI.java:556)

at java.desktop/java.awt.Container.layout(Container.java:1541)

at java.desktop/java.awt.Container.doLayout(Container.java:1530)

at com.github.weisj.darklaf.ui.button.DarkButtonListener.propertyChange(DarkButtonListener.java:88)

at com.github.weisj.darklaf.ui.togglebutton.DarkToggleButtonListener.propertyChange(DarkToggleButtonListener.java:59)

at java.desktop/java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:343)

at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:335)

at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:268)

at java.desktop/java.awt.Component.firePropertyChange(Component.java:8722)

at java.desktop/javax.swing.JComponent.putClientProperty(JComponent.java:4173)

at com.github.weisj.darklaf.ui.filechooser.DarkFileChooserUI.adjustComponents(DarkFileChooserUI.java:132)

at com.github.weisj.darklaf.ui.filechooser.DarkFileChooserUI.installComponents(DarkFileChooserUI.java:115)

at java.desktop/javax.swing.plaf.basic.BasicFileChooserUI.installUI(BasicFileChooserUI.java:209)

at java.desktop/javax.swing.plaf.metal.MetalFileChooserUI.installUI(MetalFileChooserUI.java:159)

at java.desktop/javax.swing.JComponent.setUI(JComponent.java:730)

at java.desktop/javax.swing.JFileChooser.updateUI(JFileChooser.java:1840)

at java.desktop/javax.swing.JFileChooser.setup(JFileChooser.java:396)

at java.desktop/javax.swing.JFileChooser.(JFileChooser.java:362)

at java.desktop/javax.swing.JFileChooser.(JFileChooser.java:309)

at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)

at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)

... 1 more

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the FileChooser.create methods in FileChooser.java and the decompileSaveAll call in ResourceDecompiling.java. Reproduce "Decompile & Save All" and inspect the file chooser initialization alongside the reported DarkLaf stack trace. Done means the destination-folder dialog opens without the NullPointerException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.