Re: Removing jsr305

"Matthieu Casanova" <[email protected]> Sat, 14 Oct 2023 08:50:23 +0200
Newsgroups gmane.editors.jedit.devel
Message-ID <[email protected]>
Hey,
did you try to add a module-info.java in jEdit ?
I tried and got a split package error, I am of course not the only one, and it seems the solution for everybody is to replace the lib which is obsolete in my opinion.
https://nipafx.dev/jsr-305-java-9/ for example.
I have no strong opinion about the fact of making jEdit a JPMS but I don't like the idea of not being able to test it and maybe see advantages.
About replacing the annotations my intention would have been to use something widely used like jakarta annotations, but there is a different licence.
About the tools that uses those annotations I think most of them should be configurable as most major projects (Eclipse, Spring and many others define their own similar annotations). At least IntelliJ Idea is configurable for Nullable and Nonnull. Do you have in mind some tools you use that could not be configured for that ?

-- 
  Matthieu Casanova
  [email protected]


Ven 13 oct 2023, à 23:35, Vampire a écrit :
> Hi
> 
> Where did you actually see that problem and what exactly?
> 
> I checked in Java 11 and Java 21 and in both there are only things within `javax.annotation.processing`.
> In the jsr350 JAR are only things in `javax.annotation`, `javax.annotation.meta`,  and `javax.annotation.concurrent`, so there should not be a split-package problem there.
> 
> I also quickly tried in a play project and it works like a charm.
> jsr305 jar to the module path, a "requires transitive ..." clause to the module info, and all compiles just fine without complaint with both, Java 11 and Java 21.
> 
> Besides that, it is imho anyway questionable whether jEdit should be made a JPMS module.
> Which advantages do you see?
> If we would start from scratch, it would maybe make sense.
> And if we would have a clear definition of what Plugin API is and what not,
> it would probably also be great to enforce this restriction by default.
> 
> So unless we really want to define a clear Plugin API and forbid plugins to use anything else by default, it would maybe make sense.
> 
> But even then, as I wrote above it should not be much of a problem to continue using the jsr305 annotations.
> And it would probably even be preferable, as typically tools support these annotations,
> but will not support the custom copies you made.
> 
> What do you think?
> 
> Cheers
> Björn
> 
> 
> 
> 
> Am 11.10.2023 21:24, schrieb Matthieu Casanova:
>> Hey,
>> years ago I added the google jsr305 library (annotations like Nonnull, Nullable) which is mostly a helper for IDE and documentation.
>> Unfortunately that JSR was never aprooved which was not a problem until Java released the module system :
>> 
>> Because those annotations were in javax package it caused problems when activating the module system introduced in Java 9 because javax is of course part of JRE so another library cannot provide the same package.
>> So basically I created the same annotations in
>> 
>> org.jedit.annotation package.
>> 
>> 
>> Matthieu
>> 
>> 
>> 
>>

-- 
-----------------------------------------------
jEdit Developers' List
[email protected]
https://lists.sourceforge.net/lists/listinfo/jedit-devel