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 92762 - Generify WizardDescriptor.Panel's readSettings/storeSettings
Summary: Generify WizardDescriptor.Panel's readSettings/storeSettings
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Dialogs&Wizards (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: apireviews
URL:
Keywords: API_REVIEW_FAST
Depends on: 102261 154776
Blocks:
  Show dependency tree
 
Reported: 2007-01-18 10:20 UTC by Jaroslav Tulach
Modified: 2008-12-22 11:24 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Changes in openide/dialogs and openide/loaders (33.55 KB, patch)
2007-01-18 10:21 UTC, Jaroslav Tulach
Details | Diff
The patch that I will integrate tomorrow (40.41 KB, patch)
2007-02-01 16:47 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2007-01-18 10:20:35 UTC
I've heard various complaints from people who claim that 

public void readSettings(Object obj);

in WizardDescriptor.Panel is misleading as one always needs to casts obj to 
WizardDescriptor and that this makes the API look very bad.

With the rise of generics we have a chance to fix this. If we make the Panel 
and WizardDescriptor.Iterator take <Data> then people could use

public void readSettings(WizardDescriptor obj)

in their own new code. I'll attach a patch
Comment 1 Jaroslav Tulach 2007-01-18 10:21:19 UTC
Created attachment 37479 [details]
Changes in openide/dialogs and openide/loaders
Comment 2 Jesse Glick 2007-01-22 04:24:22 UTC
public final synchronized void setPanels(Iterator panels)

should I guess be

public final synchronized void setPanels(Iterator<?> panels)

? I'm not sure how it should be typed. Shouldn't WizardDescriptor itself have a
type parameter?
Comment 3 Jaroslav Tulach 2007-01-22 08:55:07 UTC
Adding type parameter to WizardDescriptor was my first attempt. Works ok for 
WizardDescritor(Iterator<T> t, T settings) or WizardDescritor<Panel<T>[], T 
settings) constructors, but makes WizardDescritor(without settings) 
untypeable. That is why I generified just Iterator and Panel.

Re. setIterator method. Yes, this one is wrongly typed. Basically I suggest to 
deprecate it and replace for example by:

public final <Data> void setPanels(Iterator<Data> panels, Data settings)

that would be typeable relatively ok.
Comment 4 Jaroslav Tulach 2007-02-01 16:47:51 UTC
Created attachment 37929 [details]
The patch that I will integrate tomorrow
Comment 5 Jaroslav Tulach 2007-02-02 09:43:25 UTC
"#92762: Getting rid of readSettings(Object) and storeSettings(Object) by use 
of generification, fixing j2ee/persistance where ArrayIterator and 
TemplateWizard.Iterator types classhed"
Checking in j2ee/persistence/nbproject/project.xml;
/shared/data/ccvs/repository/j2ee/persistence/nbproject/project.xml,v  <--  
project.xml
new revision: 1.15; previous revision: 1.14
done
Checking in 
j2ee/persistence/src/org/netbeans/modules/j2ee/persistence/wizard/fromdb/DatabaseTablesPanel.java;
/shared/data/ccvs/repository/j2ee/persistence/src/org/netbeans/modules/j2ee/persistence/wizard/fromdb/DatabaseTablesPanel.java,v  
<--  DatabaseTablesPanel.java
new revision: 1.6; previous revision: 1.5
done
Checking in 
j2ee/persistence/src/org/netbeans/modules/j2ee/persistence/wizard/fromdb/RelatedCMPWizard.java;
/shared/data/ccvs/repository/j2ee/persistence/src/org/netbeans/modules/j2ee/persistence/wizard/fromdb/RelatedCMPWizard.java,v  
<--  RelatedCMPWizard.java
new revision: 1.6; previous revision: 1.5
done
Checking in openide/dialogs/apichanges.xml;
/shared/data/ccvs/repository/openide/dialogs/apichanges.xml,v  <--  
apichanges.xml
new revision: 1.9; previous revision: 1.8
done
Checking in openide/dialogs/manifest.mf;
/shared/data/ccvs/repository/openide/dialogs/manifest.mf,v  <--  manifest.mf
new revision: 1.10; previous revision: 1.9
done
Checking in openide/dialogs/nbproject/project.properties;
/shared/data/ccvs/repository/openide/dialogs/nbproject/project.properties,v  
<--  project.properties
new revision: 1.8; previous revision: 1.7
done
Checking in openide/dialogs/src/org/openide/DialogDisplayer.java;
/shared/data/ccvs/repository/openide/dialogs/src/org/openide/DialogDisplayer.java,v  
<--  DialogDisplayer.java
new revision: 1.6; previous revision: 1.5
done
Checking in openide/dialogs/src/org/openide/WizardDescriptor.java;
/shared/data/ccvs/repository/openide/dialogs/src/org/openide/WizardDescriptor.java,v  
<--  WizardDescriptor.java
new revision: 1.41; previous revision: 1.40
done
Checking in openide/loaders/src/org/openide/loaders/NewObjectWizardPanel.java;
/shared/data/ccvs/repository/openide/loaders/src/org/openide/loaders/NewObjectWizardPanel.java,v  
<--  NewObjectWizardPanel.java
new revision: 1.8; previous revision: 1.7
done
Checking in openide/loaders/src/org/openide/loaders/TemplateWizard.java;
/shared/data/ccvs/repository/openide/loaders/src/org/openide/loaders/TemplateWizard.java,v  
<--  TemplateWizard.java
new revision: 1.26; previous revision: 1.25
done
Checking in 
openide/loaders/src/org/openide/loaders/TemplateWizardIterImpl.java;
/shared/data/ccvs/repository/openide/loaders/src/org/openide/loaders/TemplateWizardIterImpl.java,v  
<--  TemplateWizardIterImpl.java
new revision: 1.11; previous revision: 1.10
done
Checking in 
openide/loaders/src/org/openide/loaders/TemplateWizardIteratorWrapper.java;
/shared/data/ccvs/repository/openide/loaders/src/org/openide/loaders/TemplateWizardIteratorWrapper.java,v  
<--  TemplateWizardIteratorWrapper.java
new revision: 1.3; previous revision: 1.2
done
Checking in openide/loaders/src/org/openide/loaders/TemplateWizardPanel1.java;
/shared/data/ccvs/repository/openide/loaders/src/org/openide/loaders/TemplateWizardPanel1.java,v  
<--  TemplateWizardPanel1.java
new revision: 1.4; previous revision: 1.3
done
Checking in openide/loaders/src/org/openide/loaders/TemplateWizardPanel2.java;
/shared/data/ccvs/repository/openide/loaders/src/org/openide/loaders/TemplateWizardPanel2.java,v  
<--  TemplateWizardPanel2.java
new revision: 1.6; previous revision: 1.5
done