[ 
https://issues.apache.org/jira/browse/LUCENE-4335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13443455#comment-13443455
 ] 

Uwe Schindler commented on LUCENE-4335:
---------------------------------------

Thats a good idea, there is one problem with one of the tools, not sure if 
jflex or javacc. It happens that one of these tools reorders the switch 
statement's "case XX:" labels and so creating different source. This seems to 
depend on JDK version used, if you regen again its the same, but often i 
changed the metafile (like fixing /** to /* for license) and regened, it was 
different order. The pattern looks like one of these tools use a 
HashSet/HashMap of "case" statements, where the order is undefined.

We should check what causes this.

bq. then we could have an 'ant regenerate' command that regens all sources, and 
our usual 'svn status' check would ensure nothing changed.

We have to extend that one to also detect modifications. The current checker 
task only looks for unversioned files and checks properties. By this you can 
run it before commit. This one would need to check for mods, too.
                
> Builds should regenerate all generated sources
> ----------------------------------------------
>
>                 Key: LUCENE-4335
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4335
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>
> We have more and more sources that are generated programmatically (query 
> parsers, fuzzy levN tables from Moman, packed ints specialized decoders, 
> etc.), and it's dangerous because developers may directly edit the generated 
> sources and forget to edit the meta-source.  It's happened to me several 
> times ... most recently just after landing the BlockPostingsFormat branch.
> I think we should re-gen all of these in our builds and fail the build if 
> this creates a difference.  I know some generators (eg JavaCC) embed 
> timestamps and so always create mods ... we can leave them out of this for 
> starters (or maybe post-process the sources to remove the timestamps) ...

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to