[jenkinsci/cloudbees-folder-plugin] 7560e3: Fix IDE warnings about unimplemented `onRenamed` a...
Branch: refs/heads/type-erasure-warnings Home: https://github.com/jenkinsci/cloudbees-folder-plugin Commit: 7560e30e94d7c4081718b8a87b6b37f65716da7c https://github.com/jenkinsci/cloudbees-folder-plugin/commit/7560e30e94d7c4081718b8a87b6b37f65716da7c Author: Stephen Connolly Date: 2016-11-17 (Thu, 17 Nov 2016) Changed paths: M src/main/java/com/cloudbees/hudson/plugins/folder/AbstractFolder.java Log Message: --- Fix IDE warnings about unimplemented `onRenamed` and `onDeleted` methods - The type erasure means that the methods are the same - The generated bytecode only assumes `TopLevelItem` as the class: ``` public void onRenamed(I, java.lang.String, java.lang.String) throws java.io.IOException; Code: 0: aload_0 1: getfield #24 // Field items:Ljava/util/Map; 4: aload_2 5: invokeinterface #178, 2 // InterfaceMethod java/util/Map.remove:(Ljava/lang/Object;)Ljava/lang/Object; 10: pop 11: aload_0 12: getfield #24 // Field items:Ljava/util/Map; 15: aload_3 16: aload_1 17: invokeinterface #179, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; 22: pop 23: aload_0 24: getfield #6 // Field views:Ljava/util/concurrent/CopyOnWriteArrayList; 27: invokevirtual #180// Method java/util/concurrent/CopyOnWriteArrayList.iterator:()Ljava/util/Iterator; 30: astore4 32: aload 4 34: invokeinterface #30, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z 39: ifeq 65 42: aload 4 44: invokeinterface #31, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object; 49: checkcast #124// class hudson/model/View 52: astore5 54: aload 5 56: aload_1 57: aload_2 58: aload_3 59: invokevirtual #181// Method hudson/model/View.onJobRenamed:(Lhudson/model/Item;Ljava/lang/String;Ljava/lang/String;)V 62: goto 32 65: aload_0 66: invokevirtual #182// Method save:()V 69: return public void onDeleted(I) throws java.io.IOException; Code: 0: aload_1 1: invokestatic #183// Method hudson/model/listeners/ItemListener.fireOnDeleted:(Lhudson/model/Item;)V 4: aload_0 5: getfield #24 // Field items:Ljava/util/Map; 8: aload_1 9: invokeinterface #96, 1 // InterfaceMethod hudson/model/TopLevelItem.getName:()Ljava/lang/String; 14: invokeinterface #178, 2 // InterfaceMethod java/util/Map.remove:(Ljava/lang/Object;)Ljava/lang/Object; 19: pop 20: aload_0 21: getfield #6 // Field views:Ljava/util/concurrent/CopyOnWriteArrayList; 24: invokevirtual #180// Method java/util/concurrent/CopyOnWriteArrayList.iterator:()Ljava/util/Iterator; 27: astore_2 28: aload_2 29: invokeinterface #30, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z 34: ifeq 62 37: aload_2 38: invokeinterface #31, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object; 43: checkcast #124// class hudson/model/View 46: astore_3 47: aload_3 48: aload_1 49: aload_1 50: invokeinterface #96, 1 // InterfaceMethod hudson/model/TopLevelItem.getName:()Ljava/lang/String; 55: aconst_null 56: invokevirtual #181// Method hudson/model/View.onJobRenamed:(Lhudson/model/Item;Ljava/lang/String;Ljava/lang/String;)V 59: goto 28 62: aload_0 63: invokevirtual #182// Method save:()V 66: return ``` - We have synthetic `onDeleted(Item)` and `onRenamed(Item,String,String)` anyway (though unclear where they come from)``` Compiled from "AbstractFolder.java" public abstract class com.cloudbees.hudson.plugins.folder.AbstractFolder extends hudson.model.AbstractItem implements hudson.model.TopLevelItem, hudson.model.ItemGroup, hudson.model.ModifiableViewGroup, org.kohsuke.stapler.StaplerFallback, jenkins.model.ModelObjectWithChildren, org.kohsuke.stapler.StaplerOverridable { protected transient java.util.Map items; public static void loadJobTotal(); protected com.cloudbees.hudson.plugins.folder.AbstractFolder(hudson.model.ItemGroup, java.lang.String); protected void init(); protected void initViews(java.util.List) throws java.io.IOException; public void addAction(hudson.model.Action); public void replaceAction(hudson.model.Action); public void onLoad(hudson.model.ItemGroup, java.lang.String) throws java.io.IOException; public com.cloudbees.hudson.plugins.folder.AbstractFolderDescriptor
[jenkinsci/cloudbees-folder-plugin] 7560e3: Fix IDE warnings about unimplemented `onRenamed` a...
Branch: refs/heads/master Home: https://github.com/jenkinsci/cloudbees-folder-plugin Commit: 7560e30e94d7c4081718b8a87b6b37f65716da7c https://github.com/jenkinsci/cloudbees-folder-plugin/commit/7560e30e94d7c4081718b8a87b6b37f65716da7c Author: Stephen Connolly Date: 2016-11-17 (Thu, 17 Nov 2016) Changed paths: M src/main/java/com/cloudbees/hudson/plugins/folder/AbstractFolder.java Log Message: --- Fix IDE warnings about unimplemented `onRenamed` and `onDeleted` methods - The type erasure means that the methods are the same - The generated bytecode only assumes `TopLevelItem` as the class: ``` public void onRenamed(I, java.lang.String, java.lang.String) throws java.io.IOException; Code: 0: aload_0 1: getfield #24 // Field items:Ljava/util/Map; 4: aload_2 5: invokeinterface #178, 2 // InterfaceMethod java/util/Map.remove:(Ljava/lang/Object;)Ljava/lang/Object; 10: pop 11: aload_0 12: getfield #24 // Field items:Ljava/util/Map; 15: aload_3 16: aload_1 17: invokeinterface #179, 3 // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; 22: pop 23: aload_0 24: getfield #6 // Field views:Ljava/util/concurrent/CopyOnWriteArrayList; 27: invokevirtual #180// Method java/util/concurrent/CopyOnWriteArrayList.iterator:()Ljava/util/Iterator; 30: astore4 32: aload 4 34: invokeinterface #30, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z 39: ifeq 65 42: aload 4 44: invokeinterface #31, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object; 49: checkcast #124// class hudson/model/View 52: astore5 54: aload 5 56: aload_1 57: aload_2 58: aload_3 59: invokevirtual #181// Method hudson/model/View.onJobRenamed:(Lhudson/model/Item;Ljava/lang/String;Ljava/lang/String;)V 62: goto 32 65: aload_0 66: invokevirtual #182// Method save:()V 69: return public void onDeleted(I) throws java.io.IOException; Code: 0: aload_1 1: invokestatic #183// Method hudson/model/listeners/ItemListener.fireOnDeleted:(Lhudson/model/Item;)V 4: aload_0 5: getfield #24 // Field items:Ljava/util/Map; 8: aload_1 9: invokeinterface #96, 1 // InterfaceMethod hudson/model/TopLevelItem.getName:()Ljava/lang/String; 14: invokeinterface #178, 2 // InterfaceMethod java/util/Map.remove:(Ljava/lang/Object;)Ljava/lang/Object; 19: pop 20: aload_0 21: getfield #6 // Field views:Ljava/util/concurrent/CopyOnWriteArrayList; 24: invokevirtual #180// Method java/util/concurrent/CopyOnWriteArrayList.iterator:()Ljava/util/Iterator; 27: astore_2 28: aload_2 29: invokeinterface #30, 1 // InterfaceMethod java/util/Iterator.hasNext:()Z 34: ifeq 62 37: aload_2 38: invokeinterface #31, 1 // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object; 43: checkcast #124// class hudson/model/View 46: astore_3 47: aload_3 48: aload_1 49: aload_1 50: invokeinterface #96, 1 // InterfaceMethod hudson/model/TopLevelItem.getName:()Ljava/lang/String; 55: aconst_null 56: invokevirtual #181// Method hudson/model/View.onJobRenamed:(Lhudson/model/Item;Ljava/lang/String;Ljava/lang/String;)V 59: goto 28 62: aload_0 63: invokevirtual #182// Method save:()V 66: return ``` - We have synthetic `onDeleted(Item)` and `onRenamed(Item,String,String)` anyway (though unclear where they come from)``` Compiled from "AbstractFolder.java" public abstract class com.cloudbees.hudson.plugins.folder.AbstractFolder extends hudson.model.AbstractItem implements hudson.model.TopLevelItem, hudson.model.ItemGroup, hudson.model.ModifiableViewGroup, org.kohsuke.stapler.StaplerFallback, jenkins.model.ModelObjectWithChildren, org.kohsuke.stapler.StaplerOverridable { protected transient java.util.Map items; public static void loadJobTotal(); protected com.cloudbees.hudson.plugins.folder.AbstractFolder(hudson.model.ItemGroup, java.lang.String); protected void init(); protected void initViews(java.util.List) throws java.io.IOException; public void addAction(hudson.model.Action); public void replaceAction(hudson.model.Action); public void onLoad(hudson.model.ItemGroup, java.lang.String) throws java.io.IOException; public com.cloudbees.hudson.plugins.folder.AbstractFolderDescriptor getDescriptor