aboutsummaryrefslogtreecommitdiff
path: root/src/lombok
AgeCommit message (Collapse)Author
2009-06-27[TRIVIAL] Added a toString to AnnotationValue, used to debug something, but ↵Reinier Zwitserloot
useful enough to leave in there.
2009-06-27Whoops - there was some debug printing left in eclipse's HandleGetterReinier Zwitserloot
2009-06-27Added a caching mechanism to AnnotationValues, for instantiating the annotation.Reinier Zwitserloot
2009-06-26Cleanup implemented for eclipse!Reinier Zwitserloot
There's one serious problem though: The cleanup routine modifies the eclipse internal AST, but doesn't update our bi-directional AST. Thus, or example, having a @Cleanup annotation inside the scope of another @Cleanup fails, because the application of the second one climbs up to the wrong block level (the original block level instead of newly built try block).
2009-06-25Bumped version from 0.3.0 to 0.3.5 in celebration of finishing all 3 ↵Reinier Zwitserloot
generating annotations for both javac and eclipse (@Getter, @Setter, and @Data).
2009-06-25Added support for generating toString to javac's HandleData. Now javac's ↵Reinier Zwitserloot
HandleData is COMPLETE! w00t!
2009-06-25Added generating hashCode() to javac's HandleData.Reinier Zwitserloot
2009-06-25trivialReinier Zwitserloot
2009-06-25javac's HandleData now makes equals methods.Reinier Zwitserloot
2009-06-25Removed adding the statement: 'final int PRIME = 31;' in the HandleData's ↵Reinier Zwitserloot
createHashCode method when there are 0 fields in the type (it would generate a local variable never used warning!)
2009-06-25Heh, on errors you'd never actually see any message, just the exception ↵Reinier Zwitserloot
type. Whoops.
2009-06-24javac's HandleData now generates the constructor only if it doesn't already ↵Reinier Zwitserloot
exist, and the staticConstructor is now also completed. Left: toString, hashCode, equals.
2009-06-24Work on HandleData, as well as generalizing features in the the PKG class ↵Reinier Zwitserloot
and updating HandleGetter/Setter to call into it.
2009-06-24Added printing for a constructor if it is the default (generated) ↵Reinier Zwitserloot
constructor or not.
2009-06-24Added proper support for changing the AST as its being visited, both removal ↵Reinier Zwitserloot
and addition. The rule is now: children traversal traverses through the tree mostly as it was when it started.
2009-06-23fixed a bug where the auto-generated constructors (actual or static) would ↵Reinier Zwitserloot
throw eclipse errors if you had 0 non-static fields.
2009-06-23HandleData for eclipse now seems to work 100%. Also updated toString to use ↵Reinier Zwitserloot
deepToString, and added @Override in case people have warnings for missing @Override annotations on.
2009-06-23@Data's generation of the equals() method now works!Reinier Zwitserloot
2009-06-23Fixed some bugs in copyType(), and now the static constructor is generated ↵Reinier Zwitserloot
without any raw generics warnings - it is effectively done.
2009-06-23Figured out that our previous act of just assigning TypeReference objects ↵Reinier Zwitserloot
directly to other nodes (e.g. from a FieldDeclaration's type to a method argument) is NOT a good idea, as this screws up when the TypeReference object represents a generic type (like 'T') - each instance of a generic type has a different resolution, but 1 TypeReference object can only hold 1 resolution. Thus, a copyType() method has been written, and the Handle* classes have been updated to use it. Also, generateEquals() is half-finished in HandleData.
2009-06-23This is a 3-day bughunt that ended up being something extremely simple:Reinier Zwitserloot
** DO NOT REUSE TYPEREFERENCE OBJECTS ** because that makes the binding process go pearshaped - after hte first run, that TypeReference object's binding parameter is set, and as its set, the resolver won't bother re-resolving it. However, each parse run starts with new scope objects, and any 2 bindings created by different scopes aren't equal to each other. urrrrrrgh! Fortunately, a lot of code that 'fixed' methods by adding bindings and scope have all been removed, as the parser patch point is well before these bindings are created. Thus: ** NEVER CREATE YOUR OWN BINDINGS AND SCOPE OBJECTS ** because if it comes down to that, you're doing it entirely wrong. That's eclipse's job. We're patching where we are so you don't have to do this.
2009-06-23Put the actual numeric value of ASTNode.Bit24 in a comment, but it was ↵Reinier Zwitserloot
missing a 0!
2009-06-23Removed the equalsPrime thing, because that's just needlessly putting ↵Reinier Zwitserloot
implementation details in there. If switching primes is so important, hash the type name and turn that into a prime, or something. Also added some javadoc.
2009-06-21More work on the HandleData annotation. Constructor seems to work fine, ↵Reinier Zwitserloot
static constructor not so much.
2009-06-21trivialReinier Zwitserloot
2009-06-21Bug fix: using string literals in any lombok annotation value would blow up ↵Reinier Zwitserloot
that processor.
2009-06-21Due to a java bug, constants in enums don't work, so instead the default ↵Reinier Zwitserloot
access level for @Getter and @Setter have now just been hardcoded in GetterHandler and SetterHandler. Added ability to look up the Node object for any given AST object on Node itself, as you don't usually have the AST object. Added toString() method generating to @Data, and this required some fancy footwork in finding if we've already generated methods, and editing a generated method to fill in binding and type resolutions. HandleGetter and HandleSetter have been updated to use these features. Exceptions caused by lombok handlers show up in the eclipse error log, but now, if they are related to a CompilationUnit, also as a problem (error) on the CUD - those error log entries are easy to miss! Our ASTs can now be appended to. When you generate a new AST node, you should add it to the AST, obviously. Getter/Setter have been updated to use this.
2009-06-19Added initial support for the @Data annotation. Currently produces getters ↵Reinier Zwitserloot
and setters only, not yet a constructor, toString, hashCode, or equals. HandleGetter and HandleSetter have been updated to handle static (theoretic; you can't put annotations on static fields normally). You can now make AnnotationValue objects using just an annotationNode and a target type, as well as check if a given annotationNode is likely to represent a target annotation type. This is in Javac and Eclipse classes. HandleGetter and HandleSetter can now be asked to make a getter/setter, and will grab access level off of a Getter/Setter annotation, if present.
2009-06-18Created a fully working HandleSetter for eclipse, and refactored ↵Reinier Zwitserloot
HandleGetter a little mostly to stuff common code into PKG.
2009-06-18Expanded the AST printers to support a target PrintStream, and expanded the ↵Reinier Zwitserloot
@PrintAST annotation to let you supply an optional filename. Useful particularly for IDEs, which don't usually have a viewable console. Also renamed the printers to just 'Printer', as they are already inner classes of a specifically named type (JavacASTVisitor & co).
2009-06-17AnnotationHandlers can now return a boolean to set if they actually handled ↵Reinier Zwitserloot
the annotation or not (previously, the presumption was they always handled the annotation). This is very useful for PrintAST on eclipse, because before this change, you'd never see method contents (as the initial dietParse would come first). Now Eclipse PrintASTHandler will skip any non-full runs, and only print non-diet. It then returns true only if it printed.
2009-06-17Added 'does setX/getX already exist' check to javac's HandleGetter/Setter. ↵Reinier Zwitserloot
If they exist (with any returntype/paramlist), no getter/setter is generated, and instead a warning is added on the annotation.
2009-06-17Added the SetterHandler for javac. Also added a way to get the SymbolTable ↵Reinier Zwitserloot
on a JavacAST.Node, because you need it to e.g. access constant types like 'void'.
2009-06-17Made the printing of Statements for @PrintAST slightly more useful (if a lot ↵Reinier Zwitserloot
more verbose), and bumped the version number in honour of quite a bit of redesign these past few commits.
2009-06-17A useful annotation that prints the AST of any annotated element via the ↵Reinier Zwitserloot
XASTPrinters in each ASTVisitor interface.
2009-06-17Just renamed some parameters to more sensical names.Reinier Zwitserloot
2009-06-17A bugfix to the visitMethodArgument method, and printing improved by ↵Reinier Zwitserloot
printing the raw (instead of resolved) types for fields etc, because usually they aren't resolved yet.
2009-06-17Moved the traverse() from Eclipse/JavacAST to Eclipse/JavacAST.Node, so that ↵Reinier Zwitserloot
you can start your traversal at any point, not just from the top. Also a bugfix for endVisitStatement which passed the wrong node, and method arguments in Javac are no longer misfiled as local declarations.
2009-06-17No retention at all seems much smarter, because then it wouldn't be ↵Reinier Zwitserloot
neccessary to have the lombok.jar in the deployment path of whatever you write WITH lombok, which is a good idea. Though - rewriting to e.g. a Lombok.sneakyThrow() call would require lombok.jar anyway. We'll cross that bridge when we get there.
2009-06-17Renamed the Handler implementations.Reinier Zwitserloot
2009-06-17TrivialReinier Zwitserloot
2009-06-17Removed a debug print.Reinier Zwitserloot
2009-06-17Error reporting now works 99% properly - the right position is being marked ↵Reinier Zwitserloot
off. The only issue is that the count by javac is being misreported (it doesn't count lombok errors).
2009-06-17Warnings and errors on specific positions works, sort of. Still missing ↵Reinier Zwitserloot
something crucial to properly make javac generate the line + the ^^^^ indicators.
2009-06-17NullPointerExceptions were showing up in Eclipse, when a 2+ dimensional ↵Reinier Zwitserloot
array of Statements contains inner arrays that are null. Fixed that.
2009-06-17Added reading in (via spi) JavacASTVisitors and calling them, as well as a ↵Reinier Zwitserloot
mechanism to generate generic errors and warnings for javac.
2009-06-17None of the methods in this class were even being used, so deleted the whole ↵Reinier Zwitserloot
thing.
2009-06-17Turns out using instanceof checks to figure out if a LocalDeclaration is a ↵Reinier Zwitserloot
method argument or not (by instanceof checking if it's an Argument) is faulty, as e.g. the argument to a catch block is also an Argument object. Rewritten the visitChild method to be based on a switch on the Node's getKind(), just like JavacAST. This even looks nicer.
2009-06-17Massive refactors. This list isn't complete, but should give you an idea:Reinier Zwitserloot
A) many things in lombok.eclipse moved to lombok.core to enable reuse with lombok.javac. B) lombok.javac works now similarly to eclipse's model: We first make big ASTs that are bidirectionally traversable, then we walk through that for annotations. C) Instead of getting an annotation instance, you now get an object that is more flexible and can e.g. give you class values in an enum as a string instead of a Class object, which may fail if that class isn't on the classpath of lombok. D) sources to the internal sun classes for javac added to /contrib.
2009-06-16Moved the generation of the Trees object to init(), as it seems to be the ↵Reinier Zwitserloot
same on every round.