[BEAM-3845] Remove deprecated Class.newInstance() method usage#9613
[BEAM-3845] Remove deprecated Class.newInstance() method usage#9613iemejia merged 1 commit intoapache:masterfrom
Conversation
|
Run Python PreCommit |
|
@alanmyrvold and @yifanzou: we noticed together with @iemejia that this class ( |
|
The PostRelease_NightlySnapshot
<https://github.com/apache/beam/blob/master/.test-infra/jenkins/job_PostRelease_NightlySnapshot.groovy>
runs :release:runJavaExamplesValidationTask
which I think exercises those scripts?
…On Tue, Sep 24, 2019 at 8:33 AM Łukasz Gajowy ***@***.***> wrote:
@alanmyrvold <https://github.com/alanmyrvold> and @yifanzou
<https://github.com/yifanzou> we noticed together with @iemejia
<https://github.com/iemejia> that this class (TestScripts) is used only
by the quickstart-java-*.groovy, starter-generation.groovy and
mobilegaming-java-*.groovy scripts. The scripts (quickstart,
mobilegaming...) in turn seem to be not used by any job or gradle task in
Beam's repo, so I have a question: are the groovy scripts still used
anywhere or will be used? Or is it a "dead code" and we should delete this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9613?email_source=notifications&email_token=ABKL4FQSE7DME3L6PK4SDP3QLIXMPA5CNFSM4IYLC4KKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7OZBTY#issuecomment-534614223>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABKL4FVGZW6XUGNHYP27SGLQLIXMPANCNFSM4IYLC4KA>
.
|
|
@alanmyrvold right - now I see clearly that it is invoked from the generated task: https://github.com/apache/beam/blob/master/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy#L1575 Thanks! cc: @iemejia |
|
@iemejia does this PR LGTY? :) |
iemejia
left a comment
There was a problem hiding this comment.
LGTM
Please take care of the JIRA issue since I am not sure if it is already ready to be marked as Fixed/Closed.
|
Thanks, issue resolved. 👍 |
Class.newInstance()is deprecated since Java 9. See more verbose description on Jira.I searched for all
Class.newInstance()usages in Beam's codebase and It seems that this was the only one usage ofClass.newInstance()in beam codebase left. :) Other places that require the new instance use eitherConstructor.newInstance()orClass.getDeclaredConstructor().newInstance(). Both replacements are acceptable and are not deprecated in Java 9.@iemejia could you take a look?
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
R: @username).[BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replaceBEAM-XXXwith the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.Post-Commit Tests Status (on master branch)
Pre-Commit Tests Status (on master branch)
See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.