junichi11 / netbeans-color-codes-preview

Show colors in an editor's sidebar
https://netbeans-vm.apache.org/pluginportal/catalogue/?id=24
Apache License 2.0
32 stars 8 forks source link

java.lang.UnsupportedOperationException #33

Closed junichi11 closed 5 years ago

junichi11 commented 5 years ago

Describe the bug UnsupportedOperationException occurs when I click a rectangle in a less file.

stacktrace ``` java.lang.UnsupportedOperationException at java.util.AbstractMap.put(AbstractMap.java:209) at com.junichi11.netbeans.modules.color.codes.preview.impl.HexCssColorCodesProvider.checkVariables(HexCssColorCodesProvider.java:115) at com.junichi11.netbeans.modules.color.codes.preview.impl.HexCssColorCodesProvider.getColorValues(HexCssColorCodesProvider.java:87) at com.junichi11.netbeans.modules.color.codes.preview.ui.DrawingPanel.getAllColorValues(DrawingPanel.java:277) at com.junichi11.netbeans.modules.color.codes.preview.ui.DrawingPanel.getColorValuesAt(DrawingPanel.java:403) at com.junichi11.netbeans.modules.color.codes.preview.ui.DrawingPanel.onClick(DrawingPanel.java:386) at com.junichi11.netbeans.modules.color.codes.preview.ui.DrawingPanel.processMouseEvent(DrawingPanel.java:377) at java.awt.Component.processEvent(Component.java:6304) at java.awt.Container.processEvent(Container.java:2239) at java.awt.Component.dispatchEventImpl(Component.java:4889) at java.awt.Container.dispatchEventImpl(Container.java:2297) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4544) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476) at java.awt.Container.dispatchEventImpl(Container.java:2283) at java.awt.Window.dispatchEventImpl(Window.java:2746) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84) at java.awt.EventQueue$4.run(EventQueue.java:733) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) at java.awt.EventQueue.dispatchEvent(EventQueue.java:730) at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:136) [catch] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205) 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) ```

Steps to Reproduce

  1. Create a less file with the below code
  2. Click the rectangle
  3. The Exception occurs
@sprd-green     :  hsla(42, 100%, 50%, 1);
@sprd-green2:  #333fff;

.selected {
    border: 3px solid @sprd-green  test @sprd-green2;
}

Expected behavior

Color list is shown

Environments (please complete the following information):