2024 Cljure 状态调查!中分享您的想法。

欢迎!有关如何使用本网站的更多信息,请参阅关于页面。

0
Clojure

在有些平台的 Clojure 1.6.0 版本上(详情见下方),如果您创建一个对象,例如:

(def nst (vec '((3 7 22) 99 (123 18 225 437))))

然后检查该对象表示的树结构

(inspect-tree nst)

大多数使用键盘导航的过程都进行得很顺利。然而,当您将鼠标光标指向一个单独的值 - 例如 99 或 437 - 并按下右箭头键时,会出现错误

`
异常:线程 "AWT-EventQueue-0" 抛出 java.lang.UnsupportedOperationException:在该类型上不支持 count

at clojure.lang.RT.countFrom(RT.java:556)
at clojure.lang.RT.count(RT.java:530)
at clojure.inspector$fn__6907.invoke(inspector.clj:40)
at clojure.lang.MultiFn.invoke(MultiFn.java:227)
at clojure.inspector$tree_model$fn__6929.invoke(inspector.clj:63)
at clojure.inspector.proxy$java.lang.Object$TreeModel$775afa87.getChildCount(Unknown Source)
at javax.swing.plaf.basic.BasicTreeUI$Actions.traverse(BasicTreeUI.java:4395)
at javax.swing.plaf.basic.BasicTreeUI$Actions.actionPerformed(BasicTreeUI.java:4052)
at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1662)
at javax.swing.JComponent.processKeyBinding(JComponent.java:2878)
at javax.swing.JComponent.processKeyBindings(JComponent.java:2925)
at javax.swing.JComponent.processKeyEvent(JComponent.java:2841)
at java.awt.Component.processEvent(Component.java:6282)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1895)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:762)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1027)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:899)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:727)
at java.awt.Component.dispatchEventImpl(Component.java:4731)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:708)
at java.awt.EventQueue$4.run(EventQueue.java:706)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

`

已重现该错误的环境
+ Windows 7 企业版,SP1,Oracle JDK 1.7.0_51,Clojure 1.6.0
+ Ubuntu Linux 14.04.1,Oracle JDK 1.7.0_65,Clojure 1.6.0

相同的操作顺序未在这些环境中引发异常
+ Mac OS X 10.8.5,Oracle JDK 1.7.0_51,Clojure 1.6.0

3 答案

0

评论者:jafingerhut

补丁 clj-1502-v1.patch 避免了所报道情况下的异常。在 OS X、Linux 和补丁注释中提到的 Windows 7 版本上手动测试。我怀疑编写一个自动测试这方面的努力不值得。

0

评论者:cljexplorer

谢谢,Andy

  • DC
0
参考: https://clojure.atlassian.net/browse/CLJ-1502 (由 alex+import 报告)
...