oharaandrew314/TinkerTime

Null Pointer Exception upon any zip file manual add

Closed this issue · 6 comments

maxix commented

Hi Andrew,

when adding any zipfile (in this example i use Toolbar-1.7.9.zip from http://blizzy.de/toolbar/download.html) i get a popup error "Null Pointer Exception" :
tinker
This particular zip is compatible with TinkerTime 1.4.5, so does others.

Here is the standard output :

z$ java -jar TinkerTime.jar
juil. 20, 2015 10:32:28 PM org.flywaydb.core.internal.util.VersionPrinter printVersion
INFOS: Flyway 3.2.1 by Boxfuse
juil. 20, 2015 10:32:29 PM org.flywaydb.core.internal.dbsupport.DbSupportFactory createDbSupport
INFOS: Database: jdbc:h2:file:/home/maxix/Documents/Tinker Time/TinkerTime-db (H2 1.4)
juil. 20, 2015 10:32:29 PM org.flywaydb.core.internal.command.DbValidate validate
INFOS: Validated 1 migration (execution time 00:00.026s)
juil. 20, 2015 10:32:29 PM org.flywaydb.core.internal.command.DbMigrate migrate
INFOS: Current version of schema "PUBLIC": 1
juil. 20, 2015 10:32:29 PM org.flywaydb.core.internal.command.DbMigrate logSummary
INFOS: Schema "PUBLIC" is up to date. No migration necessary.
2015-07-20 22:32:29,205 [DEBUG] DaoManager created dao for class class io.andrewohara.tinkertime.models.Installation with reflection
2015-07-20 22:32:29,208 [DEBUG] DaoManager created dao for class class io.andrewohara.tinkertime.models.mod.Mod with reflection
2015-07-20 22:32:29,209 [DEBUG] DaoManager created dao for class class io.andrewohara.tinkertime.models.ModFile with reflection
2015-07-20 22:32:29,209 [DEBUG] DaoManager created dao for class class io.andrewohara.tinkertime.models.ConfigData with reflection
2015-07-20 22:32:29,210 [DEBUG] StatementBuilder built statement SELECT * FROM config
2015-07-20 22:32:29,220 [DEBUG] JdbcConnectionSource opened connection to jdbc:h2:file:/home/maxix/Documents/Tinker Time/TinkerTime-db got #1347969073
2015-07-20 22:32:29,220 [DEBUG] BaseMappedStatement prepared statement 'SELECT * FROM config ' with 0 args
2015-07-20 22:32:29,222 [DEBUG] SelectIterator starting iterator @1904115252 for 'SELECT * FROM config '
2015-07-20 22:32:29,225 [DEBUG] StatementBuilder built statement SELECT * FROM mods WHERE installation_id = ?
2015-07-20 22:32:29,226 [DEBUG] BaseMappedStatement prepared statement 'SELECT * FROM mods WHERE installation_id = ? ' with 1 args
2015-07-20 22:32:29,226 [DEBUG] SelectIterator starting iterator @1611133895 for 'SELECT * FROM mods WHERE installation_id = ? '
2015-07-20 22:32:29,232 [DEBUG] SelectIterator closed iterator @1611133895 after 1 rows
2015-07-20 22:32:29,232 [DEBUG] StatementExecutor query of 'SELECT * FROM mods WHERE installation_id = ? ' returned 1 results
2015-07-20 22:32:29,232 [DEBUG] BaseMappedStatement query-for-id using 'SELECT * FROM installations WHERE id = ?' and 1 args, got 1 result
2015-07-20 22:32:29,232 [DEBUG] SelectIterator closed iterator @1904115252 after 1 rows
2015-07-20 22:32:29,232 [DEBUG] StatementExecutor query of 'SELECT * FROM config ' returned 1 results
2015-07-20 22:32:29,425 [DEBUG] BaseMappedStatement update data with statement 'UPDATE config SET checkForAppUpdatesOnStartup = ?, checkForModUpdatesOnStartup = ?, selectedInstallation_id = ?, launchArguments = ? WHERE id = ?' and 5 args, changed 1 rows
2015-07-20 22:32:29,500 [DEBUG] StatementBuilder built statement SELECT * FROM modFiles WHERE mod_id = ?
2015-07-20 22:32:29,500 [DEBUG] BaseMappedStatement prepared statement 'SELECT * FROM modFiles WHERE mod_id = ? ' with 1 args
2015-07-20 22:32:29,501 [DEBUG] SelectIterator starting iterator @82357797 for 'SELECT * FROM modFiles WHERE mod_id = ? '
2015-07-20 22:32:29,501 [DEBUG] SelectIterator closed iterator @82357797 after 1 rows
java.lang.NullPointerException
at io.andrewohara.tinkertime.models.mod.Mod.equals(Mod.java:275)
at java.util.ArrayList.indexOf(ArrayList.java:298)
at java.util.ArrayList.contains(ArrayList.java:281)
at com.j256.ormlite.dao.EagerForeignCollection.contains(EagerForeignCollection.java:180)
at io.andrewohara.tinkertime.models.Installation.addMod(Installation.java:56)
at io.andrewohara.tinkertime.models.mod.Mod.(Mod.java:82)
at io.andrewohara.tinkertime.models.mod.Mod.(Mod.java:76)
at io.andrewohara.tinkertime.controllers.ModLoader.newLocalMod(ModLoader.java:54)
at io.andrewohara.tinkertime.controllers.ModManager.addModZip(ModManager.java:83)
at io.andrewohara.tinkertime.views.Actions$AddModZip.call(Actions.java:358)
at io.andrewohara.tinkertime.views.Actions$TinkerAction.actionPerformed(Actions.java:58)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
at java.awt.Component.processMouseEvent(Component.java:6516)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3312)
at java.awt.Component.processEvent(Component.java:6281)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4872)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4698)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4698)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:747)
at java.awt.EventQueue.access$300(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:706)
at java.awt.EventQueue$3.run(EventQueue.java:704)
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:720)
at java.awt.EventQueue$4.run(EventQueue.java:718)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:717)
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)

maxix commented

No one is experiencing the same bug with zip files on TT2.0.0 linux? It's kind of a show stopper!

Don't worry, I'll get on this soon. I've been a little busy.

maxix commented

Thanks Andrew. As you noticed it, my lazyness prevents me to dig in the code, but as i waited a bit to switch to TT2.0.0 i'm astonished no one encounters the problem, like if the bug came from my comp. Did you setup that download counter? ;)

Linux has been giving me a real headache with this release, but I thought that my CI has caught them all for me.

Do you mean CountDownloads.java? Yeah, I wrote it, since I wanted a way to get the download count from both KS and Github easily.

Hey @maxix, I've fixed all the issues you reported, and have released an update.

maxix commented

Aaand it works.

Thanks :)