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

Unable to load Material Theme Settings Menu #552

Closed
arlindohall opened this issue Dec 22, 2017 · 4 comments
Closed

Unable to load Material Theme Settings Menu #552

arlindohall opened this issue Dec 22, 2017 · 4 comments

Comments

@arlindohall
Copy link
Contributor

Summary

When opening IntelliJ IDEA > Preferences > Material Theme, the view never loads and causes an exception. This failure also seems to affect the plugin generally, and even IntelliJ behavior. I was able to get IntelliJ's view into a pretty weird state by changing Appearance > UI Options > Theme and Editor > Color Scheme > Scheme after this failure happened.

Expected behavior

Open menu to change material theme preferences

Actual behavior

"Loading" view with spinner shown indefinitely, IntelliJ logs an exception.

Steps to reproduce (if needed)

It's unclear what caused this behavior as I am new to using the plugin.

  1. Install the plugin
  2. Open Preferences
  3. Edit the options inside (believe the changes started when I selected high contrast mode, but I'm not sure)

Unfortunately I don't remember exactly which preferences I changed, since I'm not familiar with them and can no longer view them.

screen shot 2017-12-22 at 9 54 12 am

screen shot 2017-12-22 at 9 54 53 am

screen shot 2017-12-22 at 10 02 55 am

Environment

IntelliJ IDEA 2017.3.1 (Community Edition)
Build #IC-173.3942.27, built on December 11, 2017
JRE: 1.8.0_152-release-1024-b8 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.12.6

Stack Traces:

cannot create configurable component: (minimum <= value <= maximum) is false
java.lang.IllegalArgumentException: (minimum <= value <= maximum) is false
	at javax.swing.SpinnerNumberModel.<init>(SpinnerNumberModel.java:125)
	at javax.swing.SpinnerNumberModel.<init>(SpinnerNumberModel.java:147)
	at com.chrisrm.idea.config.ui.MTForm.init(MTForm.java:109)
	at com.chrisrm.idea.config.MTConfigurableBase.lambda$initComponent$0(MTConfigurableBase.java:159)
	at com.intellij.util.ui.UIUtil$13.run(UIUtil.java:2810)
	at com.intellij.util.ui.UIUtil.invokeAndWaitIfNeeded(UIUtil.java:2781)
	at com.intellij.util.ui.UIUtil.invokeAndWaitIfNeeded(UIUtil.java:2807)
	at com.chrisrm.idea.config.MTConfigurableBase.initComponent(MTConfigurableBase.java:157)
	at com.chrisrm.idea.config.MTConfigurableBase.createComponent(MTConfigurableBase.java:98)
	at com.intellij.openapi.options.ex.ConfigurableWrapper.createComponent(ConfigurableWrapper.java:164)
	at com.intellij.openapi.options.ex.ConfigurableCardPanel.lambda$createConfigurableComponent$0(ConfigurableCardPanel.java:73)
	at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:47)
	at com.intellij.openapi.options.ex.ConfigurableCardPanel.createConfigurableComponent(ConfigurableCardPanel.java:69)
	at com.intellij.openapi.options.ex.ConfigurableCardPanel.create(ConfigurableCardPanel.java:55)
	at com.intellij.openapi.options.newEditor.ConfigurableEditor$1.create(ConfigurableEditor.java:70)
	at com.intellij.openapi.options.newEditor.ConfigurableEditor$1.create(ConfigurableEditor.java:67)
	at com.intellij.ui.CardLayoutPanel.createValue(CardLayoutPanel.java:88)
	at com.intellij.ui.CardLayoutPanel.select(CardLayoutPanel.java:116)
	at com.intellij.ui.CardLayoutPanel.lambda$null$0(CardLayoutPanel.java:132)
	at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:315)
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:424)
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:407)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762)
	at java.awt.EventQueue.access$500(EventQueue.java:98)
	at java.awt.EventQueue$3.run(EventQueue.java:715)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:732)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:822)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:650)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:366)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109)
	at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
	at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)
	at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
	at java.awt.Dialog.show(Dialog.java:1084)
	at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:734)
	at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:456)
	at com.intellij.openapi.ui.DialogWrapper.invokeShow(DialogWrapper.java:1696)
	at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1645)
	at com.intellij.openapi.options.newEditor.SettingsDialog.lambda$show$0(SettingsDialog.java:83)
	at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:88)
	at com.intellij.openapi.application.TransactionGuardImpl.submitTransactionAndWait(TransactionGuardImpl.java:153)
	at com.intellij.openapi.options.newEditor.SettingsDialog.show(SettingsDialog.java:83)
	at com.intellij.ide.actions.ShowSettingsUtilImpl.showSettingsDialog(ShowSettingsUtilImpl.java:97)
	at com.intellij.ide.actions.ShowSettingsAction.perform(ShowSettingsAction.java:63)
	at com.intellij.ide.MacOSApplicationProvider$Worker.lambda$null$1(MacOSApplicationProvider.java:118)
	at com.intellij.ide.MacOSApplicationProvider$Worker.lambda$submit$6(MacOSApplicationProvider.java:212)
	at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:88)
	at com.intellij.openapi.application.TransactionGuardImpl.lambda$pollQueueLater$0(TransactionGuardImpl.java:74)
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:424)
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:407)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762)
	at java.awt.EventQueue.access$500(EventQueue.java:98)
	at java.awt.EventQueue$3.run(EventQueue.java:715)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:732)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:822)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:650)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:366)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
