Skip to content
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

api-common using deprecated javax.annotation-api #1938

Open
sydney-munro opened this issue Aug 23, 2023 · 13 comments
Open

api-common using deprecated javax.annotation-api #1938

sydney-munro opened this issue Aug 23, 2023 · 13 comments
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@sydney-munro
Copy link

Google Cloud storage recieved googleapis/java-storage#2176 due to a transient dependency on javax.annotaion-api. This should be updated to the new jakarta namespace.

@blakeli0 blakeli0 added type: process A process-related concern. May include testing, release, or the like. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Aug 25, 2023
@suztomo
Copy link
Member

suztomo commented Aug 31, 2023

javax package is not compliant with Jakarta platform. Please release google-cloud-storage:jar which is Jakarta platform compliant.

Digging further.

Where do we use javax.annotation?

Here are example usages

sdk-platform-java

~/sdk-platform-java$ grep -ir javax.annotation . |awk -F':' '{print $2}' |sort -u gave

  • javax.annotation.concurrent.GuardedBy (RetentionPolicy.CLASS). This comes from com.google.code.findbugs:jsr305:jar:3.0.2
  • javax.annotation.Generated (RetentionPolicy.SOURCE) This comes from javax.annotation:javax.annotation-api:jar:1.3.2
  • javax.annotation.Nonnull (RetentionPolicy.RUNTIME) This comes from com.google.code.findbugs:jsr305:jar:3.0.2
  • javax.annotation.Nullable (RetentionPolicy.RUNTIME) This comes from com.google.code.findbugs:jsr305:jar:3.0.2

java-storage

  • javax.annotation.concurrent.Immutable (RetentionPolicy.CLASS) This comes from com.google.code.findbugs:jsr305:jar:3.0.2
  • javax.annotation.concurrent.ThreadSafe (RetentionPolicy.CLASS) This comes from com.google.code.findbugs:jsr305:jar:3.0.2
  • javax.annotation.Generated See above
  • javax.annotation.Nullable See above
  • javax.annotation.ParametersAreNonnullByDefault (RetentionPolicy.RUNTIME) This comes from com.google.code.findbugs:jsr305:jar:3.0.2

@suztomo
Copy link
Member

suztomo commented Aug 31, 2023

@abhishekshan03 Would you share details about the noncompliance? Do you get any error message when you use certain tools from Jakarta EE?

I found this article https://jakarta.ee/blogs/javax-jakartaee-namespace-ecosystem-progress/ but it didn't have any specifics about javax.annotation-api.

@suztomo suztomo added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed type: process A process-related concern. May include testing, release, or the like. labels Sep 1, 2023
@abhishekshan03
Copy link

Hi @suztomo
Please pardon my limited knowledge. As far as I know packages javax.* are not part of Jakarta EE platform and hence are deprecated and will be replaced by jakarta annotations
As an example please refer to below issue.
jruby/jruby#6514

@MyDogIsMyPersonality
Copy link

MyDogIsMyPersonality commented Sep 18, 2023

Hi @suztomo Is there any idea on when this might be released? It is blocking a major upgrade for us.

@suztomo
Copy link
Member

suztomo commented Sep 18, 2023

@abhishekshan03 @MyDogIsMyPersonality Are you suffering from some errors with certain tools when they're used with GCP Java libraries? I think it's easy to swap but I'd like to ensure to verify the fix.

Thank you for sharing jruby/jruby#6514. I see it's fixed there.

@MyDogIsMyPersonality
Copy link

There is more information in issue 2176, but Jakarta won't upgrade due to the transient dependency in javax.

@suztomo
Copy link
Member

suztomo commented Sep 18, 2023

@MyDogIsMyPersonality googleapis/java-storage#2176 does not have any errors.

Jakarta won't upgrade

Would you elaborate a bit more? Are you referencing a certain version of one of the tools listed in https://jakarta.ee/compatibility/ ?

@abhishekshan03
Copy link

@abhishekshan03 @MyDogIsMyPersonality Are you suffering from some errors with certain tools when they're used with GCP Java libraries? I think it's easy to swap but I'd like to ensure to verify the fix.

Thank you for sharing jruby/jruby#6514. I see it's fixed there.

@suztomo
I shared jruby/jruby#6514 as an example for your to refer. I havent not asked any action to be taken on this issue. javax.annotation-api.jar is deprecated and should be replaced by jakarta annotations. This ticket was to illustrate that other projects are replacing deprecated javax.annotation-api.jar with jarkarta annotations.

Can you please give us an ETA for replacing the dependency for javax.annotation-api.jar with jarkarta annotations in google-cloud-storage.jar ?

@abhishekshan03
Copy link

https://jakarta.ee/compatibility/

We are not facing any error but since there is dependency on the deprecated javax.annotation-api.jar, we are proactively removing such dependencies.

@suztomo
Copy link
Member

suztomo commented Sep 19, 2023

Thank you. It's good to hear that there's no one suffering from errors due to the annotations.

we are proactively removing such dependencies

It seems that you're not a normal user of Jakarta EE and Google Cloud. Do you mind sharing who is "we" here (organization name or the name of a team)? Given you're not suffering from this issue, I would like to know the context of why you want this change.

  • Do you know any changelog to library users when the library swaps javax.annotation-api to Jakarta Annotations (Does it break something?).
  • It seems https://jakarta.ee/specifications/annotations/ has multiple versions: 1.3, 2.0, 2.1, and 3.0. What version are you looking for?

@suztomo
Copy link
Member

suztomo commented Sep 20, 2023

Got information from the TAM. Thank you. I'll update you about the plan soon. We have the email thread to follow up.

@suztomo suztomo self-assigned this Sep 26, 2023
@suztomo
Copy link
Member

suztomo commented Sep 26, 2023

Continuing investigation.

@suztomo
Copy link
Member

suztomo commented Sep 27, 2023

We use code generators in Cloud SDK for Java, and they use javax.annotation.Generated:

Now each has tracking feature request (but no commitment). So far no one has suffered problems caused by javax namespace.

For GuardedBy, (usage), as long as the purpose is Errorprone's static analysis, Errorprone's com.google.errorprone.annotations.concurrent.GuardedBy is recommended one. I'm working on #2061.

GuardedBy

https://github.com/google/error-prone/blob/master/docs/bugpattern/GuardedBy.md

The GuardedBy analysis checks that fields or methods annotated with @GuardedBy(lock) are only accessed when the specified lock is held.

Would removing the synchronized clause fail the build? => Yes, the Bazel build caught a bug I intentionally introduced in #2060.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

5 participants