You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2021/09/22 17:03:03 UTC

[GitHub] [netbeans] matthiasblaesing commented on a change in pull request #3185: [NETBEANS-6045] - cleanup ArrayList warnings

matthiasblaesing commented on a change in pull request #3185:
URL: https://github.com/apache/netbeans/pull/3185#discussion_r714130342



##########
File path: enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/application/ApplicationProxy.java
##########
@@ -40,14 +45,13 @@
     public ApplicationProxy(Application app, String version) {
         this.app = app;
         this.version = version;
-        listeners = new java.util.ArrayList();
+        listeners = new ArrayList<>();
     }
 
     public void setOriginal(Application app) {
         if (this.app != app) {
             for (int i=0;i<listeners.size();i++) {
-                java.beans.PropertyChangeListener pcl = 
-                    (java.beans.PropertyChangeListener)listeners.get(i);
+                java.beans.PropertyChangeListener pcl = (PropertyChangeListener)listeners.get(i);

Review comment:
       ```suggestion
                   java.beans.PropertyChangeListener pcl = listeners.get(i);
   ```

##########
File path: enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/web/WebAppProxy.java
##########
@@ -46,15 +51,14 @@
     public WebAppProxy(WebApp webApp, String version) {
         this.webApp=webApp;
         this.version = version;
-        listeners = new java.util.ArrayList();
+        listeners = new ArrayList<>();
         addPropertyChangeListener(reindentationListener);
     }
 
     public void setOriginal(WebApp webApp) {
         if (this.webApp!=webApp) {
             for (int i=0;i<listeners.size();i++) {
-                java.beans.PropertyChangeListener pcl =
-                    (java.beans.PropertyChangeListener)listeners.get(i);
+                java.beans.PropertyChangeListener pcl = (PropertyChangeListener)listeners.get(i);

Review comment:
       ```suggestion
                   java.beans.PropertyChangeListener pcl = listeners.get(i);
   ```

##########
File path: ide/db.sql.visualeditor/src/org/netbeans/modules/db/sql/visualeditor/querybuilder/QueryBuilder.java
##########
@@ -1182,7 +1182,7 @@ void executeQuery(String query) {
             }
             else if (paramCount != 0) {
                 // we have a query which can not be parsed.
-                ArrayList  list = new ArrayList(paramCount);
+                List list = new ArrayList<>(paramCount);

Review comment:
       This is unused (or only used for a bogus debug call) I would drop it.

##########
File path: enterprise/j2ee.dd/src/org/netbeans/modules/j2ee/dd/impl/ejb/EjbJarProxy.java
##########
@@ -50,15 +54,15 @@
     public EjbJarProxy(EjbJar ejbJar, String version) {
         this.ejbJar=ejbJar;
         this.version = version;
-        listeners = new java.util.ArrayList();
+        listeners = new ArrayList<>();
         addPropertyChangeListener(reindentationListener);
     }
 
     public void setOriginal(EjbJar ejbJar) {
         if (this.ejbJar!=ejbJar) {
             for (int i=0;i<listeners.size();i++) {
                 java.beans.PropertyChangeListener pcl =
-                    (java.beans.PropertyChangeListener)listeners.get(i);
+                    (PropertyChangeListener)listeners.get(i);

Review comment:
       ```suggestion
                       listeners.get(i);
   ```
   
   and fold the two lines into one.

##########
File path: ide/db.sql.visualeditor/src/org/netbeans/modules/db/sql/visualeditor/querybuilder/QueryBuilder.java
##########
@@ -889,7 +889,7 @@ private boolean checkOrderBy()  throws SQLException {
     //    case 3 : <alias_table_name>.<column_name>
     //    case 4 : <column_name>
     //
-    private boolean checkColumns( ArrayList columns )  throws SQLException {
+    private boolean checkColumns(List columns)  throws SQLException {

Review comment:
       How about making this a `List<Column>` and then get rid of the raw types in 792, 813, 828, 843 and 857?

##########
File path: ide/jellytools.ide/src/org/netbeans/jellytools/EditorOperator.java
##########
@@ -649,7 +650,7 @@ public Object launch() {
                     Class annotationsClass = Class.forName("org.netbeans.editor.Annotations");
                     Field lineAnnotationsArrayField = annotationsClass.getDeclaredField("lineAnnotationsArray");
                     lineAnnotationsArrayField.setAccessible(true);
-                    ArrayList lineAnnotationsArray = (ArrayList) lineAnnotationsArrayField.get(getAnnotationsInstance());
+                    List lineAnnotationsArray = (ArrayList) lineAnnotationsArrayField.get(getAnnotationsInstance());

Review comment:
       ```suggestion
                       List lineAnnotationsArray = (List) lineAnnotationsArrayField.get(getAnnotationsInstance());
   ```

##########
File path: enterprise/j2ee.dd.webservice/src/org/netbeans/modules/j2ee/dd/impl/webservices/WebServicesProxy.java
##########
@@ -42,14 +45,14 @@
     public WebServicesProxy(Webservices webService, String version) {
         this.webSvc = webService;
         this.version = version;
-        listeners = new java.util.ArrayList();
+        listeners = new ArrayList<>();
     }
 
     public void setOriginal(Webservices webSvc) {
         if (this.webSvc != webSvc) {
             for (int i=0;i<listeners.size();i++) {
-                java.beans.PropertyChangeListener pcl = 
-                    (java.beans.PropertyChangeListener)listeners.get(i);
+                PropertyChangeListener pcl = 
+                    (PropertyChangeListener)listeners.get(i);

Review comment:
       ```suggestion
                   PropertyChangeListener pcl = listeners.get(i);
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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