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 5cb5afea64 Installed some internal generics to fix some compiler 
warnings
     new 0c8313ebfd Merge pull request #5576 from tbw777/g2
5cb5afea64 is described below

commit 5cb5afea64e4b061b0e652888632138e3b386715
Author: Andrey Bruykhov <andreybr...@gmail.com>
AuthorDate: Tue Feb 28 13:25:55 2023 +0300

    Installed some internal generics to fix some compiler warnings
---
 .../j2ee/weblogic9/deploy/WLTargetModuleID.java    |  2 +-
 .../web/core/syntax/ErrorAnnotationImpl.java       |  2 +-
 .../variablesfilterring/JSPVariablesFilter.java    |  4 ++--
 .../netbeans/lib/ddl/impl/ProcedureArgument.java   |  4 ++--
 .../modules/editor/fold/CustomFoldManager.java     |  8 +++----
 .../netbeans/editor/ext/KeywordMatchGenerator.java |  6 +++---
 .../base/org/netbeans/editor/example/Editor.java   | 18 ++++++++--------
 .../org/netbeans/modules/lexer/gen/TokenTypes.java | 25 +++++++++++-----------
 .../AbstractCodeGeneratorClass.java                | 12 +++++------
 .../modules/xml/text/completion/IconStore.java     |  6 +++---
 .../debugger/jpda/ui/models/MonitorModel.java      |  2 +-
 .../javafx2/project/ui/PlatformsComboBoxModel.java |  2 +-
 .../explorer/view/ContextTreeViewModelTest.java    |  2 +-
 .../lib/profiler/common/ProfilingSettings.java     | 16 +++++++-------
 .../lib/profiler/classfile/ClassFileCache.java     | 24 ++++++++++-----------
 15 files changed, 66 insertions(+), 67 deletions(-)

diff --git 
a/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/deploy/WLTargetModuleID.java
 
