daily pastebin goal
38%
SHARE
TWEET

Untitled

a guest Apr 16th, 2018 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // setProperty called by: setProperty("Click", new MouseClickPos(1,2,3);
  2.  
  3.  
  4.   public void setProperty(String property, Object newValue) {        
  5.         for (AbstractModel m: models) {
  6.             try {
  7.                 Method method = m.getClass().getMethod("set" + property, newValue.getClass());  
  8.                 method.invoke(newValue);
  9.             }
  10.             catch (Exception e) {
  11.             e.printStackTrace();
  12.             }
  13.         }
  14.     }
  15.  
  16. ===================================
  17.  // Method what I'm trying to call unsuccessfully
  18.     public void setClick(MouseClickPos pos) {
  19.         click(pos.getX(), pos.getY(), pos.getButton());
  20.        
  21.     }
  22.  
  23.  
  24. // StackTrace
  25.  
  26. java.lang.IllegalArgumentException: object is not an instance of declaring class
  27.     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  28.     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  29.     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  30.     at java.lang.reflect.Method.invoke(Method.java:597)
  31.     at info.jagus.minesweeper.controller.AbstractController.setProperty(AbstractController.java:80)
  32.     at info.jagus.minesweeper.controller.DefaultController.cellClicked(DefaultController.java:36)
  33.     at info.jagus.minesweeper.view.MineFieldPanel.processClick(MineFieldPanel.java:70)
  34.     at info.jagus.minesweeper.view.MineFieldPanel.access$000(MineFieldPanel.java:28)
  35.     at info.jagus.minesweeper.view.MineFieldPanel$1.mouseClicked(MineFieldPanel.java:56)
  36.     at java.awt.Component.processMouseEvent(Component.java:6291)
  37.     at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
  38.     at java.awt.Component.processEvent(Component.java:6053)
  39.     at java.awt.Container.processEvent(Container.java:2041)
  40.     at java.awt.Component.dispatchEventImpl(Component.java:4651)
  41.     at java.awt.Container.dispatchEventImpl(Container.java:2099)
  42.     at java.awt.Component.dispatchEvent(Component.java:4481)
  43.     at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
  44.     at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4247)
  45.     at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
  46.     at java.awt.Container.dispatchEventImpl(Container.java:2085)
  47.     at java.awt.Window.dispatchEventImpl(Window.java:2478)
  48.     at java.awt.Component.dispatchEvent(Component.java:4481)
  49.     at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
  50.     at java.awt.EventQueue.access$000(EventQueue.java:84)
  51.     at java.awt.EventQueue$1.run(EventQueue.java:602)
  52.     at java.awt.EventQueue$1.run(EventQueue.java:600)
  53.     at java.security.AccessController.doPrivileged(Native Method)
  54.     at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
  55.     at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
  56.     at java.awt.EventQueue$2.run(EventQueue.java:616)
  57.     at java.awt.EventQueue$2.run(EventQueue.java:614)
  58.     at java.security.AccessController.doPrivileged(Native Method)
  59.     at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
  60.     at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
  61.     at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
  62.     at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
  63.     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
  64.     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
  65.     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
  66.     at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top