This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 251561

Summary: Change method signature to match overriden method
Product: java Reporter: Svata Dedic <sdedic>
Component: HintsAssignee: Svata Dedic <sdedic>
Status: NEW ---    
Severity: normal CC: ralphbenjamin
Priority: P3    
Version: 8.1   
Hardware: PC   
OS: Linux   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on:    
Bug Blocks: 246477    

Description Svata Dedic 2015-04-01 13:46:08 UTC
Sometimes a class is changed to extend some superclass, but already defines a method with similar but conflicting signature which prevents the correct method stub to be generated. Or a type parameter for the superclass is changed after the class is coded, which results in different method parameter/return types for overriding methods - see issue #246477 for detailed description.

IDE could change signatures of methods which conflict with overridable members of superclass to correct ones. The hint could watch out errors like:
"XXX in Y cannot implement XXX<E> in ListModel
  return type Object is not compatible with String
  where E is a type-variable:
"

"name clash: add(Object) in JavaApplication1 and add(E) in AbstractList have the same erasure, yet neither overrides the other
  where E is a type-variable:
    E extends Object declared in class AbstractList"

+ @Override annotation, which indicate the method WAS intended to override the parent, but the intention failed for some reason. The hint should be also presented for class name, as at the same time, the class header will likely produce an error that some abstract methods are not implemented.