Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE in DarkComboBoxUI.getBorderInsets #67

Closed
vlsi opened this issue Mar 8, 2020 · 5 comments
Closed

NPE in DarkComboBoxUI.getBorderInsets #67

vlsi opened this issue Mar 8, 2020 · 5 comments
Labels
bug Something isn't working

Comments

@vlsi
Copy link
Contributor

vlsi commented Mar 8, 2020

It seems to be a regression since 6e26765

        if (comboBox.getComponentOrientation().isLeftToRight()) {
            return new InsetsUIResource(boxPadding.top, boxPadding.left, boxPadding.bottom, borderSize); // <-- HERE
java.lang.NullPointerException: null
	at com.github.weisj.darklaf.ui.combobox.DarkComboBoxUI.getBorderInsets(DarkComboBoxUI.java:398) ~[darklaf-core.jar:1.4.0.3-SNAPSHOT]
	at javax.swing.JComponent.setBorder(JComponent.java:1799) ~[?:1.8.0_222]
	at com.github.weisj.darklaf.ui.combobox.DarkComboBoxUI.installUI(DarkComboBoxUI.java:77) ~[darklaf-core.jar:1.4.0.3-SNAPSHOT]
	at javax.swing.JComponent.setUI(JComponent.java:666) ~[?:1.8.0_222]
	at javax.swing.JComboBox.setUI(JComboBox.java:257) ~[?:1.8.0_222]
	at javax.swing.JComboBox.updateUI(JComboBox.java:266) ~[?:1.8.0_222]
	at javax.swing.SwingUtilities.updateComponentTreeUI0(SwingUtilities.java:1238) ~[?:1.8.0_222]
	at javax.swing.SwingUtilities.updateComponentTreeUI0(SwingUtilities.java:1253) ~[?:1.8.0_222]
	at javax.swing.SwingUtilities.updateComponentTreeUI0(SwingUtilities.java:1253) ~[?:1.8.0_222]
	at javax.swing.SwingUtilities.updateComponentTreeUI0(SwingUtilities.java:1253) ~[?:1.8.0_222]
	at javax.swing.SwingUtilities.updateComponentTreeUI0(SwingUtilities.java:1253) ~[?:1.8.0_222]
	at javax.swing.SwingUtilities.updateComponentTreeUI0(SwingUtilities.java:1253) ~[?:1.8.0_222]
	at javax.swing.SwingUtilities.updateComponentTreeUI(SwingUtilities.java:1229) ~[?:1.8.0_222]
	at com.github.weisj.darklaf.LafManager.updateLafRecursively(LafManager.java:194) ~[darklaf-core.jar:1.4.0.3-SNAPSHOT]
	at com.github.weisj.darklaf.LafManager.updateLafRecursively(LafManager.java:192) ~[darklaf-core.jar:1.4.0.3-SNAPSHOT]
	at com.github.weisj.darklaf.LafManager.updateLaf(LafManager.java:186) ~[darklaf-core.jar:1.4.0.3-SNAPSHOT]
	at com.github.weisj.darklaf.LafManager.install(LafManager.java:172) ~[darklaf-core.jar:1.4.0.3-SNAPSHOT]
	at com.github.weisj.darklaf.LafManager.installTheme(LafManager.java:140) ~[darklaf-core.jar:1.4.0.3-SNAPSHOT]
	at org.apache.jmeter.gui.action.LookAndFeelCommand.activateLookAndFeel(LookAndFeelCommand.java:204) ~[ApacheJMeter_core.jar:5.3-SNAPSHOT]
	at org.apache.jmeter.gui.action.LookAndFeelCommand.doAction(LookAndFeelCommand.java:225) ~[ApacheJMeter_core.jar:5.3-SNAPSHOT]
	at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:87) ~[ApacheJMeter_core.jar:5.3-SNAPSHOT]
	at org.apache.jmeter.gui.action.ActionRouter.lambda$actionPerformed$0(ActionRouter.java:69) ~[ApacheJMeter_core.jar:5.3-SNAPSHOT]
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) [?:1.8.0_222]
@vlsi
Copy link
Contributor Author

vlsi commented Mar 8, 2020

The fix is to replace comboBox with c (argument)

@weisJ weisJ added the bug Something isn't working label Mar 8, 2020
@weisJ
Copy link
Owner

weisJ commented Mar 8, 2020

Should be fixed now

@vlsi
Copy link
Contributor Author

vlsi commented Mar 8, 2020

Not yet fixed.
I suggest to move comboBox.setBorder(this); to the very end of DarkComboBoxUI constructor.

That is initialize all the fields first, and then call setBorder.

@weisJ
Copy link
Owner

weisJ commented Mar 8, 2020

Yes good catch.

@vlsi
Copy link
Contributor Author

vlsi commented Mar 8, 2020

This is fixed now.

@vlsi vlsi closed this as completed Mar 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants