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 218972

Summary: New File Type creates DataObject class with unused imports
Product: apisupport Reporter: pjdm
Component: TemplatesAssignee: Martin Kozeny <mkozeny>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P4    
Version: 7.2   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:

Description pjdm 2012-09-25 12:24:11 UTC
In a new module, use New File Type, MIME Type "application/x-test", extension "test", class name prefix "Test", use any icon, uncheck "Use MultiView", Finish.

The resulting TestDataObject.java contains two unused imports.

"import org.openide.util.Lookup;" isn't used, but is otherwise harmless.

"import org.openide.windows.TopComponent;" isn't used, but the module does not have a dependency on Window System API, so this import causes a "package org.openide.windows does not exist" error.

This is easily fixed using Fix Imports, therefore priority P4.
Comment 1 Martin Kozeny 2012-12-11 08:40:08 UTC
When creating DataObject class using New File Type, unused imports are removed.
Comment 2 Quality Engineering 2012-12-12 02:45:04 UTC
Integrated into 'main-golden', will be available in build *201212120001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/80a6f16a3e62
User: Martin Kozeny <mkozeny@netbeans.org>
Log: #218972: When creating DataObject class using New File Type, unused imports are removed