querydsl / codegen

Java/Scala Code generation tool
Apache License 2.0
23 stars 22 forks source link

Traverse superclasses for a visible class #23

Closed Shredder121 closed 9 years ago

Shredder121 commented 9 years ago

progress label needed.

I haven't yet found a class that is not a descendant of Map, List or Set and has at least two non-visible parents. @timowest There may be a better way of going about this, it is maybe also solvable in querydsl-core in the creation of a ConstantImpl?

Shredder121 commented 9 years ago

I think this is at least a good place to edit this, since utils can be reused. But is it necessary to apply this elsewhere is what I mean.

timowest commented 9 years ago

@Shredder121 That's a good idea. Since there is also a constructor that takes both the class and the constant we can normalize the type in the constructor that takes only the constant.

Shredder121 commented 9 years ago

@timowest also, the pom specifies a non-snapshot version. This pollutes my Maven cache..

timowest commented 9 years ago

I can bump the version to a SNAPSHOT after the next release. I applied the progress label.

Shredder121 commented 9 years ago

For simple interface implementations (anonymous classes) we could normalize the first interface. we could use a try block (since we move up the inheritance chain) and throw an exception when we reach Object, and go back down until we find a class that implements 1 interface, throwing an exception otherwise(moving further down).

This is just an idea (and not an optimal one). What do you think is a better one?

Shredder121 commented 9 years ago

Or we could leave it at this. Maybe later, when we have a good test case we could implement that.

timowest commented 9 years ago

The current state of the fix might be sufficient for now. Shall I merge this?

Shredder121 commented 9 years ago

Yes, I think that is good.

Shredder121 commented 9 years ago

Shall we edit the commit message?

timowest commented 9 years ago

Yes, that makes sense.

Shredder121 commented 9 years ago

I changed it now.

timowest commented 9 years ago

I'll make a new release for codegen tomorrow.

timowest commented 9 years ago

Released in codegen 0.6.6