null
java.lang.NullPointerException
  at com.chrisrm.idea.config.MTConfigurable.checkModified(MTConfigurable.java:146)
  at com.chrisrm.idea.config.MTConfigurable.checkModified(MTConfigurable.java:41)
  at com.chrisrm.idea.config.MTConfigurableBase.isModified(MTConfigurableBase.java:86)
  at com.intellij.openapi.options.ex.ConfigurableWrapper.isModified(ConfigurableWrapper.java:169)
  at com.intellij.openapi.options.newEditor.SettingsEditor.checkModifiedInternal(SettingsEditor.java:391)
  at com.intellij.openapi.options.newEditor.SettingsEditor.checkModifiedForItem(SettingsEditor.java:385)
  at com.intellij.openapi.options.newEditor.SettingsEditor.checkModified(SettingsEditor.java:373)
  at com.intellij.openapi.options.newEditor.SettingsEditor$5.updateCurrent(SettingsEditor.java:194)
  at com.intellij.openapi.options.newEditor.ConfigurableEditor.updateIfCurrent(ConfigurableEditor.java:238)
  at com.intellij.openapi.options.newEditor.ConfigurableEditor$4.run(ConfigurableEditor.java:195)
  at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:337)
  at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:327)
  at com.intellij.util.ui.update.MergingUpdateQueue.lambda$flush$1(MergingUpdateQueue.java:277)
  at com.intellij.util.ui.UIUtil.invokeAndWaitIfNeeded(UIUtil.java:2781)
  at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:288)
  at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:246)
  at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:246)
  at com.intellij.util.Alarm$Request.runSafely(Alarm.java:417)
  at com.intellij.util.Alarm$Request.access$700(Alarm.java:344)
  at com.intellij.util.Alarm$Request$1.run(Alarm.java:384)
  at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:315)
  at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:424)
  at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:407)
  at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
  at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762)
  at java.awt.EventQueue.access$500(EventQueue.java:98)
  at java.awt.EventQueue$3.run(EventQueue.java:715)
  at java.awt.EventQueue$3.run(EventQueue.java:709)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
  at java.awt.EventQueue.dispatchEvent(EventQueue.java:732)
  at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:822)
  at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:650)
  at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:366)
  at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
  at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
  at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109)
  at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
  at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)
  at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
  at java.awt.Dialog.show(Dialog.java:1084)
  at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:734)
  at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:456)
  at com.intellij.openapi.ui.DialogWrapper.invokeShow(DialogWrapper.java:1696)
  at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1645)
  at com.intellij.openapi.options.newEditor.SettingsDialog.lambda$show$0(SettingsDialog.java:83)
  at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:88)
  at com.intellij.openapi.application.TransactionGuardImpl.submitTransactionAndWait(TransactionGuardImpl.java:153)
  at com.intellij.openapi.options.newEditor.SettingsDialog.show(SettingsDialog.java:83)
  at com.intellij.ide.actions.ShowSettingsUtilImpl.showSettingsDialog(ShowSettingsUtilImpl.java:97)
  at com.intellij.ide.actions.ShowSettingsAction.perform(ShowSettingsAction.java:63)
  at com.intellij.ide.MacOSApplicationProvider$Worker.lambda$null$1(MacOSApplicationProvider.java:118)
  at com.intellij.ide.MacOSApplicationProvider$Worker.lambda$submit$6(MacOSApplicationProvider.java:212)
  at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:88)
  at com.intellij.openapi.application.TransactionGuardImpl.lambda$pollQueueLater$0(TransactionGuardImpl.java:74)
  at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:424)
  at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:407)
  at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
  at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762)
  at java.awt.EventQueue.access$500(EventQueue.java:98)
  at java.awt.EventQueue$3.run(EventQueue.java:715)
  at java.awt.EventQueue$3.run(EventQueue.java:709)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
  at java.awt.EventQueue.dispatchEvent(EventQueue.java:732)
  at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:822)
  at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:650)
  at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:366)
  at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
  at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
  at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
  at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
  at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
  at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
@arlindohall
Copy link
Contributor Author

Looking at MTForm.java, it seems that adding a check to lines 107, 109, 111, and 113 might fix this. It looks like the failure was caused by config.getTabsHeight() returning a value outside the range given by minimum=18 and maximum=60

@arlindohall
Copy link
Contributor Author

@mallowigi
Copy link
Collaborator

Nice, but does it fix the issue where the values in the config are 0? Because this is what causes the issue, that for some reason the config changes and the value is set to 0 when it should be between the bounds.

@arlindohall
Copy link
Contributor Author

arlindohall commented Dec 23, 2017

My understanding was that the minimum/maximum get passed in and a bound check happens. The change was just guaranteeing the value passed in is between the minimum and maximum.

    public SpinnerNumberModel(int value, int minimum, int maximum, int stepSize) {
        this(Integer.valueOf(value), Integer.valueOf(minimum), Integer.valueOf(maximum), Integer.valueOf(stepSize));
    }

This calls the next constructor, which makes sure that value is between minimum and maximum.

    public SpinnerNumberModel(Number value, Comparable minimum, Comparable maximum, Number stepSize) {
        if ((value == null) || (stepSize == null)) {
            throw new IllegalArgumentException("value and stepSize must be non-null");
        }
        if (!(((minimum == null) || (minimum.compareTo(value) <= 0)) &&
              ((maximum == null) || (maximum.compareTo(value) >= 0)))) {
            throw new IllegalArgumentException("(minimum <= value <= maximum) is false");
        }
        ...
    }

So the code checks if value < minimum or value > maximum. If the value is 0, then the SpinnerNumberModel will still accept the value as valid, even though this may not be interpretable by IntelliJ.

It looks like it should be on IntelliJ to interpret that value, while this segment of code is just responsible for making sure that the minimum <= value <= maximum invariant holds true, which is taken care of by the new valueInRange(int) helper.

Further, the value for three of these parameters will be enforced to be greater than zero, and customTreeIndent will be greater than or equal to zero.

Thanks for taking a look at this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants