Skip to content

Commit

Permalink
Cleanup raw type warning (apache#3143)
Browse files Browse the repository at this point in the history
* [NETBEANS-5966] - cleanup more of the raw type warnings

More work done on cleanup of raw type warnings.. Issues like this:

[nb-javac] /home/bwalker/src/netbeans/enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/common/ComponentBeanMultiple.java:242: warning: [rawtypes] found raw type: Map
[nb-javac] Map map =new java.util.HashMap();
[nb-javac] ^
[nb-javac] missing type arguments for generic class Map<K,V>
[nb-javac] where K,V are type-variables:
[nb-javac] K extends Object declared in interface Map
[nb-javac] V extends Object declared in interface Map

All work is done internal to methods and non-public interfaces..
  • Loading branch information
BradWalker authored Sep 1, 2021
1 parent 670a548 commit ba004a1
Show file tree
Hide file tree
Showing 68 changed files with 112 additions and 112 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public void run() {
final SortedSet<String> moduleCategories = getProperties().getModuleCategories();
EventQueue.invokeLater(new Runnable() {
public void run() {
DefaultComboBoxModel model = new DefaultComboBoxModel();
DefaultComboBoxModel<String> model = new DefaultComboBoxModel<>();
categoryValue.removeAllItems();
for (String cat : moduleCategories) {
model.addElement(cat);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private static String getMessage(String key) {
}

private static ComboBoxModel createCookieClassModel() {
DefaultComboBoxModel cookieClassModel = new DefaultComboBoxModel();
DefaultComboBoxModel<String> cookieClassModel = new DefaultComboBoxModel<>();
for (String fqcn : DataModel.PREDEFINED_COOKIE_CLASSES) {
String name = DataModel.parseClassName(fqcn);
cookieClassModel.addElement(name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ private void keyStrokeChangeActionPerformed(java.awt.event.ActionEvent evt) {//G
KeyStroke[] keyStrokes = ShortcutEnterPanel.showDialog();
if (keyStrokes != null && keyStrokes.length > 0) {
String newShortcut = WizardUtils.keyStrokesToString(keyStrokes);
DefaultListModel lm = (DefaultListModel)shortcutsList.getModel();
DefaultListModel<String> lm = (DefaultListModel)shortcutsList.getModel();
if (!lm.contains(newShortcut)) {
lm.addElement(newShortcut);
data.setKeyStroke(WizardUtils.keyStrokesToLogicalString(keyStrokes));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ public static ComboBoxModel createLayerPresenterComboModel(
*/
public static ComboBoxModel createLayerPresenterComboModel(
final Project project, final String sfsRoot, final Map<String,Object> excludeAttrs) {
DefaultComboBoxModel model = new DefaultComboBoxModel();
DefaultComboBoxModel<LayerItemPresenter> model = new DefaultComboBoxModel<>();
try {
FileSystem sfs = project.getLookup().lookup(NbModuleProvider.class).getEffectiveSystemFilesystem();
FileObject root = sfs.getRoot().getFileObject(sfsRoot);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ private void changeRow(Object fo, String key) {
}

private void fillIn() {
DefaultListModel model = (DefaultListModel) jList1.getModel();
DefaultListModel<WeakReference<Object>> model = (DefaultListModel<WeakReference<Object>>)jList1.getModel();

model.removeAllElements();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void initModels(final String gfRoot, final boolean isLocal) {
KeyListener kl = new MyKeyListener();
if (isLocal) {
// Put the choices into the combo box...
DefaultComboBoxModel model = new DefaultComboBoxModel();
DefaultComboBoxModel<String> model = new DefaultComboBoxModel<>();
File domainsDir = new File(
gfRoot, GlassfishInstance.DEFAULT_DOMAINS_FOLDER);
File candidates[] = domainsDir.listFiles(new FileFilter() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ protected Parser(ProcessIOContent content) {
String prompt = content.getCurrentPrompt();
promptLen = prompt != null ? prompt.length() : 0;
promptBuff = new CyclicStringBuffer(promptLen);
output = new LinkedList();
output = new LinkedList<>();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ private RestActionReport parseReport(XMLEventReader reader) throws XMLStreamExce

private HashMap<String, String> getMapEntry(StartElement entry) {
HashMap<String, String> entryMap = new HashMap<>();
Iterator iter = entry.getAttributes();
Iterator<Attribute> iter = entry.getAttributes();
while (iter.hasNext()) {
Attribute att = (Attribute) iter.next();
entryMap.put(att.getName().getLocalPart(), att.getValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public enum GlassFishContainer implements Comparator<GlassFishContainer> {
* conversion.
*/
private static final Map<String, GlassFishContainer> stringValuesMap
= new HashMap(2 * values().length);
= new HashMap<>(2 * values().length);

// Initialize backward String conversion Map.
static {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public String toString() {
sb.append("Value=");
sb.append(value != null ? value.toString() : "null");
sb.append(" Transitions=[");
for (Iterator i = next.keySet().iterator(); i.hasNext(); ) {
for (Iterator<Character> i = next.keySet().iterator(); i.hasNext(); ) {
sb.append(i.next());
if (i.hasNext()) {
sb.append(',');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,19 @@
import org.netbeans.modules.schema2beans.Common;
import org.openide.filesystems.*;
import org.xml.sax.*;
import java.util.HashMap;
import java.util.Map;
import org.w3c.dom.Document;

public final class DDProvider {

private static final DDProvider ddProvider = new DDProvider();
private Map ddMap;
private Map<FileObject, WebServicesProxy> ddMap;

/** Creates a new instance of WebSvcModule */
private DDProvider() {
//ddMap=new java.util.WeakHashMap(5);
ddMap = new java.util.HashMap(5);
ddMap = new HashMap<>(5);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ private ComboBoxSetter(JComboBox jcb, String value, Map<String, String> data) {
public void run() {
// build the allowed values
String allowedRegEx = jcb.getActionCommand();
DefaultComboBoxModel dcbm = new DefaultComboBoxModel();
DefaultComboBoxModel<String> dcbm = new DefaultComboBoxModel<>();
Pattern p = Pattern.compile(allowedRegEx);
Set<String> keys = data.keySet();
//String pushPrefix = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
# specific language governing permissions and limitations
# under the License.
is.eager=true
javac.source=1.6
javac.source=1.8
javac.compilerargs=-Xlint -Xlint:-serial
spec.version.base=1.37.0
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*/
public class ServerSelection extends javax.swing.JPanel {

private final DefaultComboBoxModel serversModel = new DefaultComboBoxModel();
private final DefaultComboBoxModel<ServerInstanceWrapper> serversModel = new DefaultComboBoxModel<>();
private ServerSelectionWizardPanel wp;

/** Creates new form ServerSelection */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ private void openSelected() {
}

private ListModel createListModel() {
DefaultListModel dlm = new DefaultListModel();
DefaultListModel<ElementHandle<? extends Element>> dlm = new DefaultListModel<>();

for (ElementHandle<? extends Element> el: myHandles) {
dlm.addElement(el);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class AddManagedBeanDialog extends javax.swing.JPanel implements Validati
private JSFConfigDataObject config;
private Hashtable existingBeans = null;

private final DefaultComboBoxModel scopeModel = new DefaultComboBoxModel();
private final DefaultComboBoxModel<ManagedBean.Scope> scopeModel = new DefaultComboBoxModel<>();
/** Creates new form AddManagedBeanDialog */
public AddManagedBeanDialog(JSFConfigDataObject config) {
initComponents();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public AddNavigationCaseDialog(JSFConfigDataObject config, String rule) {
this.config = config;
FacesConfig facesConfig = ConfigurationUtils.getConfigModel(config.getPrimaryFile(), true).getRootComponent();

DefaultComboBoxModel modelF = (DefaultComboBoxModel)jComboBoxFromView.getModel();
DefaultComboBoxModel modelT = (DefaultComboBoxModel)jComboBoxToView.getModel();
DefaultComboBoxModel<String> modelF = (DefaultComboBoxModel<String>)jComboBoxFromView.getModel();
DefaultComboBoxModel<String> modelT = (DefaultComboBoxModel<String>)jComboBoxToView.getModel();
modelF.addElement("");
modelT.addElement("");
Iterator<NavigationRule> iter = facesConfig.getNavigationRules().iterator();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1544,10 +1544,10 @@ public void mouseClicked(MouseEvent e) {
public final class JSFComponentsTableModel extends AbstractTableModel {

private final Class<?>[] COLUMN_TYPES = new Class<?>[] {Boolean.class, JsfComponentImplementation.class, JButton.class};
private DefaultListModel model;
private DefaultListModel<JSFComponentModelItem> model;

public JSFComponentsTableModel() {
model = new DefaultListModel();
model = new DefaultListModel<>();
}

public int getColumnCount() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ public void stateChanged(ChangeEvent e) {
Dialog dlg = DialogDisplayer.getDefault().createDialog(desc);
dlg.setVisible(true);
if (desc.getValue() == DialogDescriptor.OK_OPTION) {
((DefaultListModel)annotationProcessorsList.getModel()).addElement(panel.getProcessorFQN());
((DefaultListModel<String>)annotationProcessorsList.getModel()).addElement(panel.getProcessorFQN());
}
dlg.dispose();
}//GEN-LAST:event_addProcessorButtonActionPerformed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ public CustomizerFrameworks(ProjectCustomizer.Category category, WebProjectPrope
initComponents();

project = uiProperties.getProject();
jListFrameworks.setModel(new DefaultListModel());
((DefaultListModel) jListFrameworks.getModel()).addElement(NbBundle.getMessage(CustomizerFrameworks.class, "LBL_CustomizerFrameworks_Loading"));
jListFrameworks.setModel(new DefaultListModel<String>());
((DefaultListModel<String>) jListFrameworks.getModel()).addElement(NbBundle.getMessage(CustomizerFrameworks.class, "LBL_CustomizerFrameworks_Loading"));
// do not load frameworks again but use list from uiProperties; list is being loaded in background thread:
uiProperties.getLoadingFrameworksTask().addTaskListener(new TaskListener() {
public void taskFinished(Task task) {
Expand Down Expand Up @@ -107,7 +107,7 @@ private void initFrameworksList(WebModule webModule) {
if (uiProperties.getCurrentFrameworks() != null) {
for (WebFrameworkProvider framework : uiProperties.getCurrentFrameworks()) {
usedFrameworks.add(framework);
((DefaultListModel) jListFrameworks.getModel()).addElement(framework.getName());
((DefaultListModel<String>) jListFrameworks.getModel()).addElement(framework.getName());
WebModuleExtender extender = framework.createWebModuleExtender(webModule, controller);
extenders.put(framework, extender);
usedExtenders.add(extender);
Expand Down Expand Up @@ -221,7 +221,7 @@ private void jButtonAddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FI
for(int i = 0; i < newFrameworks.size(); i++) {
WebFrameworkProvider framework = (WebFrameworkProvider) newFrameworks.get(i);
if (!((DefaultListModel) jListFrameworks.getModel()).contains(framework.getName()))
((DefaultListModel) jListFrameworks.getModel()).addElement(framework.getName());
((DefaultListModel<String>) jListFrameworks.getModel()).addElement(framework.getName());

boolean added = false;
if (usedFrameworks.size() == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public AddExceptionDialogPanel(StrutsConfigDataObject config, String targetActio
this.config=config;
initComponents();
List actions = StrutsConfigUtilities.getAllActionsInModule(config);
DefaultComboBoxModel model = (DefaultComboBoxModel)jComboBoxCallAction.getModel();
DefaultComboBoxModel model1 = (DefaultComboBoxModel)jComboBoxActionExc.getModel();
DefaultComboBoxModel<String> model = (DefaultComboBoxModel<String>)jComboBoxCallAction.getModel();
DefaultComboBoxModel<String> model1 = (DefaultComboBoxModel<String>)jComboBoxActionExc.getModel();
Iterator iter = actions.iterator();
while (iter.hasNext()) {
String actionPath=((Action)iter.next()).getAttributeValue("path"); //NOI18N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public AddFormPropertyPanel(StrutsConfigDataObject config, String targetFormName
this.config=config;
initComponents();
List beans = StrutsConfigUtilities.getAllFormBeansInModule(config);
DefaultComboBoxModel model = (DefaultComboBoxModel)jComboBoxFormName.getModel();
DefaultComboBoxModel<String> model = (DefaultComboBoxModel<String>)jComboBoxFormName.getModel();
Iterator iter = beans.iterator();
while (iter.hasNext()) {
String name=((FormBean)iter.next()).getAttributeValue("name"); //NOI18N
Expand Down
2 changes: 1 addition & 1 deletion enterprise/websvc.core/nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.

javac.compilerargs=-Xlint:unchecked
javac.source=1.6
javac.source=1.8
spec.version.base=1.57.0

javadoc.arch=${basedir}/arch.xml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private void checkButtonEnablement() {
}

private void createListModel() {
DefaultListModel model = new DefaultListModel();
DefaultListModel<GradleExecConfiguration> model = new DefaultListModel<>();
for (GradleExecConfiguration c : handle.getConfigurations()) {
model.addElement(c);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public SelectFolderPanel(SelectFolderWizardPanel wiz, String name,
this.prop = prop;
this.top = top;
this.stripAmps = stripAmps;
DefaultListModel model = new DefaultListModel();
DefaultListModel<DataObject> model = new DefaultListModel<>();
DataObject[] folders = findFolders(top);
for (int i = 0; i < folders.length; i++) {
model.addElement(folders[i]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,14 @@ public final class DebuggerManager implements ContextProvider {
private DebuggerEngine currentEngine;
private final List sessions = new ArrayList();
private final Set engines = new HashSet ();
private final Vector breakpoints = new Vector ();
private final Vector<Breakpoint> breakpoints = new Vector<>();
private boolean breakpointsInitializing = false;
private boolean breakpointsInitialized = false;
private final Vector<Watch> watches = new Vector<>();
private boolean watchesInitialized = false;
private ThreadLocal<Boolean> watchesInitializing = new ThreadLocal<Boolean>();
private SessionListener sessionListener = new SessionListener ();
private Vector listeners = new Vector ();
private Vector<DebuggerManagerListener> listeners = new Vector<>();
private final HashMap listenersMap = new HashMap ();
private ActionsManager actionsManager = null;

Expand Down Expand Up @@ -507,13 +507,11 @@ public DebuggerEngine getCurrentEngine () {
*
* @param breakpoint a new breakpoint
*/
public void addBreakpoint (
Breakpoint breakpoint
) {
public void addBreakpoint (Breakpoint breakpoint) {
if (initBreakpoints (breakpoint)) {
// do not add one breakpoint more than once.
if (registerBreakpoint(breakpoint)) {
breakpoints.addElement (breakpoint);
breakpoints.addElement(breakpoint);
fireBreakpointCreated (breakpoint, null);
}
}
Expand Down Expand Up @@ -806,15 +804,12 @@ private void removeDebuggerManagerListener (DebuggerManagerListener l) {
* @param propertyName a name of property to listen on
* @param l the debuggerManager listener to add
*/
public void addDebuggerListener (
String propertyName,
DebuggerManagerListener l
) {
public void addDebuggerListener(String propertyName, DebuggerManagerListener l) {
synchronized (listenersMap) {
Vector listeners = (Vector) listenersMap.get (propertyName);
Vector<DebuggerManagerListener> listeners = (Vector<DebuggerManagerListener>)listenersMap.get(propertyName);
if (listeners == null) {
listeners = new Vector ();
listenersMap.put (propertyName, listeners);
listeners = new Vector<>();
listenersMap.put(propertyName, listeners);
}
listeners.addElement (l);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public void setParameterValues(List<ParameterValue> values) {
setParameterValues(values.toArray(new ParameterValue[values.size()]));
}
public void setParameterValues(ParameterValue[] values) {
DefaultListModel m = new DefaultListModel();
DefaultListModel<ParameterValue> m = new DefaultListModel<>();
for (ParameterValue pv : values) {
m.addElement(pv);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public AdjustConfigurationPanel(Iterable<? extends AnalyzerFactory> analyzers, A
}

this.analyzers = analyzers;
DefaultComboBoxModel analyzerModel = new DefaultComboBoxModel();
DefaultComboBoxModel<AnalyzerFactory> analyzerModel = new DefaultComboBoxModel<>();

for (AnalyzerFactory a : analyzers) {
CustomizerProvider<Object, JComponent> cp = a.getCustomizerProvider();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ public CssRuleCreateActionDialog() {
htmlTagsModel1.addElement(htmlTags[i]);
}

DefaultComboBoxModel htmlTagsModel = new DefaultComboBoxModel();
//htmlTagsModel.addElement(NONE);
DefaultComboBoxModel<String> htmlTagsModel = new DefaultComboBoxModel<>();
for( int i=0; i< htmlTags.length; i++){
htmlTagsModel.addElement(htmlTags[i]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

public class AutocompleteJComboBox extends JComboBox {

private static Comparator PROPERTY_COMPARATOR = new Comparator<String>() {
private static Comparator<String> PROPERTY_COMPARATOR = new Comparator<String>() {
@Override
public int compare(String s1, String s2) {
//sort the vendor spec. props below the common ones
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public SelectorsGroupEditor() {
String[] htmlTags = getHtmlTagNames();

// Optional prefix
DefaultComboBoxModel htmlTagsModel1 = new DefaultComboBoxModel();
DefaultComboBoxModel<String> htmlTagsModel1 = new DefaultComboBoxModel<>();
htmlTagsModel1.addElement(NONE);
htmlTagsModel1.addElement("a:link");
htmlTagsModel1.addElement("a:visited");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class FromNode implements From {

// A vector of generalized Table objects (JoinTables)

ArrayList _tableList;
List<JoinTable> _tableList;


// Constructors
Expand Down Expand Up @@ -86,8 +86,9 @@ public List getTableList() {

// Return the Table objects in the table list

ArrayList getTables() {
ArrayList tableRefs = new ArrayList();
List<Table> getTables() {
List<Table> tableRefs = new ArrayList<>();

for (int i=0; i<_tableList.size(); i++)
tableRefs.add(((JoinTableNode)_tableList.get(i)).getTable());
return tableRefs;
Expand All @@ -113,7 +114,7 @@ public Table findTable(String tableSpec) {
}

public JoinTable findJoinTable(String table1, String column1, String table2, String column2) {
ArrayList tableList = _tableList;
List<JoinTable> tableList = _tableList;
for (int i=0; i<tableList.size(); i++) {
JoinTableNode jt = (JoinTableNode) tableList.get(i);
Expression cond = jt.getExpression();
Expand Down
Loading

0 comments on commit ba004a1

Please sign in to comment.