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

Game History TerritoryAttachment.setProduction Bug #1743

Closed
ron-murhammer opened this issue May 23, 2017 · 3 comments
Closed

Game History TerritoryAttachment.setProduction Bug #1743

ron-murhammer opened this issue May 23, 2017 · 3 comments
Labels
Problem A problem, bug, defect - something to fix

Comments

@ron-murhammer
Copy link
Member

ron-murhammer commented May 23, 2017

Source: https://forums.triplea-game.org/topic/73/iron-war-official-thread/73

Description: Errors like the one popping up (“Could not set property:production subject:TerritoryAttachment attached to:Bulgaria with name:territoryAttachment new value:6”)

Problem:
PropertyUtil.set(final String propertyName, final Object value, final Object subject) gets called with TerritoryAttachment.setProduction(String) and an Integer value. There either needs to be a method that accepts an Integer or the value should be passed as a String. Not sure if this is a regression or has always existed (changing territory production isn't a commonly used feature).

Stacktrace:
java.lang.IllegalStateException: Could not set property:production subject:TerritoryAttachment attached to:Bulgaria with name:territoryAttachment new value:6 at games.strategy.util.PropertyUtil.set(PropertyUtil.java:17) at games.strategy.util.PropertyUtil.set(PropertyUtil.java:32) at games.strategy.engine.data.ChangeAttachmentChange.perform(ChangeAttachmentChange.java:75) at games.strategy.engine.data.CompositeChange.perform(CompositeChange.java:49) at games.strategy.engine.data.CompositeChange.perform(CompositeChange.java:49) at games.strategy.engine.data.GameData.performChange(GameData.java:501) at games.strategy.engine.history.History.gotoNode(History.java:122) at games.strategy.triplea.ui.history.HistoryPanel.gotoNode(HistoryPanel.java:262) at games.strategy.triplea.ui.history.HistoryPanel.treeSelectionChanged(HistoryPanel.java:252) at games.strategy.triplea.ui.history.HistoryPanel.lambda$2(HistoryPanel.java:173) at javax.swing.JTree.fireValueChanged(JTree.java:2927) at javax.swing.JTree$TreeSelectionRedirector.valueChanged(JTree.java:3391) at javax.swing.tree.DefaultTreeSelectionModel.fireValueChanged(DefaultTreeSelectionModel.java:635) at javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(DefaultTreeSelectionModel.java:1093) at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPaths(DefaultTreeSelectionModel.java:294) at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPath(DefaultTreeSelectionModel.java:188) at javax.swing.JTree.setSelectionPath(JTree.java:1634) at javax.swing.plaf.basic.BasicTreeUI.selectPathForEvent(BasicTreeUI.java:2393) at javax.swing.plaf.basic.BasicTreeUI$Handler.handleSelection(BasicTreeUI.java:3609) at javax.swing.plaf.basic.BasicTreeUI$Handler.mousePressed(BasicTreeUI.java:3548) at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:279) at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:279) at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:279) at java.awt.Component.processMouseEvent(Component.java:6532) at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) at java.awt.Component.processEvent(Component.java:6300) at java.awt.Container.processEvent(Container.java:2236) at java.awt.Component.dispatchEventImpl(Component.java:4891) at java.awt.Container.dispatchEventImpl(Container.java:2294) at java.awt.Component.dispatchEvent(Component.java:4713) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4522) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466) at java.awt.Container.dispatchEventImpl(Container.java:2280) at java.awt.Window.dispatchEventImpl(Window.java:2750) at java.awt.Component.dispatchEvent(Component.java:4713) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758) 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:76) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.awt.EventQueue$4.run(EventQueue.java:729) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:728) at games.strategy.engine.framework.GameRunner$1.dispatchEvent(GameRunner.java:354) 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) Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@1a18a73 at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at games.strategy.util.PropertyUtil.set(PropertyUtil.java:15) ... 54 more

@ron-murhammer ron-murhammer added the Problem A problem, bug, defect - something to fix label May 23, 2017
@FrostionAAA
Copy link
Contributor

Yes, I see this error occurring in Iron War. This is how to quickly reproduce it:

  1. Load map Iron War v0.1.6 (This is the latest version.)
  2. Set map option “Balkan states are German” true.
  3. Start a local game.
  4. Click yourself through the German steps to the Actions and Operations or later (By this time the Balkan land territories’ PU values have changed by triggers.)
  5. Go to “Show History” and click on the top German steps.
    Error pops up.

@ron-murhammer
Copy link
Member Author

@FrostionAAA Can you test with the latest build to make sure you don't get the error any more?

@FrostionAAA
Copy link
Contributor

TripleA_1.9.0.0.4342 seems to work :) nice! I can look through the history with no errors and the PU markers change when looking at the different steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Problem A problem, bug, defect - something to fix
Projects
None yet
Development

No branches or pull requests

2 participants