| Summary: | Provide an option to create class, in addition to browse | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Ling Hao <ling.hao> |
| Component: | Sapphire | Assignee: | Konstantin Komissarchik <konstantin> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | ram.venkataswamy |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Ling Hao
Enhancement implemented. Documented in the enhancement doc along with the new "Working with Java Types" document. Please verify. verified Closing. It would be nice to add implement methods from the interface. At least, we should provide an option? Also inner interfaces is not generated correctly. Example:
@JavaTypeConstraint( kind = JavaTypeKind.CLASS, type = "com.tangosol.net.cache.ConfigurableCacheMap$UnitCalculator" )
Generated:
public class MyUnitCalculator implements ConfigurableCacheMap$UnitCalculator {
}
Note the missing import statement and the "$"
Ram's bug Bug 310501
Oops Ram's bug for inner class is Bug 12929122 For the following java constraints - the create class button is not available:
@JavaTypeConstraint( kind = JavaTypeKind.CLASS,
type = {
"com.tangosol.net.cache.OverflowMap",
"com.tangosol.net.cache.SimpleOverflowMap"
},
behavior = JavaTypeConstraintBehavior.AT_LEAST_ONE
)
Ram's bug Bug 12929129
> For the following java constraints - the create class button is not available: > > @JavaTypeConstraint( kind = JavaTypeKind.CLASS, > type = { > "com.tangosol.net.cache.OverflowMap", > "com.tangosol.net.cache.SimpleOverflowMap" > }, > behavior = JavaTypeConstraintBehavior.AT_LEAST_ONE > ) > > Ram's bug Bug 12929129 That's expected. The create action is not defined for AT_LEAST_ONE as there isn't a single way to create that class. Does SimpleOverflowMap extend from OverflowMap? If so you can simplify that definition and get the creation action to work. (In reply to comment #8) > > For the following java constraints - the create class button is not available: > > > > @JavaTypeConstraint( kind = JavaTypeKind.CLASS, > > type = { > > "com.tangosol.net.cache.OverflowMap", > > "com.tangosol.net.cache.SimpleOverflowMap" > > }, > > behavior = JavaTypeConstraintBehavior.AT_LEAST_ONE > > ) > > > > Ram's bug Bug 12929129 > > That's expected. The create action is not defined for AT_LEAST_ONE as there > isn't a single way to create that class. Does SimpleOverflowMap extend from > OverflowMap? If so you can simplify that definition and get the creation action > to work. No, SimpleOverflowMap does not extend from OverflowMap. I think we should still create it, using the first interface listed? Also, create class should validate, for example "abc". It should warn that java type usually start with an upper case. Ram's bug 12932359 Create class should be available for java types that does not have any @JavaTypeConstraint. Ram suggested that we should create a simple class that doesn’t implement/extend another type. Ram's bug 12931834 (I had closed the bug as work as expected earlier, but reopened to get your thoughts) > It would be nice to add implement methods from the interface. At least, we > should provide an option? Done. > Also inner interfaces is not generated correctly. Example: > > @JavaTypeConstraint( kind = JavaTypeKind.CLASS, type = > "com.tangosol.net.cache.ConfigurableCacheMap$UnitCalculator" ) Fixed. > No, SimpleOverflowMap does not extend from OverflowMap. I think we should still > create it, using the first interface listed? Ok. Implemented "use the first one" semantics. > Also, create class should validate, for example "abc". It should warn that java > type usually start with an upper case. Added validation for missing package and lowercase start of type name. The validation is presented as a confirmation dialog upon invoking the action. > Create class should be available for java types that does not have any > @JavaTypeConstraint. Ram suggested that we should create a simple class that > doesn’t implement/extend another type. I now interpret missing @JavaTypeConstraint as equivalent to @JavaTypeConstraint.kind() listing all possibilities. The effect is that create action has four options for different kinds of java types. Please verify. > Inner interfaces is not generated correctly. Example:
>
> @JavaTypeConstraint( kind = JavaTypeKind.CLASS, type =
> "com.tangosol.net.cache.ConfigurableCacheMap$UnitCalculator" )
The generated code doesn't import the type and implement required methods.
The newly created class should create constructors from superclass. Ram's reopened bug 12929122. Both issues fixed. verified all fixes. Closing. Thanks. @ In the latest build, create class generate incorrect code..
@ .
@ ex: Try creating a new listener class...
@ .
@ public c
@ .
@ public MyList1() {
@ super();
@ // TODO Auto-generated constructor stub
@ }lass MyList1 implements MapListener
@ {
@ generating HTTP Acceptor class puts the constructor outside the class
@ .
@ public MyHTTPAcc() {
@ super();
@ // TODO Auto-generated constructor stub
@ };
@ .
@ public class MyHTTPAcc implements HttpServer
@ {
Ram's reopened bug 12929122.
Could not reproduce any issues. Will try to reproduce in adopter product. Its time to close this bug and keep it closed. Any further enhancements or bugs in this area should be separately described/filed. Ok. I was able to reproduce this in adopter product. Don't know what the issue is or why my previous repro didn't show it, but will take another stab at it via this bug for now. The problem described in Comment #18 was due to an attempt to ensure that generated constructors come before generated abstract methods, which is not how the JDT API wants to generate them by default. Removed attempted workaround. The constructors will come last and user can re-arrange them as appropriate. Please verify again. verified Closing. |