zen0wu / topcoder-greed

greedy editor for topcoder arena
Apache License 2.0
229 stars 45 forks source link

NullPointerException in RC #139

Closed Predelnik closed 10 years ago

Predelnik commented 10 years ago

When I first started Greed RC and went to some problem in practice room it's written "Hello again" and that was all. So, then I press "Regenerate code" there was a message error: null. Enabling logging gave me this:

[Feb 19 09:59:57] [greed.Greed.generateCode@L152] Greed[ERROR]: Set problem error, with an java.lang.NullPointerException [Feb 19 09:59:57] [greed.Greed.generateCode@L152] greed.Greed.generateCode(Greed.java:144) [Feb 19 09:59:57] [greed.Greed.generateCode@L152] greed.ui.GreedEditorPanel.actionPerformed(GreedEditorPanel.java:102) [Feb 19 09:59:57] [greed.Greed.generateCode@L152] javax.swing.AbstractButton.fireActionPerformed(Unknown Source) [Feb 19 09:59:57] [greed.Greed.generateCode@L152] javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) [Feb 19 09:59:57] [greed.Greed.generateCode@L152] javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) [Feb 19 09:59:57] [greed.Greed.generateCode@L152] javax.swing.DefaultButtonModel.setPressed(Unknown Source) [Feb 19 09:59:57] [greed.Greed.generateCode@L152] javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) [Feb 19 09:59:57] [greed.Greed.generateCode@L152] java.awt.Component.processMouseEvent(Unknown Source) [Feb 19 09:59:57] [greed.Greed.generateCode@L152] javax.swing.JComponent.processMouseEvent(Unknown Source) [Feb 19 09:59:57] [greed.Greed.generateCode@L152] java.awt.Component.processEvent(Unknown Source) [Feb 19 09:59:57] [greed.Greed.generateCode@L152] and 28 more ...

Even though looking at the source code I didn't quite get how this could happen. After this I tried beta version and on the first glance it actually works fine.

vexorian commented 10 years ago

Are you using a custom greed.conf ? Try renaming it temporarily and test. It could be one of the features that broke old config.

Predelnik commented 10 years ago

No, initially I was using it with no config at all (I just tried to use the program for the first time), later I just added simple greed.logging.logLevel = DEBUG config to see what the error is.

vexorian commented 10 years ago

This happened to me in a problem when it wasn't happening. I am quite sure I didn't change my configuration or Greed. What I noticed is that there was a greed update.

I have a feeling the admins may have changed how the problem limits info work. I will have to check it out.

vexorian commented 10 years ago

Sorry, I think I should rewrite that whole comment because I made plenty of mistakes.

Predelnik commented 10 years ago

Thank you very much for checking it out, it's strange though that previous (beta) version works fine

vexorian commented 10 years ago

That hints me that the issue is with the memory/time limits detection I added after the beta was released.

vexorian commented 10 years ago

It appears the null pointer is caused by something else:

Error invoking method setProblemComponent([com.topcoder.client.contestant.impl.ProblemComponentModelImpl@7755beb9, com.topcoder.shared.language.CPPLanguage@3, com.topcoder.client.render.ProblemComponentRenderer@1e5ca0e4])
vexorian commented 10 years ago

It appears TopCoder removed the method that exposed the problem's time limit. Possibly a regression from the arena maintainers.

Predelnik commented 10 years ago

Hmm changes in API like this are quite unfortunate, thank you very much for fast fix.

zen0wu commented 10 years ago

Here is the Updated jar. Please try it out and report back. Thanks!