You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by bw...@apache.org on 2022/12/04 00:52:35 UTC
[netbeans] branch master updated: Cleanup few remaining raw type List warnings.. (#5004)
This is an automated email from the ASF dual-hosted git repository.
bwalker pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/master by this push:
new 865fee2f2c Cleanup few remaining raw type List warnings.. (#5004)
865fee2f2c is described below
commit 865fee2f2cb6f9b626d073695a76755dd2626cba
Author: Brad Walker <bw...@musings.com>
AuthorDate: Sat Dec 3 17:52:28 2022 -0700
Cleanup few remaining raw type List warnings.. (#5004)
There are a few remaining raw type List warnings remaining.. This attempt is to try and clean the bulk of them up. It's been a slog to get all this done..
[repeat] /home/bwalker/src/netbeans/ide/editor/src/org/netbeans/modules/editor/NbEditorKit.java:712: warning: [unchecked] unchecked call to add(E) as a member of the raw type List
[repeat] l.add(action);
[repeat] ^
[repeat] where E is a type-variable:
[repeat] E extends Object declared in interface List
The remaining ones are mostly due to generated code. They will require a different type of fix.
---
.../modules/tomcat5/optional/StartTomcat.java | 4 ++--
.../netbeans/modules/tomcat5/util/LogManager.java | 6 ++---
.../modules/web/core/api/JspColoringData.java | 28 ++++++++++++----------
.../web/core/jsploader/TagLibParseSupport.java | 2 +-
.../modules/web/jspcompiler/SmapResolver.java | 2 +-
.../web.jspparser/nbproject/project.properties | 2 +-
.../web/monitor/data/RequestAttributesOut.java | 5 ++--
.../editor/StrutsConfigHyperlinkProvider.java | 6 +++--
.../src/org/netbeans/api/debugger/Lookup.java | 2 +-
.../ui/models/BoldVariablesTableModelFilter.java | 8 +++----
.../javafx2/editor/fxml/FxmlSchemaCatalog.java | 2 +-
.../src/org/openide/util/MapFormat.java | 6 ++---
.../lib/v8debug/connection/LinkedJSONObject.java | 4 ++--
13 files changed, 42 insertions(+), 35 deletions(-)
diff --git a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/optional/StartTomcat.java b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/optional/StartTomcat.java
index 5df91336c1..1b18039d85 100644
--- a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/optional/StartTomcat.java
+++ b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/optional/StartTomcat.java
@@ -929,8 +929,8 @@ public final class StartTomcat extends StartServer implements ProgressObject {
private static final long serialVersionUID = 992972967554321415L;
public TomcatFormat(File startupScript, File homeDir) {
- super(new java.util.HashMap ());
- java.util.Map map = getMap ();
+ super(new HashMap());
+ Map<String, String> map = getMap();
String scriptPath = startupScript.getAbsolutePath();
map.put(TAG_EXEC_CMD, scriptPath);
map.put(TAG_EXEC_STARTUP, "run"); // NOI18N
diff --git a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/util/LogManager.java b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/util/LogManager.java
index 612d1947c3..7965d70b7c 100644
--- a/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/util/LogManager.java
+++ b/enterprise/tomcat5/src/org/netbeans/modules/tomcat5/util/LogManager.java
@@ -45,8 +45,8 @@ public class LogManager {
private ServerLog serverLog;
private LogViewer sharedContextLogViewer;
private LogViewer juliLogViewer;
- private Map/*<TomcatModule, TomcatModuleConfig>*/ tomcatModuleConfigs = Collections.synchronizedMap(new WeakHashMap());
- private Map/*<String, LogViewer>*/ contextLogViewers = Collections.synchronizedMap(new HashMap());
+ private Map<TomcatModule, TomcatModuleConfig> tomcatModuleConfigs = Collections.synchronizedMap(new WeakHashMap());
+ private Map<String, LogViewer> contextLogViewers = Collections.synchronizedMap(new HashMap());
private TomcatManager manager;
private final Object serverLogLock = new Object();
@@ -253,7 +253,7 @@ public class LogManager {
public void openContextLog(TomcatModule module) {
final String moduleID = module.getModuleID();
Object o = tomcatModuleConfigs.get(module);
- TomcatModuleConfig moduleConfig = null;
+ TomcatModuleConfig moduleConfig = null;
LogViewer contextLog = null;
if (o == null) {
moduleConfig = new TomcatModuleConfig(
diff --git a/enterprise/web.core/src/org/netbeans/modules/web/core/api/JspColoringData.java b/enterprise/web.core/src/org/netbeans/modules/web/core/api/JspColoringData.java
index 88fe3ebda3..81ea6f55cc 100644
--- a/enterprise/web.core/src/org/netbeans/modules/web/core/api/JspColoringData.java
+++ b/enterprise/web.core/src/org/netbeans/modules/web/core/api/JspColoringData.java
@@ -47,7 +47,7 @@ public final class JspColoringData extends PropertyChangeSupport {
private Map taglibs;
/** Prefix -> Taglib id */
- private Map prefixMapper;
+ private Map<String, String> prefixMapper;
private boolean elIgnored = false;
@@ -118,9 +118,9 @@ public final class JspColoringData extends PropertyChangeSupport {
/** Incorporates new parse data from the parser, possibly firing a change about coloring.
* @param newTaglibs the new map of (uri -> TagLibraryInfo)
* @param newPrefixMapper the new map of (prefix, uri)
- * @param parseSuccessful wherher parsing was successful. If false, then the new information is partial only
+ * @param parseSuccessful whether parsing was successful. If false, then the new information is partial only
*/
- public void applyParsedData(Map newTaglibs, Map newPrefixMapper, boolean newELIgnored, boolean newXMLSyntax, boolean parseSuccessful) {
+ public void applyParsedData(Map newTaglibs, Map<String, String> newPrefixMapper, boolean newELIgnored, boolean newXMLSyntax, boolean parseSuccessful) {
initialized = true;
@@ -159,11 +159,11 @@ public final class JspColoringData extends PropertyChangeSupport {
}
else {
// merge
- Iterator it = newPrefixMapper.keySet().iterator();
+ Iterator<String> it = newPrefixMapper.keySet().iterator();
while (it.hasNext()) {
- Object prefix = it.next();
- Object uri = newPrefixMapper.get(prefix);
- Object uriOld = prefixMapper.get(prefix);
+ String prefix = it.next();
+ String uri = newPrefixMapper.get(prefix);
+ String uriOld = prefixMapper.get(prefix);
if ((uriOld == null) || !uri.equals(uriOld)) {
Object newTaglib = newTaglibs.get(uri);
if (newTaglib != null) {
@@ -180,7 +180,9 @@ public final class JspColoringData extends PropertyChangeSupport {
}
}
- private static boolean equalsColoringInformation(Map taglibs1, Map prefixMapper1, Map taglibs2, Map prefixMapper2) {
+ private static boolean equalsColoringInformation(Map taglibs1, Map<String, String> prefixMapper1,
+ Map taglibs2, Map<String, String> prefixMapper2) {
+
if ((taglibs1 == null) != (taglibs2 == null)) {
return false;
}
@@ -191,14 +193,16 @@ public final class JspColoringData extends PropertyChangeSupport {
return false;
}
else {
- Iterator it = prefixMapper1.keySet().iterator();
+ Iterator<String> it = prefixMapper1.keySet().iterator();
while (it.hasNext()) {
- Object prefix = it.next();
- Object key1 = prefixMapper1.get(prefix);
- Object key2 = prefixMapper2.get(prefix);
+ String prefix = it.next();
+ String key1 = prefixMapper1.get(prefix);
+ String key2 = prefixMapper2.get(prefix);
+
if ((key1 == null) || (key2 == null)) {
return false;
}
+
TagLibraryInfo tli1 = (TagLibraryInfo)taglibs1.get(key1);
TagLibraryInfo tli2 = (TagLibraryInfo)taglibs2.get(key2);
if ((tli1 == null) || (tli2 == null)) {
diff --git a/enterprise/web.core/src/org/netbeans/modules/web/core/jsploader/TagLibParseSupport.java b/enterprise/web.core/src/org/netbeans/modules/web/core/jsploader/TagLibParseSupport.java
index dcf84a42fa..cb9440c0bf 100644
--- a/enterprise/web.core/src/org/netbeans/modules/web/core/jsploader/TagLibParseSupport.java
+++ b/enterprise/web.core/src/org/netbeans/modules/web/core/jsploader/TagLibParseSupport.java
@@ -390,7 +390,7 @@ public class TagLibParseSupport implements org.openide.nodes.Node.Cookie, TagLib
//Map prefixMapper = (pageInfo.getXMLPrefixMapper().size() > 0) ?
// pageInfo.getApproxXmlPrefixMapper() : pageInfo.getJspPrefixMapper();
//Map prefixMapper = pageInfo.getJspPrefixMapper();
- Map prefixMapper = null;
+ Map<String, String> prefixMapper = null;
if (pageInfo.getXMLPrefixMapper().size() > 0) {
prefixMapper = pageInfo.getApproxXmlPrefixMapper();
if (prefixMapper.size() == 0){
diff --git a/enterprise/web.core/src/org/netbeans/modules/web/jspcompiler/SmapResolver.java b/enterprise/web.core/src/org/netbeans/modules/web/jspcompiler/SmapResolver.java
index d99a472ec2..c319784d1e 100644
--- a/enterprise/web.core/src/org/netbeans/modules/web/jspcompiler/SmapResolver.java
+++ b/enterprise/web.core/src/org/netbeans/modules/web/jspcompiler/SmapResolver.java
@@ -82,7 +82,7 @@ public class SmapResolver {
/** contains hashmap of fileid's & filenames in the jsp
*/
- private Hashtable fsection = new Hashtable(3);
+ private Map<String, String> fsection = new Hashtable<>(3);
/** contains jsp -> servlet line mappings
*/
diff --git a/enterprise/web.jspparser/nbproject/project.properties b/enterprise/web.jspparser/nbproject/project.properties
index 179990814d..74730e6b6c 100644
--- a/enterprise/web.jspparser/nbproject/project.properties
+++ b/enterprise/web.jspparser/nbproject/project.properties
@@ -17,7 +17,7 @@
is.autoload=true
javac.compilerargs=-Xlint:unchecked
-javac.source=1.6
+javac.source=1.8
extsrc.cp.extra=external/generated-glassfish-jspparser-4.0.jar
diff --git a/enterprise/web.monitor/src/org/netbeans/modules/web/monitor/data/RequestAttributesOut.java b/enterprise/web.monitor/src/org/netbeans/modules/web/monitor/data/RequestAttributesOut.java
index ec4ee4befe..89b3dc0773 100644
--- a/enterprise/web.monitor/src/org/netbeans/modules/web/monitor/data/RequestAttributesOut.java
+++ b/enterprise/web.monitor/src/org/netbeans/modules/web/monitor/data/RequestAttributesOut.java
@@ -32,6 +32,7 @@ package org.netbeans.modules.web.monitor.data;
import java.beans.PropertyChangeListener;
import java.util.Hashtable;
+import java.util.Map;
import java.util.Vector;
import org.netbeans.modules.schema2beans.AttrProp;
@@ -91,11 +92,11 @@ public class RequestAttributesOut extends BaseBean {
return (Param[])this.getValues(PARAM);
}
- public Hashtable getHashtable() {
+ public Map<String, String> getHashtable() {
Param[] attributes = (Param[])this.getValues(PARAM);
int numAttributes = attributes.length;
- Hashtable ht = new Hashtable(numAttributes);
+ Map<String, String> ht = new Hashtable<>(numAttributes);
for(int i=0; i<numAttributes; ++i) {
String name = attributes[i].getAttributeValue("name"); // NOI18N
diff --git a/enterprise/web.struts/src/org/netbeans/modules/web/struts/editor/StrutsConfigHyperlinkProvider.java b/enterprise/web.struts/src/org/netbeans/modules/web/struts/editor/StrutsConfigHyperlinkProvider.java
index f258e097bc..34c593b171 100644
--- a/enterprise/web.struts/src/org/netbeans/modules/web/struts/editor/StrutsConfigHyperlinkProvider.java
+++ b/enterprise/web.struts/src/org/netbeans/modules/web/struts/editor/StrutsConfigHyperlinkProvider.java
@@ -21,7 +21,9 @@ package org.netbeans.modules.web.struts.editor;
import java.awt.Toolkit;
import java.io.IOException;
import java.util.Hashtable;
+import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
+
import javax.lang.model.element.TypeElement;
import javax.swing.text.BadLocationException;
import javax.swing.text.JTextComponent;
@@ -55,14 +57,14 @@ import org.openide.util.NbBundle;
public class StrutsConfigHyperlinkProvider implements HyperlinkProvider {
private static boolean debug = false;
- private static Hashtable hyperlinkTable;
+ private static Map<String, Integer> hyperlinkTable;
private final int JAVA_CLASS = 0;
private final int FORM_NAME = 1;
private final int RESOURCE_PATH = 2;
{
- hyperlinkTable = new Hashtable();
+ hyperlinkTable = new Hashtable<>();
hyperlinkTable.put("data-source#className", new Integer(JAVA_CLASS)); //NOI18N
hyperlinkTable.put("data-source#type", new Integer(JAVA_CLASS)); //NOI18N
hyperlinkTable.put("form-beans#type", new Integer(JAVA_CLASS)); //NOI18N
diff --git a/ide/api.debugger/src/org/netbeans/api/debugger/Lookup.java b/ide/api.debugger/src/org/netbeans/api/debugger/Lookup.java
index e330d48070..9885f687ac 100644
--- a/ide/api.debugger/src/org/netbeans/api/debugger/Lookup.java
+++ b/ide/api.debugger/src/org/netbeans/api/debugger/Lookup.java
@@ -107,7 +107,7 @@ abstract class Lookup implements ContextProvider {
@Override
public <T> List<? extends T> lookup(String folder, Class<T> service) {
- List<T> l = new ArrayList<T>();
+ List<T> l = new ArrayList<>();
for (Object s : services) {
if (service.isInstance(s)) {
l.add(service.cast(s));
diff --git a/java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/models/BoldVariablesTableModelFilter.java b/java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/models/BoldVariablesTableModelFilter.java
index bd76bcf839..aa2339980d 100644
--- a/java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/models/BoldVariablesTableModelFilter.java
+++ b/java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/models/BoldVariablesTableModelFilter.java
@@ -59,9 +59,9 @@ import org.netbeans.spi.viewmodel.UnknownTypeException;
public class BoldVariablesTableModelFilter implements TableHTMLModelFilter,
Constants {
- private Map variableToValueType = new WeakHashMap ();
- private Map variableToValueValue = new WeakHashMap ();
- private Map variableToValueToString = new WeakHashMap ();
+ private Map<Object, String> variableToValueType = new WeakHashMap<>();
+ private Map<Object, String> variableToValueValue = new WeakHashMap<>();
+ private Map<Object, String> variableToValueToString = new WeakHashMap<>();
@@ -180,7 +180,7 @@ Constants {
public void removeModelListener (ModelListener l) {
}
- private String bold (Object variable, String value, Map map) {
+ private String bold (Object variable, String value, Map<Object, String> map) {
if (map.containsKey (variable)) {
String oldValue = (String) map.get (variable);
if (oldValue == value ||
diff --git a/javafx/javafx2.editor/src/org/netbeans/modules/javafx2/editor/fxml/FxmlSchemaCatalog.java b/javafx/javafx2.editor/src/org/netbeans/modules/javafx2/editor/fxml/FxmlSchemaCatalog.java
index f8b5ed0bb0..84a7f224cb 100644
--- a/javafx/javafx2.editor/src/org/netbeans/modules/javafx2/editor/fxml/FxmlSchemaCatalog.java
+++ b/javafx/javafx2.editor/src/org/netbeans/modules/javafx2/editor/fxml/FxmlSchemaCatalog.java
@@ -54,7 +54,7 @@ public class FxmlSchemaCatalog implements CatalogReader, CatalogDescriptor2, Ent
private Map<String, String> publicIdMap;
public FxmlSchemaCatalog() {
- Map m = new HashMap<String, String>();
+ Map<String, String> m = new HashMap<>();
m.put(FXML_INSTANCE_URI, FXML_INSTANCE_LOCAL);
m.put(FXML_INSTANCE_URI2, FXML_INSTANCE_LOCAL);
m.put(JavaFXEditorUtils.FXML_FX_NAMESPACE_CURRENT, FXML_INSTANCE_LOCAL);
diff --git a/platform/openide.util/src/org/openide/util/MapFormat.java b/platform/openide.util/src/org/openide/util/MapFormat.java
index da978ff734..2080eebc85 100644
--- a/platform/openide.util/src/org/openide/util/MapFormat.java
+++ b/platform/openide.util/src/org/openide/util/MapFormat.java
@@ -66,7 +66,7 @@ public class MapFormat extends Format {
private String rdel = "}"; // NOI18N
/** Used formatting map */
- private Map<String, Object> argmap;
+ private Map<String, ?> argmap;
/** Offsets to {} expressions */
private int[] offsets;
@@ -88,7 +88,7 @@ public class MapFormat extends Format {
* For common work use <code>format(pattern, arguments) </code>.
* @param arguments keys and values to use in the format
*/
- public MapFormat(Map arguments) {
+ public MapFormat(Map<String, ?> arguments) {
super();
setMap(arguments);
}
@@ -407,7 +407,7 @@ public class MapFormat extends Format {
*
* @param map the argument map
*/
- public void setMap(Map map) {
+ public void setMap(Map<String, ?> map) {
argmap = map;
}
diff --git a/webcommon/lib.v8debug/src/org/netbeans/lib/v8debug/connection/LinkedJSONObject.java b/webcommon/lib.v8debug/src/org/netbeans/lib/v8debug/connection/LinkedJSONObject.java
index 667b1d69e6..2bd66b7e8b 100644
--- a/webcommon/lib.v8debug/src/org/netbeans/lib/v8debug/connection/LinkedJSONObject.java
+++ b/webcommon/lib.v8debug/src/org/netbeans/lib/v8debug/connection/LinkedJSONObject.java
@@ -31,7 +31,7 @@ import org.json.simple.JSONObject;
*/
public class LinkedJSONObject extends JSONObject {
- LinkedHashMap linkedMap = new LinkedHashMap();
+ Map<Object, Object> linkedMap = new LinkedHashMap<>();
public LinkedJSONObject() {
}
@@ -44,7 +44,7 @@ public class LinkedJSONObject extends JSONObject {
@Override
public Object clone() {
LinkedJSONObject ljo = new LinkedJSONObject();
- ljo.linkedMap = (LinkedHashMap) linkedMap.clone();
+ ljo.linkedMap = new LinkedHashMap<>(linkedMap);
return ljo;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists