You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I TASTy-inspect a Java class I see a warning on the screen, then nothing happens, which isn't very useful.
(As an aside, I get an alreadyLoaded() warning. I would have expected a cannotUnpickle(s"its class file does not have a TASTY attribute") for a Java class.)
While this behavior is somewhat expected, as there is obviously no .tasty file for Java classes, it would be valuable to know that I encountered a Java file in my top-level TastyInspector implementation, not just "nothing" (empty root tree). As we live on the JVM, I categorize this request as a "friendly-failure", as it could surely happen in the wild.
I seek a way to know if a compilation unit was in fact a Java class from within TastyInspector.
expectation
I'm working on a PR for this, attempting to do as minimal surgery as possible.
My thought is to add a marker class, JavaCompilationUnit, that can be returned from ReadTasty. Then I can add a getJavaClass():Option[String] method on Reflection.Context, which internally will check the CompilationUnit to see if it's a JavaCompilationUnit and return the class name if so. This information I can access from within my TastyInspector and do whatever I need to from there. Those who don't care about Java classes will experience the current behavior minus the warning.
The text was updated successfully, but these errors were encountered:
Today
If I TASTy-inspect a Java class I see a warning on the screen, then nothing happens, which isn't very useful.
(As an aside, I get an alreadyLoaded() warning. I would have expected a cannotUnpickle(s"its class file does not have a TASTY attribute") for a Java class.)
While this behavior is somewhat expected, as there is obviously no .tasty file for Java classes, it would be valuable to know that I encountered a Java file in my top-level TastyInspector implementation, not just "nothing" (empty root tree). As we live on the JVM, I categorize this request as a "friendly-failure", as it could surely happen in the wild.
I seek a way to know if a compilation unit was in fact a Java class from within TastyInspector.
expectation
I'm working on a PR for this, attempting to do as minimal surgery as possible.
My thought is to add a marker class, JavaCompilationUnit, that can be returned from ReadTasty. Then I can add a getJavaClass():Option[String] method on Reflection.Context, which internally will check the CompilationUnit to see if it's a JavaCompilationUnit and return the class name if so. This information I can access from within my TastyInspector and do whatever I need to from there. Those who don't care about Java classes will experience the current behavior minus the warning.
The text was updated successfully, but these errors were encountered: