Skip to content

Fix 5667 - Changing use of sun NotImplementedException to apache NotImplementedException#5677

Closed
ggdupont wants to merge 2 commits intoray-project:masterfrom
ggdupont:issue5667
Closed

Fix 5667 - Changing use of sun NotImplementedException to apache NotImplementedException#5677
ggdupont wants to merge 2 commits intoray-project:masterfrom
ggdupont:issue5667

Conversation

@ggdupont
Copy link
Copy Markdown
Contributor

Why are these changes needed?

See #5667

Basically, the use of sun.reflect.generics.reflectiveObjects.NotImplementedException creates a dependency to sun proprietary Class. It might be better suited to switch to another Class. In LocalModeRayletClient.java, it seems the apache lang version is preferred: org.apache.commons.lang3.NotImplementedException

Related issue number

Closes #5667

Checks

  • I've run scripts/format.sh to lint the changes in this PR.
    => can't run it without installing yapf@0.23.0 which seems impossible now with brew
  • I've included any doc changes needed for https://ray.readthedocs.io/en/latest/.
    => NA

…tImplementedException by using org.apache.commons.lang3.NotImplementedException instead
@AmplabJenkins
Copy link
Copy Markdown

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/16938/
Test PASSed.

Copy link
Copy Markdown
Member

@kfstorm kfstorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the catch. Looks good to me. One comment.

@Override
public UniqueId getCurrentWorkerId() {
throw new NotImplementedException();
throw new NotImplementedException("getCurrentWorkerId() not (yet) implemented.");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest to change the reason to Not supported in SINGLE_PROCESS mode. as this is not a public API and it’s only referenced in RayNativeRuntime, which means we won’t implement it for single process mode.

@AmplabJenkins
Copy link
Copy Markdown

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/16973/
Test FAILed.

import org.ray.runtime.generated.Common.TaskType;
import org.ray.runtime.task.LocalModeTaskSubmitter;
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
import org.apache.commons.lang3.NotImplementedException;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using java.lang.UnsupportedOperationException instead? The message does say "Not supported" so it's arguably the better message.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. I created another PR to replace all the NotImplementedExceptions. #5694

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. Only one NotImplementedExceptions found after merging master (previously three). Either updating and merging this PR or merging #5694 is OK.

@AmplabJenkins
Copy link
Copy Markdown

Can one of the admins verify this patch?

@ericl ericl closed this Dec 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[java] Usage of sun.reflect.generics.reflectiveObjects.NotImplementedException

4 participants