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.

Bug 66847 - No obvious way to create package-info.java file
Summary: No obvious way to create package-info.java file
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jan Becicka
URL:
Keywords:
: 73356 (view as bug list)
Depends on:
Blocks: 36470
  Show dependency tree
 
Reported: 2005-10-14 19:45 UTC by ahe
Modified: 2010-04-20 20:35 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Diff of java/projects (19.21 KB, patch)
2005-10-27 08:20 UTC, Tomas Zezula
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ahe 2005-10-14 19:45:25 UTC
To accommodate package annotations, javac accepts a
package-info.java file.  There is no obvious way to
create this file in NetBeans.

See JLS3:
http://java.sun.com/docs/books/jls/third_edition/html/packages.html#7.4.1.1
Comment 1 Martin Roskanin 2005-10-17 08:33:03 UTC
looks like java file creation wizard problem? Reassigning to java module for
evaluation
Comment 2 Tomas Zezula 2005-10-26 13:33:50 UTC
The java/project handles the wizards for creating the files. I've changed the
wizard to allow creation of package-info.java, but the JavaDataObject thorws the
following exception from JDO.handleCreateFromTemplate ().

java.io.IOException: The specified name is not valid for use in a Java source
file: package-info
        at
org.netbeans.modules.java.JavaDataObject.handleCreateFromTemplate(JavaDataObject.java:298)
        at org.openide.loaders.DataObject$5.run(DataObject.java:713)
        at
org.openide.loaders.DataObjectPool$1WrapAtomicAction.run(DataObjectPool.java:203)

This exception has to be fixed before I integrate the undated wizard.
Comment 3 Tomas Zezula 2005-10-27 08:20:48 UTC
Created attachment 26375 [details]
Diff of java/projects
Comment 4 Tomas Zezula 2005-10-27 08:25:28 UTC
I've attached the diff of java/project which solves the problem of New File
Wizard. I am not able to commit it because the JDO problem. When the JDO will be
fixed apply the diff. You can simulate the JDO problem by applying the diff and
creating new Java Pakckage Info.
Comment 5 Jan Pokorsky 2005-11-04 15:28:11 UTC
You can create JDO as package-info.java now. The rename works too. Fixed in

/cvs/java/src/org/netbeans/modules/java/JavaDataObject.java
new revision: 1.209; previous revision: 1.208

Honzo B. could you take a look at the refactoring error message? In case of the
in-place renaming in the explorer you can rename the file to package-info
(Rename without refactoring enabled) but in case of pop-up menu there is just
the refactoring rename that blocks the renaming. Maybe a warning message would
be fine there.
Comment 6 Tomas Zezula 2005-11-04 15:43:10 UTC
Is the java fix complete?
If so, I am going to integrate the patch.
Comment 7 Jan Pokorsky 2005-11-04 15:50:04 UTC
The JDO fix is complete. The question is if the refactoring module should be
changed as well. It definitely does not block your integration.
Comment 8 Tomas Zezula 2005-11-07 18:53:52 UTC
OK, I am going to integrate the patch.
Comment 9 Tomas Zezula 2005-11-09 09:56:09 UTC
Now you can create the package-info using the Java Package Info template, but
the created file has a wrong package name, the refactoring of the template
failed, this should be fixed in the refactoring module.

Checking in project/src/org/netbeans/modules/java/project/Bundle.properties;
/cvs/java/project/src/org/netbeans/modules/java/project/Bundle.properties,v  <--
 Bundle.properties
new revision: 1.35; previous revision: 1.34
done
Checking in
project/src/org/netbeans/modules/java/project/JavaTargetChooserPanel.java;
/cvs/java/project/src/org/netbeans/modules/java/project/JavaTargetChooserPanel.java,v
 <--  JavaTargetChooserPanel.java
new revision: 1.26; previous revision: 1.25
done
Checking in
project/src/org/netbeans/modules/java/project/JavaTargetChooserPanelGUI.form;
/cvs/java/project/src/org/netbeans/modules/java/project/JavaTargetChooserPanelGUI.form,v
 <--  JavaTargetChooserPanelGUI.form
new revision: 1.10; previous revision: 1.9
done
Checking in
project/src/org/netbeans/modules/java/project/JavaTargetChooserPanelGUI.java;
/cvs/java/project/src/org/netbeans/modules/java/project/JavaTargetChooserPanelGUI.java,v
 <--  JavaTargetChooserPanelGUI.java
new revision: 1.26; previous revision: 1.25
done
Checking in
project/src/org/netbeans/modules/java/project/NewJavaFileWizardIterator.java;
/cvs/java/project/src/org/netbeans/modules/java/project/NewJavaFileWizardIterator.java,v
 <--  NewJavaFileWizardIterator.java
new revision: 1.17; previous revision: 1.16
done
Checking in project/src/org/netbeans/modules/java/project/layer.xml;
/cvs/java/project/src/org/netbeans/modules/java/project/layer.xml,v  <--  layer.xml
new revision: 1.21; previous revision: 1.20
done
RCS file:
/cvs/java/project/src/org/netbeans/modules/java/project/resources/package-info.html,v
done
Checking in
project/src/org/netbeans/modules/java/project/resources/package-info.html;
/cvs/java/project/src/org/netbeans/modules/java/project/resources/package-info.html,v
 <--  package-info.html
initial revision: 1.1
done
RCS file:
/cvs/java/project/src/org/netbeans/modules/java/project/resources/package-info.template,v
done
Checking in
project/src/org/netbeans/modules/java/project/resources/package-info.template;
/cvs/java/project/src/org/netbeans/modules/java/project/resources/package-info.template,v
 <--  package-info.template
initial revision: 1.1
done
Checking in
project/src/org/netbeans/spi/java/project/support/ui/templates/JavaTemplates.java;
/cvs/java/project/src/org/netbeans/spi/java/project/support/ui/templates/JavaTemplates.java,v
 <--  JavaTemplates.java
new revision: 1.16; previous revision: 1.15
done
Comment 10 Jan Becicka 2005-11-09 15:45:16 UTC
Checking in JavaDataObject.java;
/cvs/java/src/org/netbeans/modules/java/JavaDataObject.java,v  <-- 
JavaDataObject.java
new revision: 1.210; previous revision: 1.209
done
Comment 11 Jesse Glick 2010-04-20 20:32:59 UTC
*** Bug 73356 has been marked as a duplicate of this bug. ***