Skip to content

Commit

Permalink
Expand com.sun to actual packages
Browse files Browse the repository at this point in the history
`com.sun.jna` is _not_ in the standard library, so we were incorrectly
filtering it out.
  • Loading branch information
illicitonion committed Jul 24, 2023
1 parent 59d4e1a commit 3305a7f
Showing 1 changed file with 91 additions and 2 deletions.
93 changes: 91 additions & 2 deletions java/gazelle/private/java/java.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,98 @@ func IsTestPath(dir string) bool {
}

// This list was derived from a script along the lines of:
// for jmod in ${JAVA_HOME}; do unzip -l "${jmod}" 2>/dev/null; done | grep classes/ | awk '{print $4}' | sed -e 's#^classes/##' -e 's#\.class$##' | xargs -n1 dirname | sort | uniq | sed -e 's#/#.#g'
// for jmod in ${JAVA_HOME}/jmod/*; do unzip -l "${jmod}" 2>/dev/null; done | grep classes/ | awk '{print $4}' | sed -e 's#^classes/##' -e 's#\.class$##' | xargs -n1 dirname | sort | uniq | sed -e 's#/#.#g'
var stdlibPrefixes = []types.PackageName{
types.NewPackageName("com.sun"),
types.NewPackageName("com.sun.accessibility.internal.resources"),
types.NewPackageName("com.sun.beans"),
types.NewPackageName("com.sun.crypto.provider"),
types.NewPackageName("com.sun.imageio.plugins.bmp"),
types.NewPackageName("com.sun.imageio.plugins.common"),
types.NewPackageName("com.sun.imageio.plugins.gif"),
types.NewPackageName("com.sun.imageio.plugins.jpeg"),
types.NewPackageName("com.sun.imageio.plugins.png"),
types.NewPackageName("com.sun.imageio.plugins.tiff"),
types.NewPackageName("com.sun.imageio.plugins.wbmp"),
types.NewPackageName("com.sun.imageio.spi"),
types.NewPackageName("com.sun.imageio.stream"),
types.NewPackageName("com.sun.jarsigner"),
types.NewPackageName("com.sun.java.accessibility.util"),
types.NewPackageName("com.sun.java.swing"),
types.NewPackageName("com.sun.java_cup.internal.runtime"),
types.NewPackageName("com.sun.jdi"),
types.NewPackageName("com.sun.jmx.defaults"),
types.NewPackageName("com.sun.jmx.interceptor"),
types.NewPackageName("com.sun.jmx.mbeanserver"),
types.NewPackageName("com.sun.jmx.remote.internal"),
types.NewPackageName("com.sun.jmx.remote.protocol.rmi"),
types.NewPackageName("com.sun.jmx.remote.security"),
types.NewPackageName("com.sun.jmx.remote.util"),
types.NewPackageName("com.sun.jndi.dns"),
types.NewPackageName("com.sun.jndi.ldap"),
types.NewPackageName("com.sun.jndi.rmi.registry"),
types.NewPackageName("com.sun.jndi.toolkit.ctx"),
types.NewPackageName("com.sun.jndi.toolkit.dir"),
types.NewPackageName("com.sun.jndi.toolkit.url"),
types.NewPackageName("com.sun.jndi.url.dns"),
types.NewPackageName("com.sun.jndi.url.ldap"),
types.NewPackageName("com.sun.jndi.url.ldaps"),
types.NewPackageName("com.sun.jndi.url.rmi"),
types.NewPackageName("com.sun.management"),
types.NewPackageName("com.sun.media.sound"),
types.NewPackageName("com.sun.naming.internal"),
types.NewPackageName("com.sun.net.httpserver"),
types.NewPackageName("com.sun.nio.file"),
types.NewPackageName("com.sun.nio.sctp"),
types.NewPackageName("com.sun.org.apache.bcel.internal"),
types.NewPackageName("com.sun.org.apache.xalan.internal.extensions"),
types.NewPackageName("com.sun.org.apache.xalan.internal.lib"),
types.NewPackageName("com.sun.org.apache.xalan.internal.res"),
types.NewPackageName("com.sun.org.apache.xalan.internal.templates"),
types.NewPackageName("com.sun.org.apache.xalan.internal.utils"),
types.NewPackageName("com.sun.org.apache.xalan.internal.xsltc"),
types.NewPackageName("com.sun.org.apache.xerces.internal.dom"),
types.NewPackageName("com.sun.org.apache.xerces.internal.impl"),
types.NewPackageName("com.sun.org.apache.xerces.internal.jaxp"),
types.NewPackageName("com.sun.org.apache.xerces.internal.parsers"),
types.NewPackageName("com.sun.org.apache.xerces.internal.util"),
types.NewPackageName("com.sun.org.apache.xerces.internal.utils"),
types.NewPackageName("com.sun.org.apache.xerces.internal.xinclude"),
types.NewPackageName("com.sun.org.apache.xerces.internal.xni"),
types.NewPackageName("com.sun.org.apache.xerces.internal.xpointer"),
types.NewPackageName("com.sun.org.apache.xerces.internal.xs"),
types.NewPackageName("com.sun.org.apache.xml.internal.dtm"),
types.NewPackageName("com.sun.org.apache.xml.internal.res"),
types.NewPackageName("com.sun.org.apache.xml.internal.security"),
types.NewPackageName("com.sun.org.apache.xml.internal.serialize"),
types.NewPackageName("com.sun.org.apache.xml.internal.serializer"),
types.NewPackageName("com.sun.org.apache.xml.internal.utils"),
types.NewPackageName("com.sun.org.apache.xpath.internal"),
types.NewPackageName("com.sun.org.slf4j.internal"),
types.NewPackageName("com.sun.rowset"),
types.NewPackageName("com.sun.security.auth"),
types.NewPackageName("com.sun.security.jgss"),
types.NewPackageName("com.sun.security.ntlm"),
types.NewPackageName("com.sun.security.sasl"),
types.NewPackageName("com.sun.source.doctree"),
types.NewPackageName("com.sun.source.tree"),
types.NewPackageName("com.sun.source.util"),
types.NewPackageName("com.sun.swing.internal.plaf.basic.resources"),
types.NewPackageName("com.sun.swing.internal.plaf.metal.resources"),
types.NewPackageName("com.sun.swing.internal.plaf.synth.resources"),
types.NewPackageName("com.sun.tools.attach"),
types.NewPackageName("com.sun.tools.classfile"),
types.NewPackageName("com.sun.tools.doclint"),
types.NewPackageName("com.sun.tools.example.debug.expr"),
types.NewPackageName("com.sun.tools.example.debug.tty"),
types.NewPackageName("com.sun.tools.javac"),
types.NewPackageName("com.sun.tools.javap"),
types.NewPackageName("com.sun.tools.jconsole"),
types.NewPackageName("com.sun.tools.jdeprscan"),
types.NewPackageName("com.sun.tools.jdeps"),
types.NewPackageName("com.sun.tools.jdi"),
types.NewPackageName("com.sun.tools.script.shell"),
types.NewPackageName("com.sun.tools.sjavac"),
types.NewPackageName("com.sun.xml.internal.stream"),
types.NewPackageName("java"),
types.NewPackageName("javax.accessibility"),
types.NewPackageName("javax.annotation.processing"),
Expand Down

0 comments on commit 3305a7f

Please sign in to comment.