b/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/deploy/WLTargetModuleID.java
index d305a58136..68ca0a0942 100644
--- 
a/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/deploy/WLTargetModuleID.java
+++ 
b/contrib/j2ee.weblogic9/src/org/netbeans/modules/j2ee/weblogic9/deploy/WLTargetModuleID.java
@@ -45,7 +45,7 @@ public class WLTargetModuleID implements WebTargetModuleID {
 
     private String contextUrl;
 
-    private List children = new ArrayList();
+    private List<WLTargetModuleID> children = new ArrayList<>();
 
     private TargetModuleID  parent;
 
diff --git 
a/enterprise/web.core.syntax/src/org/netbeans/modules/web/core/syntax/ErrorAnnotationImpl.java
 
b/enterprise/web.core.syntax/src/org/netbeans/modules/web/core/syntax/ErrorAnnotationImpl.java
index d3a511ab4c..f11c5bfa2e 100644
--- 
a/enterprise/web.core.syntax/src/org/netbeans/modules/web/core/syntax/ErrorAnnotationImpl.java
+++ 
b/enterprise/web.core.syntax/src/org/netbeans/modules/web/core/syntax/ErrorAnnotationImpl.java
@@ -61,7 +61,7 @@ public class ErrorAnnotationImpl implements ErrorAnnotation {
     /** Jsp file, for which is the ErrorAnnotation */
     private FileObject jspFo;
     
-    private List annotations;
+    private List<LineSetAnnotation> annotations;
     
     /** Creates a new instance of ErrorAnnotation */
     public ErrorAnnotationImpl(FileObject jspFo) {
diff --git 
a/enterprise/web.debug/src/org/netbeans/modules/web/debug/variablesfilterring/JSPVariablesFilter.java
 
b/enterprise/web.debug/src/org/netbeans/modules/web/debug/variablesfilterring/JSPVariablesFilter.java
index 293fb5c0e3..612e909131 100644
--- 
a/enterprise/web.debug/src/org/netbeans/modules/web/debug/variablesfilterring/JSPVariablesFilter.java
+++ 
b/enterprise/web.debug/src/org/netbeans/modules/web/debug/variablesfilterring/JSPVariablesFilter.java
@@ -320,12 +320,12 @@ public class JSPVariablesFilter implements 
TreeModelFilter {
     
     public static class ImplicitLocals {
         private List locals = new ArrayList ();
-        private static HashSet localsNames = null;
+        private static HashSet<String> localsNames = null;
 
         public static boolean isImplicitLocal(String aLocalName) {
 
             if (localsNames == null) {
-                localsNames = new HashSet();
+                localsNames = new HashSet<>();
                 localsNames.add("application");
                 localsNames.add("config");
                 localsNames.add("out");
diff --git a/ide/db/libsrc/org/netbeans/lib/ddl/impl/ProcedureArgument.java 
b/ide/db/libsrc/org/netbeans/lib/ddl/impl/ProcedureArgument.java
index 83db1ace52..4fdbfeeaed 100644
--- a/ide/db/libsrc/org/netbeans/lib/ddl/impl/ProcedureArgument.java
+++ b/ide/db/libsrc/org/netbeans/lib/ddl/impl/ProcedureArgument.java
@@ -45,7 +45,7 @@ public class ProcedureArgument implements Argument {
     private String format;
 
     /** Additional properties */
-    private Map addprops;
+    private Map<String, Object> addprops;
 
     public static String getArgumentTypeName(int type)
     {
@@ -92,7 +92,7 @@ public class ProcedureArgument implements Argument {
     /** Sets general property */
     public void setProperty(String pname, Object pval)
     {
-        if (addprops == null) addprops = new HashMap();
+        if (addprops == null) addprops = new HashMap<>();
         addprops.put(pname, pval);
     }
 
diff --git 
a/ide/editor.fold/src/org/netbeans/modules/editor/fold/CustomFoldManager.java 
b/ide/editor.fold/src/org/netbeans/modules/editor/fold/CustomFoldManager.java
index 88a7badd6f..101cac7970 100644
--- 
a/ide/editor.fold/src/org/netbeans/modules/editor/fold/CustomFoldManager.java
+++ 
b/ide/editor.fold/src/org/netbeans/modules/editor/fold/CustomFoldManager.java
@@ -60,7 +60,7 @@ public final class CustomFoldManager implements FoldManager, 
Runnable {
     private int minUpdateMarkOffset = Integer.MAX_VALUE;
     private int maxUpdateMarkOffset = -1;
     private List removedFoldList;
-    private HashMap customFoldId = new HashMap();
+    private HashMap<String, Boolean> customFoldId = new HashMap<>();
 
     private static final RequestProcessor RP = new 
RequestProcessor(CustomFoldManager.class.getName(),
             1, false, false);
@@ -188,7 +188,7 @@ public final class CustomFoldManager implements 
FoldManager, Runnable {
                 Fold removedFold = (Fold)removedFoldList.get(i);
                 FoldMarkInfo startMark = 
(FoldMarkInfo)getOperation().getExtraInfo(removedFold);
                 if (startMark.getId() != null)
-                    customFoldId.put(startMark.getId(), 
Boolean.valueOf(removedFold.isCollapsed())); // remember the last fold's state 
before remove
+                    customFoldId.put(startMark.getId(), 
removedFold.isCollapsed()); // remember the last fold's state before remove
                 FoldMarkInfo endMark = startMark.getPairMark(); // get prior 
releasing
                 if (getOperation().isStartDamaged(removedFold)) { // start 
mark area was damaged
                     startMark.release(true, transaction); // forced remove
@@ -481,9 +481,9 @@ public final class CustomFoldManager implements 
FoldManager, Runnable {
                     if (matcher.group(2) != null) { // fold's id exists
                         Boolean collapsed = 
(Boolean)customFoldId.get(matcher.group(2));
                         if (collapsed != null)
-                            state = collapsed.booleanValue(); // fold's state 
is already known from the past
+                            state = collapsed; // fold's state is already 
known from the past
                         else
-                            customFoldId.put(matcher.group(2), 
Boolean.valueOf(state));
+                            customFoldId.put(matcher.group(2), state);
                     }
                     return new FoldMarkInfo(true, token.offset(null), 
matcher.end(0), matcher.group(2), state, matcher.group(4)); // NOI18N
                 } else { // fold's end mark found
diff --git 
a/ide/editor.lib/src/org/netbeans/editor/ext/KeywordMatchGenerator.java 
b/ide/editor.lib/src/org/netbeans/editor/ext/KeywordMatchGenerator.java
index 339d42bb23..fc9a9691e5 100644
--- a/ide/editor.lib/src/org/netbeans/editor/ext/KeywordMatchGenerator.java
+++ b/ide/editor.lib/src/org/netbeans/editor/ext/KeywordMatchGenerator.java
@@ -67,9 +67,9 @@ public class KeywordMatchGenerator {
     private int maxKwdLen;
 
     /** Options */
-    private HashMap options = new HashMap();
+    private HashMap<String, String> options = new HashMap<>();
 
-    private HashMap kwdConstants = new HashMap();
+    private HashMap<String, String> kwdConstants = new HashMap<>();
 
     /** Provide indentation (default 2 spaces) */
     private String indent(int cnt) {
@@ -124,7 +124,7 @@ public class KeywordMatchGenerator {
     }
 
     protected String getKwdConstant(String kwd) {
-        return (String)kwdConstants.get(kwd);
+        return kwdConstants.get(kwd);
     }
 
     protected boolean upperCaseKeyConstants() {
diff --git a/ide/editor/demosrc/base/org/netbeans/editor/example/Editor.java 
b/ide/editor/demosrc/base/org/netbeans/editor/example/Editor.java
index 0a81e74544..c1acb0b7ae 100644
--- a/ide/editor/demosrc/base/org/netbeans/editor/example/Editor.java
+++ b/ide/editor/demosrc/base/org/netbeans/editor/example/Editor.java
@@ -75,7 +75,7 @@ public class Editor extends javax.swing.JFrame {
     private boolean safeSave;
 
     private int fileCounter = -1;
-    Map com2text = new HashMap();
+    private Map<Component, JTextComponent> com2text = new HashMap<>();
     
     private Impl impl = new Impl("org.netbeans.editor.Bundle"); // NOI18N
     
@@ -258,7 +258,7 @@ public class Editor extends javax.swing.JFrame {
     private boolean saveFile( Component comp, File file, boolean 
checkOverwrite ) {
         if( comp == null ) return false;
         tabPane.setSelectedComponent( comp );
-        JTextComponent edit = (JTextComponent)com2text.get( comp );
+        JTextComponent edit = com2text.get( comp );
         Document doc = edit.getDocument();
         
         if( checkOverwrite && file.exists() ) {
@@ -326,7 +326,7 @@ public class Editor extends javax.swing.JFrame {
     
     private boolean saveFile( Component comp ) {
         if( comp == null ) return false;
-        JTextComponent edit = (JTextComponent)com2text.get( comp );
+        JTextComponent edit = com2text.get( comp );
         Document doc = edit.getDocument();
         File file = (File)doc.getProperty( FILE );
         boolean created = ((Boolean)doc.getProperty( CREATED )).booleanValue();
@@ -336,7 +336,7 @@ public class Editor extends javax.swing.JFrame {
     
     private boolean saveAs( Component comp ) {
         if( comp == null ) return false;
-        JTextComponent edit = (JTextComponent)com2text.get( comp );
+        JTextComponent edit = com2text.get( comp );
         File file = (File)edit.getDocument().getProperty( FILE );
         
         fileChooser.setCurrentDirectory( file.getParentFile() );
@@ -399,7 +399,7 @@ public class Editor extends javax.swing.JFrame {
     }
 
     private void doCloseEditor(Component editor) {
-        JTextComponent editorPane = (JTextComponent ) com2text.get(editor);
+        JTextComponent editorPane = com2text.get(editor);
         if (editorPane != null) {
             File file = (File) editorPane.getDocument().getProperty(FILE);
 
@@ -412,7 +412,7 @@ public class Editor extends javax.swing.JFrame {
 
     private boolean checkClose( Component comp ) {
         if( comp == null ) return false;
-        JTextComponent edit = (JTextComponent)com2text.get( comp );
+        JTextComponent edit = com2text.get( comp );
         Document doc = edit.getDocument();
         
         Object mod = doc.getProperty( MODIFIED );
@@ -523,14 +523,14 @@ public class Editor extends javax.swing.JFrame {
     private int        separatorIndex;
     
     private String[] getOpenedFiles() {
-        ArrayList opened = new ArrayList();
+        List<String> opened = new ArrayList<>();
 
         int components = tabPane.getComponentCount();
 
         for (int cntr = 0; cntr < components; cntr++) {
             Component editorComponent = tabPane.getComponentAt( cntr );
 
-            JTextComponent editor = (JTextComponent) 
com2text.get(editorComponent);
+            JTextComponent editor = com2text.get(editorComponent);
            
            if (editor == null) {
                continue;
@@ -544,7 +544,7 @@ public class Editor extends javax.swing.JFrame {
             }
         }
        
-        return (String []) opened.toArray(new String[opened.size()]);
+        return opened.toArray(new String[opened.size()]);
     }
     
     private int findInRecent(String fileToFind) {
diff --git a/ide/lexer/gen/src/org/netbeans/modules/lexer/gen/TokenTypes.java 
b/ide/lexer/gen/src/org/netbeans/modules/lexer/gen/TokenTypes.java
index 0f7ebeb6f8..0eb9914157 100644
--- a/ide/lexer/gen/src/org/netbeans/modules/lexer/gen/TokenTypes.java
+++ b/ide/lexer/gen/src/org/netbeans/modules/lexer/gen/TokenTypes.java
@@ -55,10 +55,10 @@ public class TokenTypes {
     private boolean inspected;
 
     /** Map of [tokenTypeName, tokenTypeValue] */
-    protected final Map name2value = new HashMap();
+    protected final Map<String, Integer> name2value = new HashMap<>();
     
     /** Map of [tokenTypeValue, tokenTypeName] */
-    protected final Map value2name = new HashMap();
+    protected final Map<Integer, String> value2name = new HashMap<>();
     
     public TokenTypes(Class tokenTypesClass) {
         this.tokenTypesClass = tokenTypesClass;
@@ -74,8 +74,8 @@ public class TokenTypes {
     protected void updateData(LanguageData languageData) {
         inspect();
 
-        for (Iterator it = tokenTypeNamesIterator(); it.hasNext();) {
-            String tokenTypeName = (String)it.next();
+        for (Iterator<String> it = tokenTypeNamesIterator(); it.hasNext();) {
+            String tokenTypeName = it.next();
             MutableTokenId id = 
languageData.findIdByTokenTypeName(tokenTypeName);
             
             if (id == null) {
@@ -120,19 +120,19 @@ public class TokenTypes {
     public Integer getTokenTypeValue(String tokenTypeName) {
         inspect();
 
-        return (Integer)name2value.get(tokenTypeName);
+        return name2value.get(tokenTypeName);
     }
 
     public String getTokenTypeName(int tokenTypeValue) {
         inspect();
 
-        return (String)value2name.get(Integer.valueOf(tokenTypeValue));
+        return value2name.get(Integer.valueOf(tokenTypeValue));
     }
 
     /**
      * @return all the field names 
      */
-    public Iterator tokenTypeNamesIterator() {
+    public Iterator<String> tokenTypeNamesIterator() {
         inspect();
 
         return name2value.keySet().iterator();
@@ -143,9 +143,9 @@ public class TokenTypes {
         inspect();
 
         int maxValue = 0;
-        for (Iterator it = value2name.keySet().iterator(); it.hasNext();) {
-            Integer i = (Integer)it.next();
-            maxValue = Math.max(maxValue, i.intValue());
+        for (Iterator<Integer> it = value2name.keySet().iterator(); 
it.hasNext();) {
+            Integer i = it.next();
+            maxValue = Math.max(maxValue, i);
         }
         return maxValue;
     }
@@ -177,9 +177,8 @@ public class TokenTypes {
                     int value = f.getInt(null);
                     String fieldName = f.getName();
                     if (isAccepted(fieldName, value)) {
-                        Integer valueInteger = Integer.valueOf(value);
-                        name2value.put(fieldName, valueInteger);
-                        value2name.put(valueInteger, fieldName);
+                        name2value.put(fieldName, value);
+                        value2name.put(value, fieldName);
                     }
                 }
             }
diff --git 
a/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/AbstractCodeGeneratorClass.java
 
b/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/AbstractCodeGeneratorClass.java
index 5720d77546..19eff6cc7b 100644
--- 
a/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/AbstractCodeGeneratorClass.java
+++ 
b/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/AbstractCodeGeneratorClass.java
@@ -501,12 +501,12 @@ public abstract class AbstractCodeGeneratorClass {
 
     JavaWriter jw;
 
-    private Map mutableTypes = new HashMap();
-    private Map needToCallClone = new HashMap();
+    private Map<String, Boolean> mutableTypes = new HashMap<>();
+    private Map<String, Boolean> needToCallClone = new HashMap<>();
 
     protected boolean isMutableType(Property prop) {
         String type = prop.getType();
-        Boolean mutable = (Boolean) mutableTypes.get(type);
+        Boolean mutable = mutableTypes.get(type);
         if (mutable == null) {
             if (prop.isBean)
                 mutable = Boolean.TRUE;
@@ -516,12 +516,12 @@ public abstract class AbstractCodeGeneratorClass {
                 mutable = Boolean.TRUE;
             mutableTypes.put(type, mutable);
         }
-        return mutable.booleanValue();
+        return mutable;
     }
 
     protected boolean isCloneCallNeededOnType(Property prop) {
         String type = prop.getType();
-        Boolean callClone = (Boolean) needToCallClone.get(type);
+        Boolean callClone = needToCallClone.get(type);
         if (callClone == null) {
             if (prop.isBean || !isMutableType(prop))
                 callClone = Boolean.FALSE;
@@ -529,7 +529,7 @@ public abstract class AbstractCodeGeneratorClass {
                 callClone = JavaUtil.isCloneable(type) ? Boolean.TRUE : 
Boolean.FALSE;
             needToCallClone.put(type, callClone);
         }
-        return callClone.booleanValue();
+        return callClone;
     }
 
     protected boolean genCopyWillCopy(Property a) {
diff --git 
a/ide/xml.text/src/org/netbeans/modules/xml/text/completion/IconStore.java 
b/ide/xml.text/src/org/netbeans/modules/xml/text/completion/IconStore.java
index d46850e74b..95b933c378 100644
--- a/ide/xml.text/src/org/netbeans/modules/xml/text/completion/IconStore.java
+++ b/ide/xml.text/src/org/netbeans/modules/xml/text/completion/IconStore.java
@@ -51,7 +51,7 @@ final class IconStore extends Object {
 
     /** HashMap{@link java.util.HashMap } that acts as a store for the icons.
      */    
-    private static HashMap iconsMap = new HashMap();
+    private static HashMap<String, ImageIcon> iconsMap = new HashMap<>();
     
     /** Main method to retrieve the ImageIcon{@link javax.swing.ImageIcon}
      * @param name Name of the icon to retrieve. In most instances would be 
one of the variables of
@@ -64,10 +64,10 @@ final class IconStore extends Object {
         name = SPACER_16;
       
         if(iconsMap.containsKey(name))
-            return (ImageIcon)iconsMap.get(name);
+            return iconsMap.get(name);
         else{
             iconsMap.put(name, new ImageIcon(IconStore.class.getResource(name 
+ ICON_SUFFIX)));
-            return (ImageIcon)iconsMap.get(name);
+            return iconsMap.get(name);
         }
     }
 }
diff --git 
a/java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/models/MonitorModel.java
 
b/java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/models/MonitorModel.java
index bc221df36f..6e01c79966 100644
--- 
a/java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/models/MonitorModel.java
+++ 
b/java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/models/MonitorModel.java
@@ -207,7 +207,7 @@ NodeActionsProviderFilter, TableModel, Constants {
         return model.getDisplayName (o);
     }
     
-    private Map shortDescriptionMap = new HashMap();
+    private Map<Object, Object> shortDescriptionMap = new HashMap<>();
     
     public String getShortDescription (final NodeModel model, final Object o) 
throws 
     UnknownTypeException {
diff --git 
a/javafx/javafx2.project/src/org/netbeans/modules/javafx2/project/ui/PlatformsComboBoxModel.java
 
b/javafx/javafx2.project/src/org/netbeans/modules/javafx2/project/ui/PlatformsComboBoxModel.java
index 4c35f1246f..3a0ddc884f 100644
--- 
a/javafx/javafx2.project/src/org/netbeans/modules/javafx2/project/ui/PlatformsComboBoxModel.java
+++ 
b/javafx/javafx2.project/src/org/netbeans/modules/javafx2/project/ui/PlatformsComboBoxModel.java
@@ -68,7 +68,7 @@ public class PlatformsComboBoxModel implements ComboBoxModel {
         delegate.removeListDataListener(l);
     }
     
-    private List getData() {
+    private List<Object> getData() {
         List<Object> data = new ArrayList<Object>();
         int origSize = delegate.getSize();
         for (int i = 0; i < origSize; i++) {
diff --git 
a/platform/openide.explorer/test/unit/src/org/openide/explorer/view/ContextTreeViewModelTest.java
 
b/platform/openide.explorer/test/unit/src/org/openide/explorer/view/ContextTreeViewModelTest.java
index e30d59adf9..ce1e0aba74 100644
--- 
a/platform/openide.explorer/test/unit/src/org/openide/explorer/view/ContextTreeViewModelTest.java
+++ 
b/platform/openide.explorer/test/unit/src/org/openide/explorer/view/ContextTreeViewModelTest.java
@@ -302,7 +302,7 @@ public class ContextTreeViewModelTest extends NbTestCase {
 
 
         private TreeNode keep;
-        private List all = new ArrayList();
+        private List<TreeNode> all = new ArrayList<>();
 
         public Listener(TreeNode keep) {
             this.keep = keep;
diff --git 
a/profiler/lib.profiler.common/src/org/netbeans/lib/profiler/common/ProfilingSettings.java
 
b/profiler/lib.profiler.common/src/org/netbeans/lib/profiler/common/ProfilingSettings.java
index 1b095931d5..8ae32aa383 100644
--- 
a/profiler/lib.profiler.common/src/org/netbeans/lib/profiler/common/ProfilingSettings.java
+++ 
b/profiler/lib.profiler.common/src/org/netbeans/lib/profiler/common/ProfilingSettings.java
@@ -104,10 +104,10 @@ public class ProfilingSettings {
 
     // CPU Profiling: Code Fragment
     private ClientUtils.SourceCodeSelection fragmentSelection = null;
-    private List instrumentationMarkerMethods = new ArrayList();
+    private List<ClientUtils.SourceCodeSelection> instrumentationMarkerMethods 
= new ArrayList<>();
 
     // CPU Profiling: Part of Application
-    private List instrumentationRootMethods = new ArrayList();
+    private List<ClientUtils.SourceCodeSelection> instrumentationRootMethods = 
new ArrayList<>();
 
     // CPU instrumentation filter related settings
     private GenericFilter instrumentationFilter = new GenericFilter();
@@ -334,17 +334,17 @@ public class ProfilingSettings {
     }
 
     public ClientUtils.SourceCodeSelection[] getInstrumentationMarkerMethods() 
{
-        return (ClientUtils.SourceCodeSelection[]) 
instrumentationMarkerMethods.toArray(new ClientUtils.SourceCodeSelection[0]);
+        return instrumentationMarkerMethods.toArray(new 
ClientUtils.SourceCodeSelection[0]);
     }
 
     public ClientUtils.SourceCodeSelection[] getInstrumentationMethods() {
-        Set methods = new HashSet();
+        Set<ClientUtils.SourceCodeSelection> methods = new HashSet<>();
         // Keep the order:
         // 1. Root methods; 2. Marker methods
         methods.addAll(instrumentationRootMethods);
         methods.addAll(instrumentationMarkerMethods);
 
-        return (ClientUtils.SourceCodeSelection[]) methods.toArray(new 
ClientUtils.SourceCodeSelection[0]);
+        return methods.toArray(new ClientUtils.SourceCodeSelection[0]);
     }
 
     public void setInstrumentationRootMethods(final 
ClientUtils.SourceCodeSelection[] roots) {
@@ -360,7 +360,7 @@ public class ProfilingSettings {
     }
 
     public ClientUtils.SourceCodeSelection[] getInstrumentationRootMethods() {
-        return (ClientUtils.SourceCodeSelection[]) 
instrumentationRootMethods.toArray(new ClientUtils.SourceCodeSelection[0]);
+        return instrumentationRootMethods.toArray(new 
ClientUtils.SourceCodeSelection[0]);
     }
     
     public void setSamplingFrequency(int samplingFrequency) {
@@ -898,14 +898,14 @@ public class ProfilingSettings {
 
         for (int i = 0; i < instrumentationRootMethods.size(); i++) {
             props.put(prefix + PROP_INSTRUMENTATION_ROOT_METHODS_PREFIX + i,
-                      
ClientUtils.selectionToString((ClientUtils.SourceCodeSelection) 
instrumentationRootMethods.get(i)));
+                      
ClientUtils.selectionToString(instrumentationRootMethods.get(i)));
         }
 
         props.put(prefix + PROP_INSTRUMENTATION_MARKER_METHODS_SIZE, 
Integer.toString(instrumentationMarkerMethods.size()));
 
         for (int i = 0; i < instrumentationMarkerMethods.size(); i++) {
             props.put(prefix + PROP_INSTRUMENTATION_MARKER_METHODS_PREFIX + i,
-                      
ClientUtils.selectionToString((ClientUtils.SourceCodeSelection) 
instrumentationMarkerMethods.get(i)));
+                      
ClientUtils.selectionToString(instrumentationMarkerMethods.get(i)));
         }
 
         // CPU Profiling: Code Fragment
diff --git 
a/profiler/lib.profiler/src/org/netbeans/lib/profiler/classfile/ClassFileCache.java
 
b/profiler/lib.profiler/src/org/netbeans/lib/profiler/classfile/ClassFileCache.java
index 36d06d382f..ec1058678c 100644
--- 
a/profiler/lib.profiler/src/org/netbeans/lib/profiler/classfile/ClassFileCache.java
+++ 
b/profiler/lib.profiler/src/org/netbeans/lib/profiler/classfile/ClassFileCache.java
@@ -50,7 +50,7 @@ public class ClassFileCache {
     //~ Instance fields 
----------------------------------------------------------------------------------------------------------
 
     private ClassPath classPath; // Used to quickly obtain an open JAR file 
for a given name
-    private Hashtable vmSuppliedClassCache;
+    private Hashtable<String, byte[]> vmSuppliedClassCache;
     private byte[][] classFileBytes;
     private String[] classNameAndLocation;
     private long[] lastTimeUsed;
@@ -58,8 +58,8 @@ public class ClassFileCache {
     private int size;
     private int sizeLimit;
     private long timeCounter;
-    private List preloadNames;
-    private List preloadLoaderIds;
+    private List<String> preloadNames;
+    private List<Integer> preloadLoaderIds;
 
     //~ Constructors 
-------------------------------------------------------------------------------------------------------------
 
@@ -72,9 +72,9 @@ public class ClassFileCache {
         classFileBytes = new byte[capacity][];
         lastTimeUsed = new long[capacity];
 
-        vmSuppliedClassCache = new Hashtable();
-        preloadNames = new ArrayList();
-        preloadLoaderIds = new ArrayList();
+        vmSuppliedClassCache = new Hashtable<>();
+        preloadNames = new ArrayList<>();
+        preloadLoaderIds = new ArrayList<>();
     }
 
     //~ Methods 
------------------------------------------------------------------------------------------------------------------
@@ -96,7 +96,7 @@ public class ClassFileCache {
         byte[] res;
 
         if (location.startsWith(ClassRepository.LOCATION_VMSUPPLIED)) {
-            res = (byte[]) vmSuppliedClassCache.get(nameAndLocation);
+            res = vmSuppliedClassCache.get(nameAndLocation);
             if (res != null && res.length == 0) {
                 try {
                     // known class without bytecode; get it from TA
@@ -104,10 +104,10 @@ public class ClassFileCache {
                     if (!preloadNames.contains(name)) {
                         preloadBytecode(name, location);
                     }
-                    String names[] = (String[]) preloadNames.toArray(new 
String[0]);
+                    String names[] = preloadNames.toArray(new String[0]);
                     int loadersId[] = new int[preloadLoaderIds.size()];
                     for (int i=0; i<loadersId.length; i++) {
-                        loadersId[i] = 
((Integer)preloadLoaderIds.get(i)).intValue();
+                        loadersId[i] = preloadLoaderIds.get(i);
                     }
                     //System.out.println("Caching "+names.length+" classes");
                     byte[][] bytes = client.getCachedClassFileBytes(names, 
loadersId);
@@ -119,9 +119,9 @@ public class ClassFileCache {
                             
vmSuppliedClassCache.put(getNameAndLocation(names[i],loadersId[i]), res);
                         }
                     }
-                    preloadNames = new ArrayList();
-                    preloadLoaderIds = new ArrayList();
-                    res = (byte[]) vmSuppliedClassCache.get(nameAndLocation);
+                    preloadNames = new ArrayList<>();
+                    preloadLoaderIds = new ArrayList<>();
+                    res = vmSuppliedClassCache.get(nameAndLocation);
                     if (res.length == 0) {
                         throw new IOException("Get class file for " + name + " 
not found in TA");
                     }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to