Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-4199

Add ANT tool to track/disallow "forbidden" method invocations

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.0-ALPHA
    • 4.0-BETA
    • None
    • None
    • New

    Description

      In LUCENE-3877 Greg Bowyer has some asm.jar-based code to inspe ct class files for System.out/err class. I wanted to modify this code to run it in a jar-linter task on ant, so all compiled class files are parsed and method/ctor calls to e.g. new String(byte[]) without charset are forbidden. We would add a list of method signatures that we dont want to have (new FileReader(File), commons.IOUtils.loadFileToString()) and this linter will throw BuildException after static inspection, if any class file in Lucene/Solr (including line numbers) uses any method call.

      Greg's code would be changed to use visitMethodInsn visitor, very easy.

      Attachments

        1. LUCENE-4199.patch
          383 kB
          Uwe Schindler
        2. LUCENE-4199.patch
          26 kB
          Uwe Schindler
        3. LUCENE-4199.patch
          20 kB
          Uwe Schindler
        4. LUCENE-4199.patch
          10 kB
          Uwe Schindler

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            uschindler Uwe Schindler
            uschindler Uwe Schindler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment