Uploaded image for project: 'BuildTools'
  1. BuildTools
  2. BUILDTOOLS-507

NullPointerException in Builder.java when copying craftbukkit jar with --compile NONE for --rev 1.8 through --rev 1.13.2

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • git-BuildTools-0e60cdb-105 (#105)
    • Yes

      Builder.java throws a NullPointerException trying to copy non-exisitent craftbukkit jar when the --compile NONE flag is set for --rev 1.8 at the end of the build.

      Exception in thread "main" java.lang.NullPointerException
       at org.spigotmc.builder.Builder.copyJar(Builder.java:680)
       at org.spigotmc.builder.Builder.main(Builder.java:621)
       at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:40) 

      To reproduce, use the following steps:

      1. Create a new test folder and copy BuildTools.jar build 105 into the folder
      2. Execute the command: 
        java -jar BuildTools.jar --rev 1.8 --compile NONE

      Log file is here: https://paste.md-5.net/emulinejes.sql since attachment is not working (Jira could not attach the file as there was a missing token. Please try attaching the file again.)

      Notes:

      1. Running the following does work:
      java jar BuildTools.jar --rev 1.8
      1. Tested with --rev 1.8.8 and same error.
      2. Tested with --rev 1.12.2 and same error.
      3. Tested with --rev 1.13.2 (toolsVersion: 93) and same error.
      4. Tested with --rev 1.14.4 (toolsVersion: 101) and the error DID NOT occur.

      Analysis:

      Builder.java:618 does not check on older tool versions if compile is set to NONE.

      if ( versionInfo.getToolsVersion() < 101 || ( versionInfo.getToolsVersion() > 104 && compile.contains( Compile.CRAFTBUKKIT ) ) )

      should probably be...

      if ( versionInfo.getToolsVersion() < 101 && !compile.contains( Compile.NONE) || ( versionInfo.getToolsVersion() > 104 && compile.contains( Compile.CRAFTBUKKIT ) ) )

       

            Unassigned Unassigned
            klugemonkey klugemonkey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: