[PF] NPE when attempting to add one level of gunslinger from UC

Description

I load the Pathfinder core book, advanced book, and new UC data set. I select a race and add it. Then I select Gunslinger class, and attempt to add one level.

Nothing happens, and I get this log error:
----------------- 09:59:53.500 INFO AWT-EventQueue-1 CharacterFacadeImpl:687 Unnamed 1: Adding level 1 in class Gunslinger
09:59:53.530 SEVERE AWT-EventQueue-1 PCGen_Frame1:2939 Uncaught error - ignoring
java.lang.NullPointerException
at pcgen.core.PlayerCharacter.processAbilityList(PlayerCharacter.java:10024)
at pcgen.core.PlayerCharacter.processAbilityListsOnAdd(PlayerCharacter.java:10005)
at pcgen.core.PlayerCharacter.processAddition(PlayerCharacter.java:11282)
at pcgen.cdom.facet.ObjectAdditionFacet.dataAdded(ObjectAdditionFacet.java:58)
at pcgen.cdom.facet.AbstractDataFacet.fireDataFacetChangeEvent(AbstractDataFacet.java:241)
at pcgen.cdom.facet.AbstractDataFacet.fireDataFacetChangeEvent(AbstractDataFacet.java:187)
at pcgen.cdom.facet.AbstractSourcedListFacet.add(AbstractSourcedListFacet.java:94)
at pcgen.cdom.facet.CDOMObjectConsolidationFacet.add(CDOMObjectConsolidationFacet.java:68)
at pcgen.cdom.facet.CDOMObjectConsolidationFacet.dataAdded(CDOMObjectConsolidationFacet.java:134)
at pcgen.cdom.facet.AbstractDataFacet.fireDataFacetChangeEvent(AbstractDataFacet.java:241)
at pcgen.cdom.facet.AbstractDataFacet.fireDataFacetChangeEvent(AbstractDataFacet.java:187)
at pcgen.cdom.facet.AbstractSourcedListFacet.add(AbstractSourcedListFacet.java:94)
at pcgen.cdom.facet.CharacterConsolidationFacet.dataAdded(CharacterConsolidationFacet.java:62)
at pcgen.cdom.facet.AbstractDataFacet.fireDataFacetChangeEvent(AbstractDataFacet.java:241)
at pcgen.cdom.facet.AbstractDataFacet.fireDataFacetChangeEvent(AbstractDataFacet.java:187)
at pcgen.cdom.facet.AbstractSourcedListFacet.add(AbstractSourcedListFacet.java:94)
at pcgen.cdom.facet.ClassLevelFacet.update(ClassLevelFacet.java:61)
at pcgen.cdom.facet.ClassLevelFacet.levelChanged(ClassLevelFacet.java:86)
at pcgen.cdom.facet.ClassFacet$ClassLevelChangeSupport.fireClassLevelChangeEvent(ClassFacet.java:812)
at pcgen.cdom.facet.ClassFacet.setLevel(ClassFacet.java:331)
at pcgen.core.PlayerCharacter.setLevelWithoutConsequence(PlayerCharacter.java:11195)
at pcgen.core.PCClass.addLevel(PCClass.java:1044)
at pcgen.core.PlayerCharacter.incrementClassLevel(PlayerCharacter.java:8229)
at pcgen.core.PlayerCharacter.incrementClassLevel(PlayerCharacter.java:8118)
at pcgen.core.PlayerCharacter.incrementClassLevel(PlayerCharacter.java:6453)
at pcgen.gui2.facade.CharacterFacadeImpl.addCharacterLevels(CharacterFacadeImpl.java:690)
at pcgen.gui2.tabs.SummaryInfoTab$AddLevelsAction.actionPerformed(SummaryInfoTab.java:1399)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at pcgen.gui.PCGen_Frame1$WaitCursorEventQueue.dispatchEvent(PCGen_Frame1.java:2934)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
-----------------

If I try adding a level again, nothing happens and I get a dramatically more
telling log error:

----------------- 10:00:29.932 INFO AWT-EventQueue-1 CharacterFacadeImpl:687 Unnamed 1: Adding level 1 in class Gunslinger
10:00:30.613 SEVERE AWT-EventQueue-1 PCGen_Frame1:2939 Uncaught error - ignoring
java.lang.IllegalArgumentException: Level cannot be negative in getClassLevel
at pcgen.cdom.facet.ClassFacet$ClassInfo.getClassLevel(ClassFacet.java:522)
at pcgen.cdom.facet.ClassFacet.getClassLevel(ClassFacet.java:143)
at pcgen.core.PlayerCharacter.getActiveClassLevel(PlayerCharacter.java:11161)
at pcgen.gui2.facade.CharacterLevelsFacadeImpl.getClassLevel(CharacterLevelsFacadeImpl.java:208)
at pcgen.gui2.facade.CharacterLevelsFacadeImpl.getHPRolled(CharacterLevelsFacadeImpl.java:241)
at pcgen.gui2.facade.CharacterLevelsFacadeImpl.getHPGained(CharacterLevelsFacadeImpl.java:222)
at pcgen.gui2.PCGenFrame.showLevelUpInfo(PCGenFrame.java:1337)
at pcgen.gui2.facade.CharacterFacadeImpl.addCharacterLevels(CharacterFacadeImpl.java:707)
at pcgen.gui2.tabs.SummaryInfoTab$AddLevelsAction.actionPerformed(SummaryInfoTab.java:1399)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at pcgen.gui.PCGen_Frame1$WaitCursorEventQueue.dispatchEvent(PCGen_Frame1.java:2934)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

10:00:31.54 SEVERE AWT-EventQueue-1 PCGen_Frame1:2939 Uncaught error - ignoring
java.lang.IllegalArgumentException: Level cannot be negative in getClassLevel
at pcgen.cdom.facet.ClassFacet$ClassInfo.getClassLevel(ClassFacet.java:522)
at pcgen.cdom.facet.ClassFacet.getClassLevel(ClassFacet.java:143)
at pcgen.core.PlayerCharacter.getActiveClassLevel(PlayerCharacter.java:11161)
at pcgen.gui2.facade.CharacterLevelsFacadeImpl.getClassLevel(CharacterLevelsFacadeImpl.java:208)
at pcgen.gui2.facade.CharacterLevelsFacadeImpl.getHPRolled(CharacterLevelsFacadeImpl.java:241)
at pcgen.gui2.facade.CharacterLevelsFacadeImpl.getHPGained(CharacterLevelsFacadeImpl.java:222)
at pcgen.gui2.tabs.summary.ClassLevelTableModel.getValueAt(ClassLevelTableModel.java:174)
at javax.swing.JTable.getValueAt(Unknown Source)
at javax.swing.JTable.prepareRenderer(Unknown Source)
at javax.swing.plaf.synth.SynthTableUI.paintCell(Unknown Source)
at javax.swing.plaf.synth.SynthTableUI.paintCells(Unknown Source)
at javax.swing.plaf.synth.SynthTableUI.paint(Unknown Source)
at javax.swing.plaf.synth.SynthTableUI.update(Unknown Source)
at javax.swing.JComponent.paintComponent(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JViewport.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintToOffscreen(Unknown Source)
at javax.swing.BufferStrategyPaintManager.paint(Unknown Source)
at javax.swing.RepaintManager.paint(Unknown Source)
at javax.swing.JComponent._paintImmediately(Unknown Source)
at javax.swing.JComponent.paintImmediately(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at pcgen.gui.PCGen_Frame1$WaitCursorEventQueue.dispatchEvent(PCGen_Frame1.java:2934)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

-----------------

And though it doesn't show it on the main Summary screen, the class tab shows the class as added. However, if I then click back on the Summary tab, the UI glitches and shows either only blocks of the tab content, or it doesn't display anything.

Environment

Windows XP, JRE 1.6

Activity

Show:
James Dempsey
September 7, 2012, 3:26 PM

Yes that last one about Ability Category FEAT Firearms will be the one that triggered this issue. I assume you'll sort that out as part of the regular UC work.

Brad Kester
September 7, 2012, 3:01 PM

Here are the lines from the log which include the "unconstructed reference", which specifically refer to pfuc_classes.lst:

16:47:59.473 SEVERE Thread-7 CDOMFactory:124 Unconstructed Reference: Skill Craft
16:47:59.473 SEVERE Thread-7 TrackingReferenceContext:143 Was used in file:/D:/Games/pathfinder/PCgen/notForDist/paizo/pathfinder_rpg/ultimate_combat/pfuc_classes.lst in tokens: [plugin.lsttokens.pcclass.CskillToken]

16:47:59.473 SEVERE Thread-7 CDOMFactory:124 Unconstructed Reference: Skill Profession
16:47:59.473 SEVERE Thread-7 TrackingReferenceContext:143 Was used in file:/D:/Games/pathfinder/PCgen/notForDist/paizo/pathfinder_rpg/ultimate_combat/pfuc_classes.lst in tokens: [plugin.lsttokens.pcclass.CskillToken]

16:48:00.424 SEVERE Thread-7 AbilityCategory:654 Unconstructed Reference: Ability Category FEAT Firearms
16:48:00.424 SEVERE Thread-7 TrackingReferenceContext:143 Was used in file:/D:/Games/pathfinder/PCgen/notForDist/paizo/pathfinder_rpg/ultimate_combat/pfuc_classes.lst in tokens: [plugin.lsttokens.auto.FeatToken]

There are a few others relating to pfuc_abilities, pfuc_equip_weap_firearms, pfuc_equip_weap_bronzeage, and pfuc_abilitycategories. I've attached the log for further inspection.

Sorry for the double post on the attach. I didn't realize it worked the first time.

Brad Kester
September 7, 2012, 3:00 PM

Showing unconstructed reference mentions when loading Ultimate Combat

James Dempsey
September 7, 2012, 2:57 PM

Protective code added. You will now get an error in the log like the following, but the class application will continue.

07:51:49.639 LSTERROR AWT-EventQueue-1 PlayerCharacter:10022 Missing object referenced in the ability list for Alchemist(1) list is CDOMDirectSingleRef AbilityList *Special Ability:AUTOMATIC

Back at data load time there will have been an error like

07:51:17.823 SEVERE Thread-7 AbilityCategory:654 Unconstructed Reference: Ability Category Special Ability All Afutomatic Proficiencies
07:51:17.828 SEVERE Thread-7 TrackingReferenceContext:143 Was used in file:/D:/Projects/pcgendev/data/alpha/paizo/pathfinder_rpg/advanced_players_guide/pfapg_classes_base.lst in tokens: [plugin.lsttokens.AbilityLst]

That's what needs to be resolved from the data side.

James Dempsey
September 7, 2012, 2:46 PM

Hi Brad,
This is caused by a null ability reference in a class list. I would expect that earlier when you loaded the class the was an error about an 'unconstructed reference' or 'unknown' ability. Could you check please?
Cheers,
James.

Fixed

Assignee

James Dempsey

Reporter

Brad Kester