You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/06/18 19:06:00 UTC
[GitHub] [netbeans] nbauma109 opened a new issue, #4243: Why is java/lang/Module repackaged in NetBeans ?
nbauma109 opened a new issue, #4243:
URL: https://github.com/apache/netbeans/issues/4243
### Apache NetBeans version
Apache NetBeans 14
### What happened
I have a project with org-netbeans-bootstrap-RELEASE140.jar as a dependency, which has java/lang/Module repackaged in it.
Before I get into the details of the problem, I would like to raise that it's not allowed to repackage JDK classes like that (I think on the scale of don'ts, this is much worse than using restricted intenal APIs), and as much good will I had to accomodate with that, I ran into some problems and it took me time to find that it was the issue.
I work under Eclipse and as soon I do a method search, Eclipse runs into an error. I reported the bug (https://bugs.eclipse.org/bugs/show_bug.cgi?id=578279) but as I look at the code at the line of the crash (QualifiedTypeReference.java:133), I see that the compiler is precisely trying to report that exact same problem of package conflict.
QualifiedTypeReference.java:133
```java
scope.problemReporter().conflictingPackagesFromModules(splitPackage, scope.module(), this.sourceStart, (int)this.sourcePositions[typeStart-1]);
````
I confirmed that the culprit was that java/lang/Module inside the jar as when I rollbacked to the latest version that didn't have it yet (RELEASE90), I stopped getting the issue.
I'm curious, why you need to do this ?
```java
package java.lang;
/** Dummy */
public class Module {
}
````
### How to reproduce
- Create a Eclipse project with org-netbeans-bootstrap-RELEASE140.jar as a dependency (RELEASE100+)
- Create a project with a record
In my minimal example, I just have one record in src/main/java :
public record MyRecord(String s1, String s2) {
}
My build.gradle at the root my project is :
plugins {
id 'java'
}
repositories {
mavenCentral()
}
dependencies {
//implementation 'org.netbeans.modules:org-netbeans-bootstrap:RELEASE90' // => OK
implementation 'org.netbeans.modules:org-netbeans-bootstrap:RELEASE100' // => ArrayIndexOutOfBoundsException
}
The issue happens while building but also whenever a method search is done.
### Did this work correctly in an earlier version?
Apache NetBeans 12.3 or earlier
### Operating System
Windows
### JDK
17
### Apache NetBeans packaging
Other
### Anything else
_No response_
### Are you willing to submit a pull request?
Yes
### Code of Conduct
Yes
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] jtulach commented on issue #4243: Why is java/lang/Module repackaged in NetBeans ?
Posted by GitBox <gi...@apache.org>.
jtulach commented on issue #4243:
URL: https://github.com/apache/netbeans/issues/4243#issuecomment-1159768544
I believe the `java/lang/Module` copy has been introduced as part of
https://github.com/apache/netbeans/commit/4325e6ca3600c7234072df38ce50ff8c69172343
commit. That commit also touches some tests and I believe these tests wouldn't compile on JDK-8 or pass on JDK-11 before.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] mbien commented on issue #4243: Why is java/lang/Module repackaged in NetBeans ?
Posted by GitBox <gi...@apache.org>.
mbien commented on issue #4243:
URL: https://github.com/apache/netbeans/issues/4243#issuecomment-1159574098
@jtulach @dukescript ping
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] nbauma109 commented on issue #4243: Why is java/lang/Module repackaged in NetBeans ?
Posted by GitBox <gi...@apache.org>.
nbauma109 commented on issue #4243:
URL: https://github.com/apache/netbeans/issues/4243#issuecomment-1159773425
I see that the jar that I obtained from Maven Central is built with 11.0.12+8-LTS-237 (Oracle Corporation) so it has the real java/lang/Module.
Does it still make sense to have JDK8 tests ?
Does it mean there is a JDK8 build ?
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] matthiasblaesing closed issue #4243: Why is java/lang/Module repackaged in NetBeans ?
Posted by GitBox <gi...@apache.org>.
matthiasblaesing closed issue #4243: Why is java/lang/Module repackaged in NetBeans ?
URL: https://github.com/apache/netbeans/issues/4243
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] mbien commented on issue #4243: Why is java/lang/Module repackaged in NetBeans ?
Posted by GitBox <gi...@apache.org>.
mbien commented on issue #4243:
URL: https://github.com/apache/netbeans/issues/4243#issuecomment-1159776621
probably another item on the (metaphorical) list we can get rid of once everything moves to JDK 11. We have some requests from the community to keep some modules compatible with JDK 8.
But if you want to run the IDE as a whole, only JDK 11+ is supported (some modules won't load otherwise + there is less and less tested on 8).
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists