google / google/error-prone

JPMS: Cannot use both annotations and type-annotations

Open
#4,888 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
7.2k
Forks
820
Avg merge
5h 9m
Merged PRs (30d)
50

Description

I'm trying to use both [@Immutable and @ImmutableTypeParameter](https://errorprone.info/bugpattern/Immutable#immutabletypeparameter) in a JPMS project. However, using annotations from both `error_prone_annotations` and `error_prone_type_annotations` doesn't work because they both export the same package.

```java
module test.foo {
requires com.google.errorprone.annotations;
requires com.google.errorprone.type.annotations;
}
```

Compilation fails with:

> [ERROR] module test.foo reads package com.google.errorprone.annotations from both com.google.errorprone.type.annotations and com.google.errorprone.annotations

Is there a path to supporting all available annotations with JPMS?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.