Skip to content

Ant build warnings in v1.8.2 #447

@wfordwfu

Description

@wfordwfu

I'm in the process of updating my Dockerfile and in my ant build process I'm getting a bunch of warnings. My hope for creating issue is at least some of these look pretty easy to knock out. Java isn't a language I know well, but wanted to make an effort to see if it helps.

A bunch of cases where the Wrapper Class Constructors are called with a deprecation warning. This looks like something deprecated in Java 9, so this one is more of an immediate issue since you all are targeting 17
warning: [removal] Double(double) in Double has been deprecated and marked for removal
warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
warning: [removal] Long(long) in Long has been deprecated and marked for removal

I found something that suggested replacing new Type with Type.valueOf, so running something like this?
find ${I2B2_SRC_DIR} -type f -name "*.java" -exec sed -i
-e 's/new Double(/Double.valueOf(/g'
-e 's/new Integer(/Integer.valueOf(/g'
-e 's/new Long(/Long.valueOf(/g'
-e 's/new Float(/Float.valueOf(/g'
-e 's/new Boolean(/Boolean.valueOf(/g'
{} ;

This shows up each time a build.xml is called. I think this is from my using a later ant version (1.10), but other than this warning everything else seems fine.
[javac] /app/i2b2-core-server/edu.harvard.i2b2.server-common/build.xml:45: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
So maybe something like this to resolve?
find ${I2B2_SRC_DIR} -name "build.xml" -exec sed -i
's/<javac /<javac includeantruntime="false" /' {} ;

There were some others that popped up as well, but I'm not sure how involved they are to fix:
warning: [removal] setSecurityManager(SecurityManager) in System has been deprecated and marked for removal
warning: [removal] SecurityManager in java.lang has been deprecated and marked for removal
warning: [removal] JdbcDaoSupport in org.springframework.jdbc.core.support has been deprecated and marked for removal

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions