This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Using the new property sheet, one thing seems not to be working at all: Creating JARs from template. As soon as wizard is completed, and whenever the JAR node is selected, the following NPE is fired: java.lang.NullPointerException at org.netbeans.modules.jarpackager.ManifestTab.ensureVersionAttribute(Manifes tTab.java:607) at org.netbeans.modules.jarpackager.ManifestTab.getValue(ManifestTab.java:471) at org.openide.explorer.propertysheet.PropUtils.updateEdFromProp(PropUtils.jav a:559) at org.openide.explorer.propertysheet.PropUtils.getPropertyEditor(PropUtils.ja va:530) at org.openide.explorer.propertysheet.ReusablePropertyModel.getPropertyEditor( ReusablePropertyModel.java:57) at org.openide.explorer.propertysheet.SheetCellRenderer.setCurrentModelAndEnv( SheetCellRenderer.java:284) at org.openide.explorer.propertysheet.SheetCellRenderer.getTableCellRendererCo mponent(SheetCellRenderer.java:82) at javax.swing.JTable.prepareRenderer(JTable.java:3731) at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:1149) [snip] The triggering method is simple boilerplate code to fetch the property editor for the property, and ensure that its value matches the value of the property (you have to do this - primitive property editors will not have the value set; property editors implemented as inner classes of Property subclasses probably will, but there is no way to know which kind of editor you have except to test the values). Is it possible that the property sheet is getting the JAR DataObject too soon, and calling this method while the manifest attributes are still being created? Or is the answer something more simple? static void updateEdFromProp(Property p, PropertyEditor ed, String title) throws ProxyNode.DifferentValuesException, IllegalAccessException, InvocationTargetException { Object newValue = p.getValue(); Object oldValue = ed.getValue(); // test if newValue is not equal to oldValue if ((newValue != null && !newValue.equals(oldValue)) || (newValue == null && oldValue != null)) { ed.setValue(newValue); } }
I cannot reproduce it on the latest build. Could you give more details on when it appears? Steps to reproduce, build number, os? thanks.
Well, I missed the dependency to 29447 and the "new property sheets". Ignore my previous post, I'll check it out with the new prop-sheets.
Reproduced and fixed. The problem was in that the code of getValue depended on that setValue is called before. In other words, it did not handle "no value" correctly. I fixed it to return null in the case the value was not initialized yet. Also fixed the same issue in DataObjectListEditor . 1.28 +9 -6 jarpackager/src/org/netbeans/modules/jarpackager/ManifestTab.java 1.52 +3 -0 jarpackager/src/org/netbeans/modules/jarpackager/DataObjectListEditor.java
Verified in trunk