Skip to content

Commit be456cf

Browse files
authored
Make the import of com.google.errorprone optional (#2795)
Fix #2794
1 parent b2e26fa commit be456cf

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

gson/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,9 @@
146146
Bundle-ContactAddress: ${project.parent.url}
147147
148148
# Optional dependency for JDK's sun.misc.Unsafe
149+
# Optional dependency to google.errorprone
149150
# https://bnd.bndtools.org/chapters/920-faq.html#remove-unwanted-imports-
150-
Import-Package: sun.misc;resolution:=optional, *
151+
Import-Package: sun.misc;resolution:=optional, com.google.errorprone.*;resolution:=optional, *
151152
152153
-removeheaders: Private-Package
153154

gson/src/test/java/com/google/gson/integration/OSGiManifestIT.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,10 @@ public void testImports() throws Exception {
114114
.containsExactly(
115115
// Dependency on JDK's sun.misc.Unsafe should be optional
116116
"sun.misc;resolution:=optional",
117-
"com.google.errorprone.annotations;version=\"" + errorProneVersionRange + "\"");
117+
// Dependency on error prone should be optional
118+
"com.google.errorprone.annotations;resolution:=optional;version=\""
119+
+ errorProneVersionRange
120+
+ "\"");
118121

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

0 commit comments

Comments
 (0)