2004-12-20 Jon Schewe * Release 0.9 2004-11-14 Jon Schewe * src/net/mtu/eggplant/dbc/Symtab.java (Symtab): Can now correctly handle void methods with exceptions. DBC conditions are not checked when an exception is thrown. 2004-11-10 Jon Schewe * doc/index.html: Updated documentation to match libraries... * Release 0.8 * doc/README (BUGS): Noted that checked exceptions may still cause conditions to be checked. 2004-11-09 Jon Schewe * src/net/mtu/eggplant/dbc/Symtab.java (Symtab): Added line numbers in pretty output. * src/net/mtu/eggplant/dbc/CodeModification.java (CodeModification): A little more efficient use of variables. * src/net/mtu/eggplant/dbc/CodeGenerator.java (CodeGenerator): Added comment for carriage returns inserted due to prettyOutput option. * build.xml: Updated to antlr 2.7.4 * src/net/mtu/eggplant/dbc/JonsAssert.java (JonsAssert): Set tabSize to 1 on lexers so that it's a character count. This is needed to support tabs in code. 2004-04-27 Jon Schewe * src/net/mtu/eggplant/dbc/java.g: Now can handle comments above imports as well as a commented out file thanks to Mark on teh antlr-interest list. 2004-04-16 Jon Schewe * src/net/mtu/eggplant/dbc/java.g: Can now handle javadoc comments above the package definition thanks to Loring Craymer on the antlr-interest list. 2004-04-09 Jon Schewe * src/net/mtu/eggplant/dbc/java14.g: Antlr now has inheritance fixed, so the parsers are now named properly. * build.xml: Updated to antlr 2.7.3. 2004-04-08 Jon Schewe * build.xml: Using commons-logging now. The only dependancy on log4j is in JonsAssert.main() to set the level to debug. 2004-04-05 Jon Schewe * Release 0.7 * src/net/mtu/eggplant/dbc/java.g: Use custom error handling to make emacs compatible output. * src/net/mtu/eggplant/dbc/JonsAssert.java: Added checkstyle to build to clean up the code. (main): Added verbose flag to minimize output during normal operations. 2004-04-04 Jon Schewe * Release 0.6 * src/net/mtu/eggplant/dbc/CodeGenerator.java (getClassObjectForClass): Use full class names when constructing instances of primitive wrappers. 2004-01-31 Jon Schewe * src/net/mtu/eggplant/dbc/JonsAssert.java (parseFile): Switched from werken.opt to Commons CLI. 2003-12-29 Jon Schewe * Release 0.5.4 * build.xml: Updated to JonsInfra 0.2 * build.xml: Updated to junit 3.8 2003-08-10 Jon Schewe * doc/README (FEATURES): Removed test for classes in the default package. The testcase just doesn't work with newer java compilers well and it's just good practice to put all classes in a package. * src/net/mtu/eggplant/dbc/CodeGenerator.java (generatePostConditionMethod): Now methods called from pre and post conditions may throw exceptions, as long as they're declared in the throws clause of the method being checked. 2003-07-02 Jon Schewe * src/net/mtu/eggplant/dbc/CodeGenerator.java (CodeGenerator): cleaned up javadoc 2003-05-10 Jon Schewe * src/net/mtu/eggplant/dbc/CodeGenerator.java: Finished implementing pretty-output option. 2003-05-08 Jon Schewe * src/net/mtu/eggplant/dbc/doc-files/MethodSkeletons.xjava: Working on how to instrument interfaces. * src/net/mtu/eggplant/dbc/JonsAssert.java (main): Implemented pretty-output option. * src/net/mtu/eggplant/dbc/AssertTools.java (lockMethod): Made method locking also pay attention to the instance of the object and the current thread, so that recursive calls are only avoided within the same instance and thread. * src/net/mtu/eggplant/dbc/CodeGenerator.java (generateAssertion): Started adding pretty output option where carriage returns are output in the instrumented code. 2002-06-02 Jon Schewe * src/net/mtu/eggplant/dbc/JonsAssert.java (main): Now check to make sure that all files passed on the commandline and are readable. If not, then print out an invalid option message. This also handles invalid options because werken.opt passes everything from the first option that it doesn't recognize to the end of the commandline as other arguments. 2002-05-27 Jon Schewe * Release 0.5 * src/net/mtu/eggplant/dbc/testcases/TestAssert.java: Verified that things work ok with JDK 1.4. There's something funky with the 1.4 compiler that doesn't like the DefaultPackage test, can't seem to find the class when compiling. The 1.4 specific lines are commented out of java.g and TestAssert.java until I figure out how to support both parers. Should have that figured out tomorrow morning when I wake up. Oh wait, it is tomorrow! Anyway, after I get some sleep I should have that all worked out, except for the DefaultPackage thing... * Moved all files into package dbc (Design By Contract) instead of assert. This is to facilitate JDK 1.4. * src/net/mtu/eggplant/assert/testcases/TestEnforceInherited.java: Added test for ENFORCE_INHERITED_CONDITIONS. This functionality is now working. * src/net/mtu/eggplant/assert/testcases/TestAssert.java: Now works properly with ant and all expected tests pass. 2002-05-26 Jon Schewe * src/net/mtu/eggplant/assert/testcases/TestAssert.java (TestAssert): Removed NamedLocalClass test, java compiler doesn't seem to allow this anymore. * src/net/mtu/eggplant/assert/JonsAssert.java (main): Fixed bug with files being instrumented into the destination directory, without package structure, when the destination file is newer 2002-05-19 Jon Schewe * src/net/mtu/eggplant/assert/CodeGenerator.java: Added system property, ENFORCE_INHERITED_CONDITIONS, to allow the user to gain speed by sacrificing checking of conditions on superclasses. Also changed names of properties to turn off various condition checks to be easier to understand. See package level documentation for more information. 2002-04-17 Jon Schewe * src/net/mtu/eggplant/assert/JonsAssert.java: Changed System.exit calls in main to returns, so that main can be called from another Java application, like ant. 2002-01-20 Jon Schewe * src/net/mtu/eggplant/assert/AssertToken.java: Now can handle inside assertions and messages. The only problem now, is if the first character after the is a star and it's not a continuation star it gets stomped. 2002-01-19 Jon Schewe * src/net/mtu/eggplant/assert/JonsAssert.java: Switched commandline parsers to one with a BSD style license. 2001-07-07 Jon Schewe * src/net/mtu/eggplant/assert/java.g: Removed warnings from java.g 2001-04-05 Jon Schewe * lib/antlr.jar: updated to antlr-2.7.1, does column tracking for me :) 2001-03-07 Jon Schewe * src/net/mtu/eggplant/assert/AssertClass.java: Fixed bug reported by John Maloney (jmaloney@uswest.net) that caused classes in the default package to cause an internal error when run. 2001-02-03 Jon Schewe * src/net/mtu/eggplant/assert/CodeGenerator.java: Fixed caching of super methods. Need to make sure variable names are unique even if method names aren't. 2001-01-07 Jon Schewe * prj.el: Upgraded to junit-3.4 * src/net/mtu/eggplant/assert/CodeGenerator.java: Added caching of super methods at the class level. This should improve performance. 2000-12-29 Jon Schewe *: Moved all files into the package net.mtu.eggplant. Also changed all file headers for new licensing, BSD style rather than LGPL. 2000-12-09 Jon Schewe * CodeGenerator.java: Updated generated variable/method/class names to follow standard naming conventions. 2000-10-21 Jon Schewe * test/AssertToolsTest.java: Added some tests for AssertTools.setUniqueParams() 2000-10-19 Jon Schewe * AssertTools.java: Added code to uniquify the parameters of a constructor. See setUniqueParams for a full explanation. * AssertMethod.java: Added the concept of unique parameters. This is really for generated constructors. See AssertTools.setUniqueParams for a full explanation. 2000-10-17 Jon Schewe * AssertMethod.java: Made conditions and params properties Lists and specified that the lists have the same order as the corresponding lists in the source. * AssertClass.java: Made interfaces property a list rather than a set and specified that the list has the same order as the implements line in the source. 2000-10-15 Jon Schewe * CodeGenerator.java: Removed dependancy on gnu regexp package. 2000-10-14 Jon Schewe * testcases/TestAssert.java: Added comments to unit tests. Added unit tests for extra precondition checks. Bug fixed! * AssertMethod.java: modified to store the whole list of modifiers so that I can check for any modifier I want later on. Also added methods that determine the visibility of the method and the method to used check assertions. This fixed a one of the bugs in the previous version. 2000-10-05 Jon Schewe * java.g: Removed unused code from identifierStar that sets the text of the token, then tosses the token. * AssertClass.java: Started laying framework for handling interfaces. * Symtab.java: Commented out currrently unused methods resolveClass and parseClass to avoid confusion when looking for usages of methods. Should remove these after further analysis. Also modified extendsObject check to also make sure the list of implemented interfaces is empty as well when deciding to skip assertion checks. * JonsAssert.java: Added --debug and --debugLexer to command line to make debugging easier. Continued finalizing variables. 2000-10-02 Jon Schewe * CodeGenerator.java: Added checks to make sure assertions don't cause infinite recursion, see AssertTools.(un)lockMethod. 2000-07-27 Jon Schewe * Symtab.java: Fixed case where the generated code would try and catch exceptions after catching a Throwable. 2000-07-24 Jon Schewe * AssertMethod.java: more final methods * AssertClass.java: made some methods final that shouldn't be overriden in an attempt to increase performance 2000-05-06 Jon Schewe * ScratchMethod.java: Defined equals and hashCode for performance caching. * AssertTools.java: Speed up instrumented code performance with some caching. 2000-04-30 Jon Schewe * AssertTools.java: Toyed around with caching super methods. Tried using HashMap, got out of memory error, tried WeakHashMap, finished, but didn't help performance, actually a little worse. 2000-04-24 Jon Schewe * CodeGenerator.java: Switched pre and post conditions to do the inheritance logic corrrectly, preconditions are ORed, postconditions are ANDed. 2000-04-19 Jon Schewe * JonsAssert.java: Started adding command line parameters. Added the important -f for forcing instrumentation even if the file already exists. * AssertClass.java: I think I've got anonymous class names finally correct. * MethodSkeletons.xjava: Updated documentation. * CodeGenerator.java: Added check to make sure $return only shows up in postconditions. Still need to make this a better message though. Added dummy parameter to checkPost methods for void methods so that they are distinct from checkPost methods for methods with return values and the same name. * assert.g: Line count now gets updated when a is found in an assertion condition. 2000-04-18 Jon Schewe * assert.g: Added code to handle carriage returns in an assertion condition. * JonsAssert.java: Added code to track column information across multiple lexers. This makes sure that the instrumentation gets inserted at the right column. * CodeGenerator.java: Added regexp rewrites for $return and escaping quotes. * Symtab.java: Fixed scoping on post conditions. One line else return statements should work now. * CodeFragment.java: Fixed comparator to also check the code string in case everything else is equal. 2000-04-17 Jon Schewe * CodeGenerator.java: Removed old value stuff. Temporarily disabled checking of pre/post/invariant conditions in constructor so perhaps I can get a release out sooner. 2000-03-22 Jon Schewe * CodeGenerator.java: append class name on the end of __retval for post calls. Need to think about $ names for the user so it's compatible with AssertMate and other tools like that. 2000-03-21 Jon Schewe * CodeGenerator.java: Now inner classes work better, getting the constructor name from a class you have to remember to strip off everything before the last $. 2000-03-20 Jon Schewe * CodeGenerator.java: Added stuff to handle void methods better. 2000-03-05 Jon Schewe * JonsAssert.java: Modified control structure so that files are instrumented right away. Shouldn't need to store everything in memory anymore either. * java.g: Figured out how to handle javadoc comments before package definitions, now I just need to get javadoc comments before import statements. * Symtab.java: Put in CodeFragment for tagline. * java.g: Now can handle empty compound statements with assertions inside. 2000-03-04 Jon Schewe * testcases/Node.java: Added for testing of the instanceof rule and the end of javadoc comment rule. * java.g: Added correction to relationExpression so that instanceof gets handeled correctly. * assert.g: Javadoc comments can end with **/ or */ * Symtab.java: Added bit to create the Hashtable for the default package when needed. * JonsAssert.java: Moved exception handling to a more useful place and make sure that a file isn't written out if the parser fails. * AssertTools.java: If the base instrumented directory doesn't exist, create it. * CodeGenerator.java: Fixed some bad coding on my part that caused commas to be forgotten in parameter lists. * MethodSkeletons.xjava: Started putting down ideas for interface name resolution. 2000-03-03 Jon Schewe * JonsAssert.java: Added code to correctly check destination file dates so we can short circuit the parse. Also now the unit tests all pass, except for the interface test, which I haven't implemented yet. 2000-02-27 Jon Schewe * java.g: Handle "[]"'s on data types correctly. So that when I create extra methods the "[]"'s are there. * Symtab.java: Make sure nothing gets added to an interface source. * CodeGenerator.java: Renamed all variables to avoid name collisions * AssertTools.java: Changed the default extension to be "java" 2000-02-20 Jon Schewe * Symtab.java: More code to handle abstract and native methods. * java.g: Should handle abstract and native methods now. * AssertTools.java: Added method to translate a package name into a directory name and create the directories relative to a destination directory. This will allow me to instrument files into another directory rather than just changing the extension and confusing compilers. * JonsAssert.java: Added code to check modification times of files before parsing, so we don't parse extra files. * AssertMethod.java: Added flag to tell if this method is abstract/native. * CodeGenerator.java: private methods have private pre and post condition check methods. Also the check for a super method isn't done if the method is private. 2000-02-16 Jon Schewe * CodeGenerator.java: Added wrapping for primatives when creating the args array for method invocation. * java.g: Added clear calls for the pre and post conditions as well as correct the column numbers that get passed to the addExit method. * Symtab.java: Only add checks where we're supposed to, ie. no invariant check on constructors. Also modified the generation of the entrance and exits so that the column numbers are such that code is inserted on the correct side of the braces and semicolons. * CodeGenerator.java: Lots of little fixes in the generated code. Initialization of variables mainly. * CodeFragment.java: Added fix for instrumenting a line if the instrumentation is to be added after the last character of the line. * test/TestAssert.java: Modified syntax a bit and made the class compilable by adding the foo method. 2000-02-15 Jon Schewe * java.g: Converted to CodeFragmentType from AssertType * Symtab.java: Added more instrumentation to the instrument() call. * CodeModification.java: Converted to CodeFragment from AssertType * CodeGenerator.java: Converted from Vector to List and added first pass at generatePostConditionMethod. * CodeFragment.java: Converted to CodeFragmentType from AssertType * AssertMethod.java: Converted from Vector to List. * CodeFragmentType.java: Added for typing within CodeFragments, mainly for ordering. 2000-02-13 Jon Schewe * MethodSkeletons.xjava: Updated to match the code in CodeGenerator. * CodeGenerator.java: Added first cut of generatePreConditionMethod(). generatePostConditionMethod() should be pretty much the same. * AssertTools.java: Made the source and instrumented extension properties that can be changed. 2000-02-12 Jon Schewe * CodeGenerator.java: Actually creates compilable code now. * MethodSkeletons.xjava: Modified skeletons to reflect name changes. * AssertTools.java: Modified findSuperMethod to take into account my new naming convention so the super calls will work. * CodeGenerator.java: Modified current calls to generate method names in the form ____. * AssertMethod.java: Made getContainingClass public so that the CodeGenerator can get at it. * Symtab.java: Added code to actually create the CodeFragments for the checkInvariant method. * JonsAssert.java: Added in the call to instrument everything. I can actually instrument a file now! Granted it only does @assert, but that's a start. 2000-02-06 Jon Schewe * java.g: Better documented what still needs to be fixed in here. I think the startMethod() and finishMethod() calls are in the right spot now. * README: Added notes about limitations to constructor preconditions. * Makefile: Added deprecation checks and emacs error reporting to the jikes call * CodeModification.java: Added to allow modification of the code we're instrumenting rather than just inserting code. * CodeGenerator.java: Added better idea for calling preconditions on constructor. Adds more methods, but oh well :) * CodeFragment.java: Added instrumentLine method so that a CodeFragment may be smart enough to modify lines itself. * AssertType.java: Modified sorting order to put invariants between preconditions and post conditions. * AssertMethod.java: Added isVoid to make it easy to check for no return value. 2000-02-04 Jon Schewe * java.g: Roughed out an idea on how to do methods. Added some stubs in Symtab for this. Still need to implement them. Figured out how to get all of the information for creating an AssertMethod object. * AssertTools.java: findSuperMethod won't work like I expected. This is going to make things REAL difficult. 2000-01-29 Jon Schewe * Symtab.java: added stack of files just like the class stack so that multiple files can be parsed recursively. Added code to find the source for an interface. Still needs some enhancements though. * java.g: Added calls for creating inner classes too and the end of classes. 2000-01-22 Jon Schewe * AssertMethod.java: Added stuff for static and private methods, so I can tell the difference when I generate code. 2000-01-22 Jon Schewe * CodeGenerator.java: Added roughed out version of how to handle constructors * java.g: Added CodeFragment objects to hold generated code and some points for sorting so that the files can be instrumented in some sane manner 2000-01-20 Jon Schewe * assert.g: Added column tracking code * java.g: Added code for keeping track of columns 2000-01-16 Jon Schewe * CodeGenerator.java: Added code to generate invariant checks. * README (BUGS): Added section on reporting bugs. * java.g: Still trying to get column numbers to work right. * assert.g: now creates AssertTokens for the various conditions so that I don't have to duplicate the work the lexer has done later. * AssertToken.java: Added so that I don't need to reparse the condition and message that are found in the lexer. * MyToken.java: created for keeping track of columns 2000-01-15 Jon Schewe * CodeGenerator.java: Created to generate code for various conditions * java.g: Now I generate code for @assert 2000-01-11 Jon Schewe * Added some more test cases to the test directory. 2000-01-08 Jon Schewe * java.g: Should parse everything correctly now! Now we just need to generate code and find interfaces :) * assert.g: Handels ()'s in the condition! * MethodSkeletons.java: refined ideas of how the pre and post conditions are checked 2000-01-03 Jon Schewe * TestAssert.java: Added some more code that can break the lexer :( * MethodSkeletons.java: Working out how to actually signal the assertions. * AssertTools.java: Generalized code to find the super class method. * AssertMethod.java: Added stubs for methods and slots that should be required for methods to be handeled correctly. * java.g: list of mports should be correctly built, still need to figure out how to resolve interfaces 2000-01-02 Jon Schewe * README (BUGS): Added bug list. 2000-01-01 Jon Schewe * java.g: removed stuff to build AST 1999-12-30 Jon Schewe * java.g (WS): Reindented with antlr-mode (should be more readable now), added comments for where code should be generated to check pre/post/invariant conditions. * assert.g: Reindented with antlr-mode and commented out extra print statements. * java.g: initial entry, supports pre and post conditions and invariants. Doesn't generate any code yet though.