Skip to content

Commit 2135e4c

Browse files
committed
cleanup: Cleanup Map raw type warnings..
Cleanup May raw type warnings that look like this: [repeat] /home/bwalker/src/netbeans/ide/team.commons/src/org/netbeans/modules/bugtracking/commons/AttachmentsPanel.java:353: warning: [rawtypes] found raw type: Map [repeat] Map attributes = cmp.getFont().getAttributes(); [repeat] ^ [repeat] missing type arguments for generic class Map<K,V> [repeat] where K,V are type-variables: [repeat] K extends Object declared in interface Map [repeat] V extends Object declared in interface Map Also, some minor code cleanup.
1 parent 81f08c1 commit 2135e4c

30 files changed

Lines changed: 101 additions & 87 deletions

File tree

enterprise/glassfish.eecommon/src/org/netbeans/modules/glassfish/eecommon/api/DomainEditor.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -465,12 +465,12 @@ private String formatJvmOption(String jvmOption) {
465465
static final String[] sysDatasources = {"jdbc/__TimerPool", "jdbc/__CallFlowPool"}; //NOI18N
466466

467467

468-
public HashMap<String,Map> getSunDatasourcesFromXml(){
469-
HashMap<String, Map> dSources = new HashMap<>();
468+
public HashMap<String, Map<String, String>> getSunDatasourcesFromXml(){
469+
HashMap<String, Map<String, String>> dSources = new HashMap<>();
470470
Document domainDoc = getDomainDocument();
471471
if (domainDoc != null) {
472472
Map<String,NamedNodeMap> dsMap = getDataSourcesAttrMap(domainDoc);
473-
HashMap<String,Node> cpMap = getConnPoolsNodeMap(domainDoc);
473+
Map<String,Node> cpMap = getConnPoolsNodeMap(domainDoc);
474474
dsMap.keySet().removeAll(Arrays.asList(sysDatasources));
475475
String[] ds = dsMap.keySet().toArray(new String[dsMap.size()]);
476476

@@ -485,7 +485,7 @@ public HashMap<String,Map> getSunDatasourcesFromXml(){
485485
return dSources;
486486
}
487487

488-
private Map<String,String> getPoolValues(Map<String, Node> cpMap, String poolName) {
488+
private Map<String, String> getPoolValues(Map<String, Node> cpMap, String poolName) {
489489
Map<String,String> pValues = new HashMap<>();
490490
Node cpNode = cpMap.get(poolName);
491491
NamedNodeMap cpAttrMap = cpNode.getAttributes();
@@ -532,8 +532,8 @@ private Map<String,String> getPoolValues(Map<String, Node> cpMap, String poolNam
532532
return pValues;
533533
}
534534

535-
public HashMap<String,Map> getConnPoolsFromXml(){
536-
HashMap<String, Map> pools = new HashMap<>();
535+
public HashMap<String, Map<String, String>> getConnPoolsFromXml(){
536+
HashMap<String, Map<String, String>> pools = new HashMap<>();
537537
Document domainDoc = getDomainDocument();
538538
if (domainDoc != null) {
539539
HashMap<String,Node> cpMap = getConnPoolsNodeMap(domainDoc);
@@ -547,8 +547,8 @@ public HashMap<String,Map> getConnPoolsFromXml(){
547547
return pools;
548548
}
549549

550-
private HashMap<String,NamedNodeMap> getDataSourcesAttrMap(Document domainDoc){
551-
HashMap<String,NamedNodeMap> dataSourceMap = new HashMap<String,NamedNodeMap>();
550+
private Map<String, NamedNodeMap> getDataSourcesAttrMap(Document domainDoc){
551+
Map<String,NamedNodeMap> dataSourceMap = new HashMap<>();
552552
updateWithSampleDataSource(domainDoc);
553553
NodeList dataSourceNodeList = domainDoc.getElementsByTagName(CONST_JDBC);
554554
for(int i=0; i<dataSourceNodeList.getLength(); i++){

enterprise/j2ee.dd.webservice/src/org/netbeans/modules/j2ee/dd/impl/commonws/DescriptionBeanMultiple.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public void setDescription(String description) {
7777
}
7878
}
7979

80-
public void setAllDescriptions(java.util.Map descriptions) throws VersionNotSupportedException {
80+
public void setAllDescriptions(Map descriptions) throws VersionNotSupportedException {
8181
removeAllDescriptions();
8282
if (descriptions!=null) {
8383
Iterator<String> keys = descriptions.keySet().iterator();

enterprise/j2ee.dd.webservice/src/org/netbeans/modules/j2ee/dd/impl/webservices/WebServicesProxy.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626

2727
import java.beans.PropertyChangeListener;
2828
import java.util.ArrayList;
29+
import java.util.HashMap;
2930
import java.util.List;
31+
import java.util.Map;
3032
import org.netbeans.modules.j2ee.dd.api.webservices.Webservices;
3133

3234

@@ -181,8 +183,8 @@ public void setId(java.lang.String value) {
181183
}
182184
}
183185

184-
public java.util.Map getAllDescriptions() {
185-
return webSvc==null?new java.util.HashMap():webSvc.getAllDescriptions();
186+
public Map getAllDescriptions() {
187+
return webSvc == null ? new HashMap<>() : webSvc.getAllDescriptions();
186188
}
187189

188190
public String getDescription(String locale) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
@@ -193,8 +195,8 @@ public String getDefaultDescription() {
193195
return webSvc==null?null:webSvc.getDefaultDescription();
194196
}
195197

196-
public java.util.Map getAllDisplayNames() {
197-
return webSvc==null?new java.util.HashMap():webSvc.getAllDisplayNames();
198+
public Map getAllDisplayNames() {
199+
return webSvc==null?new HashMap<>():webSvc.getAllDisplayNames();
198200
}
199201

200202
public String getDefaultDisplayName() {
@@ -209,8 +211,8 @@ public org.netbeans.modules.j2ee.dd.api.common.Icon getDefaultIcon() {
209211
return webSvc==null?null:webSvc.getDefaultIcon();
210212
}
211213

212-
public java.util.Map getAllIcons() {
213-
return webSvc==null?new java.util.HashMap():webSvc.getAllIcons();
214+
public Map getAllIcons() {
215+
return webSvc == null ? new HashMap<>() : webSvc.getAllIcons();
214216
}
215217

216218
public String getLargeIcon() {
@@ -281,7 +283,7 @@ public void removeSmallIcon(String locale) throws org.netbeans.modules.j2ee.dd.a
281283
if (webSvc!=null) webSvc.removeSmallIcon(locale);
282284
}
283285

284-
public void setAllDescriptions(java.util.Map descriptions) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
286+
public void setAllDescriptions(Map descriptions) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
285287
if (webSvc!=null) webSvc.setAllDescriptions(descriptions);
286288
}
287289

@@ -293,7 +295,7 @@ public void setDescription(String locale, String description) throws org.netbean
293295
if (webSvc!=null) webSvc.setDescription(locale, description);
294296
}
295297

296-
public void setAllDisplayNames(java.util.Map displayNames) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
298+
public void setAllDisplayNames(Map displayNames) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
297299
if (webSvc!=null) webSvc.setAllDisplayNames(displayNames);
298300
}
299301

enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/common/DescriptionInterface.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
*/
1919

2020
package org.netbeans.modules.j2ee.dd.api.common;
21+
22+
import java.util.Map;
23+
2124
/**
2225
* Super interface for all DD elements having the description property/properties.
2326
*
@@ -50,7 +53,7 @@ public interface DescriptionInterface {
5053
*
5154
* @param descriptions Map of descriptions in the form of [locale,description]
5255
*/
53-
public void setAllDescriptions(java.util.Map descriptions) throws VersionNotSupportedException;
56+
public void setAllDescriptions(Map descriptions) throws VersionNotSupportedException;
5457

5558
/**
5659
* Returns the description element value for particular locale.<br>
@@ -73,7 +76,7 @@ public interface DescriptionInterface {
7376
*
7477
* @return map of all descriptions in the form of [locale:description]
7578
*/
76-
public java.util.Map getAllDescriptions();
79+
public Map getAllDescriptions();
7780

7881
/**
7982
* Removes the description element for particular locale.

enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/api/common/DisplayNameInterface.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
*/
1919

2020
package org.netbeans.modules.j2ee.dd.api.common;
21+
22+
import java.util.Map;
23+
2124
/**
2225
* Super interface for all DD elements having the display-name property/properties.
2326
*
@@ -50,7 +53,7 @@ public interface DisplayNameInterface {
5053
*
5154
* @param displayNames Map of display names in the form of [locale,display-name]
5255
*/
53-
public void setAllDisplayNames(java.util.Map displayNames) throws VersionNotSupportedException;
56+
public void setAllDisplayNames(Map displayNames) throws VersionNotSupportedException;
5457

5558
/**
5659
* Returns the display-name element value for particular locale.<br>
@@ -73,7 +76,7 @@ public interface DisplayNameInterface {
7376
*
7477
* @return map of all display-names in the form of [locale:display-name]
7578
*/
76-
public java.util.Map getAllDisplayNames();
79+
public Map getAllDisplayNames();
7780

7881
/**
7982
* Removes the display-name element for particular locale.

enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/multiview/CmpRelationshipsTableModel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
public class CmpRelationshipsTableModel extends InnerTableModel {
3838

3939
private EjbJar ejbJar;
40-
private final Map relationshipsHelperMap = new HashMap();
40+
private final Map<EjbRelation, RelationshipHelper> relationshipsHelperMap = new HashMap<>();
4141
private static final String[] COLUMN_NAMES = {Utils.getBundleMessage("LBL_RelationshipName"),
4242
Utils.getBundleMessage("LBL_Cardinality"),
4343
Utils.getBundleMessage("LBL_EntityBean"),

enterprise/j2ee.ddloaders/src/org/netbeans/modules/j2ee/ddloaders/multiview/EnterpriseBeansNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ private synchronized boolean setChecking(boolean value) {
118118
}
119119

120120
private void check() {
121-
Map nodeMap = new HashMap();
121+
Map<Object, Node> nodeMap = new HashMap<>();
122122
Children children = getChildren();
123123
Node[] nodes = children.getNodes();
124124
for (int i = 0; i < nodes.length; i++) {

enterprise/j2ee.earproject/src/org/netbeans/modules/j2ee/earproject/EarActionProvider.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ public class EarActionProvider implements ActionProvider {
9797
private final UpdateHelper updateHelper;
9898

9999
/** Map from commands to ant targets */
100-
Map<String,String[]> commands;
100+
Map<String, String[]> commands;
101101

102102
public EarActionProvider(EarProject project, UpdateHelper updateHelper) {
103-
commands = new HashMap<String, String[]>();
103+
commands = new HashMap<>();
104104
commands.put(COMMAND_BUILD, new String[] {"dist"}); // NOI18N
105105
commands.put(COMMAND_CLEAN, new String[] {"clean"}); // NOI18N
106106
commands.put(COMMAND_REBUILD, new String[] {"clean", "dist"}); // NOI18N
@@ -407,7 +407,7 @@ private boolean isCosEnabled() {
407407
return Boolean.parseBoolean(project.evaluator().getProperty(EarProjectProperties.J2EE_COMPILE_ON_SAVE));
408408
}
409409

410-
private void collectStartupExtenderArgs(Map p, String command) {
410+
private void collectStartupExtenderArgs(Map<Object, Object> p, String command) {
411411
StringBuilder b = new StringBuilder();
412412
for (String arg : runJvmargsIde(command)) {
413413
b.append(' ').append(arg);

enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/config/ConfigSupportImpl.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ public final class ConfigSupportImpl implements J2eeModuleProvider.ConfigSupport
9595
private static final String GENERIC_EXTENSION = ".dpf"; // NOI18N
9696

9797
private String configurationPrimaryFileName = null;
98-
private Map relativePaths = null;
99-
private Map allRelativePaths = null;
98+
private Map<String, String> relativePaths = null;
99+
private Map<String, String> allRelativePaths = null;
100100

101101
private final J2eeModuleProvider provider;
102102
private final J2eeModule j2eeModule;
@@ -944,11 +944,11 @@ private J2eeModuleProvider getProvider () {
944944
return provider;
945945
}
946946

947-
private Map getRelativePaths() {
947+
private Map<String, String> getRelativePaths() {
948948
if (relativePaths != null)
949949
return relativePaths;
950950

951-
relativePaths = new HashMap();
951+
relativePaths = new HashMap<>();
952952
if (hasCustomSupport()) {
953953
String [] paths = server.getDeploymentPlanFiles(getModuleType());
954954
configurationPrimaryFileName = paths[0].substring(paths[0].lastIndexOf("/")+1);
@@ -959,23 +959,23 @@ private Map getRelativePaths() {
959959
return relativePaths;
960960
}
961961

962-
private void collectData(Server server, Map map) {
962+
private void collectData(Server server, Map<String, String> map) {
963963
if (!hasCustomSupport(server, getModuleType()))
964964
return;
965965

966-
String [] paths = server.getDeploymentPlanFiles(getModuleType());
966+
String[] paths = server.getDeploymentPlanFiles(getModuleType());
967967
paths = (paths == null) ? new String[0] : paths;
968968
for (int i=0; i<paths.length; i++) {
969969
String name = paths[i].substring(paths[i].lastIndexOf("/")+1);
970970
map.put(name, paths[i]);
971971
}
972972
}
973973

974-
private Map getAllRelativePaths() {
974+
private Map<String, String> getAllRelativePaths() {
975975
if (allRelativePaths != null)
976976
return allRelativePaths;
977977

978-
allRelativePaths = new HashMap();
978+
allRelativePaths = new HashMap<>();
979979
Collection servers = ServerRegistry.getInstance().getServers();
980980
for (Iterator i=servers.iterator(); i.hasNext();) {
981981
Server server = (Server) i.next();

enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/ServerInstance.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -497,15 +497,15 @@ public ServerTarget[] getTargets() {
497497
}
498498

499499
public Collection getTargetList() {
500-
Map targets = getTargetMap();
500+
Map<String, ServerTarget> targets = getTargetMap();
501501
synchronized (this) {
502502
return targets.values();
503503
}
504504
}
505505

506506
// PENDING use targets final variable?
507-
private Map getTargetMap() {
508-
Map tmpTargets = null;
507+
private Map<String, ServerTarget> getTargetMap() {
508+
Map<String, ServerTarget> tmpTargets = null;
509509
synchronized (this) {
510510
tmpTargets = targets;
511511
}

0 commit comments

Comments
 (0)