New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
naming restriction makes some jars unusable #2089
Comments
Imported From: https://issues.scala-lang.org/browse/SI-2089?orig=1 |
@odersky said: |
@paulp said:
That is a very good question. Apparently it's because there is an obfuscated jar yjp.jar and an unobfuscated jar yjp-controller-api-redist.jar, and somewhere in the course of upgrading yourkit my symlink ended up pointing at the wrong one. So I'm not 100% sure yet, but I think I'm back on the rails. Thanks, sorry for the misdirection. |
Dominik Maehl (dominikm) said: I use a library from an external company which is obfuscated (Qoppa JPDFProcess) and even if I don't directly access any of the obfuscated classes scalac still complains about a package and an object with the same name. (fragment of pdf_preflight.scala):1: error: package pdfViewer contains object and package with same name: a
one of them needs to be removed from classpath
val p = new com.qoppa.pdfProcess.PDFDocument.PDFDocument() So is there anything I can do? The jar works perfectly with javac. If I can help in any way I would like to, but I have no experience in compilers and such things. And I hope its ok to hijack this bug. |
@odersky said: |
Dominik Maehl (dominikm) said: Maybe there could be a way to not parse every class file on compile? The runtime apparently is not affected by this problem. |
Pavol Vaskovic (pali-at-pali.sk) said: ... error: package trree contains object and package with same name: b
one of them needs to be removed from classpath
val sail = new com.ontotext.trree.OwlimSchemaRepository()
^ I am not importing the conflicting class nor package. This error breaks java interoperability. This worked with scala 2.7.7. Why are the scala package naming/importing rules enforced on valid binary java imports, instead of being scoped only on compiled scala sources? |
Andrey (andrey) said: |
Pavol Vaskovic (pali-at-pali.sk) said: Once my scala files do not contain a package/class naming conflict on the "package path" (i.e. in the fully qualified name) there is no problem. Note this is unrelated to using import statements, as the problem is triggered by mere fully qualified reference. I'm using class: com.ontotext.trree.OwlimSchemaRepository This seems to be an issue with the way compiler looks up imports. I believe it should emit the reported error only in case if I'm trying to import the object/package that has naming conflict and not when some of it's siblings are in conflict. |
Miles Egan (cageface) said: |
Kohsuke Kawaguchi (kohsuke) said (edited on Jun 7, 2011 10:49:13 PM UTC): In my situation, the fix would be easier. We just want scala compiler to only consider real packages that contain some classes. |
Commit Message Bot (anonymous) said: |
I can no longer profile scalac with yourkit (and it really needs some profiling!) because they obfuscate their jars, and the obfuscation algorithm generates packages and classes with the same name, as seen here:
scala refuses to deal with this:
I haven't looked enormously hard for a workaround yet, so maybe there is one; but this seems likely to be an ongoing issue. If such naming is legal on the JVM (and given that this is what yourkit ships, it must be) then it needs to be usable from scala or the promise of java compatibility takes another left to the jaw.
The text was updated successfully, but these errors were encountered: