Skip to content

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

@ggdupont

Description

@ggdupont

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): macos sierra
  • Ray installed from (source or binary): source
  • Ray version: tag ray-0.7.4
  • Python version: NA
  • Exact command to reproduce: Install ray for java and try the simple example to store an int in object store

Describe the problem

Issue raised when loading the test:

/Users/to124821/src/github.com/ray/java/runtime/src/main/java/org/ray/runtime/context/LocalModeWorkerContext.java
Error:(11, 46) java: package sun.reflect.generics.reflectiveObjects does not exist
Error:(27, 15) java: cannot find symbol
  symbol:   class NotImplementedException
  location: class org.ray.runtime.context.LocalModeWorkerContext

This is linked to the use of sun.reflect.generics.reflectiveObjects.NotImplementedException simply for throwing a NotImplementedException() in getCurrentWorkerId(). If there no specific rationale to use this specific dependency to sun proprietary Class, it migght be better suited to switch to another Class. In LocalModeRayletClient.java, it seems the apache lang version is preferred: org.apache.commons.lang3.NotImplementedException

Source code / logs

package com.airbus.cto.donut.sim.plasma;

import org.junit.Before;
import org.junit.Test;
import org.ray.api.Ray;
import org.ray.api.RayObject;

public class RayTest {

    @Before
    public void initRay(){
        Ray.init();
    }

    @Test
    public void objectStoreTest(){
        Integer x = 1;
        RayObject<Integer> obj = Ray.put(x);
        Integer x1 = obj.get();
        assert (x.equals(x1));
    }
}

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