Skip to content

Commit

Permalink
Make the import of com.google.errorprone optional (#2795)
Browse files Browse the repository at this point in the history
Fix #2794
  • Loading branch information
laeubi authored Jan 30, 2025
1 parent b2e26fa commit be456cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion gson/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,9 @@
Bundle-ContactAddress: ${project.parent.url}
# Optional dependency for JDK's sun.misc.Unsafe
# Optional dependency to google.errorprone
# https://bnd.bndtools.org/chapters/920-faq.html#remove-unwanted-imports-
Import-Package: sun.misc;resolution:=optional, *
Import-Package: sun.misc;resolution:=optional, com.google.errorprone.*;resolution:=optional, *
-removeheaders: Private-Package
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ public void testImports() throws Exception {
.containsExactly(
// Dependency on JDK's sun.misc.Unsafe should be optional
"sun.misc;resolution:=optional",
"com.google.errorprone.annotations;version=\"" + errorProneVersionRange + "\"");
// Dependency on error prone should be optional
"com.google.errorprone.annotations;resolution:=optional;version=\""
+ errorProneVersionRange
+ "\"");

// Should not contain any import for Gson's own packages, see
// https://github.com/google/gson/pull/2735#issuecomment-2330047410
Expand Down

0 comments on commit be456cf

Please sign in to comment.