You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2020/12/07 17:06:00 UTC

[GitHub] [helix] brentwritescode opened a new issue #1576: helix-core fails to build with some non-Sun/Oracle JDK implementations

brentwritescode opened a new issue #1576:
URL: https://github.com/apache/helix/issues/1576


   ### Describe the bug
   
   The class `org.apache.helix.task.assigner.ThreadCountBasedTaskAssigner` in helix-core uses an instance of an exception from the private "sun" package hierarchy:  `sun.reflect.generics.reflectiveObjects.NotImplementedException`.  This is the problem line:  https://github.com/apache/helix/blob/master/helix-core/src/main/java/org/apache/helix/task/assigner/ThreadCountBasedTaskAssigner.java#L35
   
   The result is that compilation can fail with this error for non-Sun/Oracle JDKs lacking the appropriate package (e.g. I built with Adopt OpenJDK on Mac):
   
   ```
   /Users/<username>/code/github/code/helix/helix-core/src/main/java/org/apache/helix/task/assigner/ThreadCountBasedTaskAssigner.java:71:15
   java: cannot find symbol
     symbol:   class NotImplementedException
     location: class org.apache.helix.task.assigner.ThreadCountBasedTaskAssigner
   ```
   
   Per Oracle, this package is private and can't be expected to work properly cross-JDK: https://www.oracle.com/java/technologies/faq-sun-packages.html
   
   As far as I can tell, there's only one instance of this particular "bug" in the entire project.
   
   ### To Reproduce
   1. `git clone https://github.com/apache/helix.git`
   2. compile with a non-Sun/Oracle supported JDK (e.g. this easily reproduces for me when I load the project in IntelliJ and do Build->BuildProject
   3. note the compilation error
   
   ### Expected behavior
   The project should compile successfully.
   
   ### Additional context
   This is a lot of detail for something that's a really easy fix.  
   
   I recommend just replacing the exception in question with either the `java.lang.UnsupportedOperation` exception from the standard Java API or the `NotImplementedException` from the `Commons Lang3` package that's already part of the project.  e.g.:
   
   ```
   -import sun.reflect.generics.reflectiveObjects.NotImplementedException;
   +import org.apache.commons.lang3.NotImplementedException;
   ...
   -    throw new NotImplementedException();
   +    throw new NotImplementedException(getClass().getName() + ".assignTasks(...) is not implemented.");
   ```
   
   I can try to submit a pull request for this, I just wanted to report it here first.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] jiajunwang closed issue #1576: helix-core fails to build with some non-Sun/Oracle JDK implementations

Posted by GitBox <gi...@apache.org>.
jiajunwang closed issue #1576:
URL: https://github.com/apache/helix/issues/1576


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] narendly commented on issue #1576: helix-core fails to build with some non-Sun/Oracle JDK implementations

Posted by GitBox <gi...@apache.org>.
narendly commented on issue #1576:
URL: https://github.com/apache/helix/issues/1576#issuecomment-740819020


   @brentwritescode This is fair. Would be great if you could submit a PR. Thanks for the catch!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org