[ 
https://issues.apache.org/jira/browse/OAK-7217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16838660#comment-16838660
 ] 

Alex Deparvu edited comment on OAK-7217 at 5/15/19 10:27 AM:
-------------------------------------------------------------

I tried a different approach (bash script see  [^extract-guava.sh]), it wasn't 
obvious but I think I was able to collect usages of Guava.

There are 2 sets attached:
* complete usage set  [^guava-global.log] 
* only public packages set  [^guava-public.log]

Format is class and import (both normal import and static imports are captured)
{noformat}
oak-security-spi/src/main/java/org/apache/jackrabbit/oak/plugins/tree/TreeUtil.java:import
 com.google.common.base.Strings;
oak-security-spi/src/main/java/org/apache/jackrabbit/oak/plugins/tree/TreeUtil.java:import
 static com.google.common.collect.Iterables.contains;
{noformat}

this is how I had the global usage:
{code}
grep -Rw . -e 'import\( static\)\? com.google.common' --include=\*.java | grep 
-v '/src/test/' | sort
{code}

[edit] 
tldr; Attached a better version of the intersection:  [^guava-public-v2.log].

I just realized that this will only catch packages exported in the pom.xml, 
which is not the case for {{oak-commons}} for example. So I did another pass 
through the exports to correct the output manually and it turns out it wasn't 
too far off. there was only oak-auth-external, oak-commons, oak-store-composite 
that had nothing specified in the pom.xml file.

Modules analyzed:
- oak-auth-external (below public packages not listed in pom.xml)
    -- 
org.apache.jackrabbit.oak.spi.security.authentication.external,version=2.3.1
    -- 
org.apache.jackrabbit.oak.spi.security.authentication.external.basic,version=1.3.2
- oak-authorization-cug
- oak-authorization-principalbased
- oak-blob-cloud-azure
- oak-blob-cloud
   -- exports a package that doesn't exist 
'org.apache.jackrabbit.oak.blob.cloud.aws.s3'
- oak-blob-plugins
- oak-blob
- oak-commons (below public packages not listed in pom.xml)
    -- org.apache.jackrabbit.oak.commons,version=1.3.0
    -- org.apache.jackrabbit.oak.commons.cache,version=1.0.0
    -- org.apache.jackrabbit.oak.commons.concurrent,version=1.0.1
    -- org.apache.jackrabbit.oak.commons.io,version=1.0.0
    -- org.apache.jackrabbit.oak.commons.json,version=1.0.1
    -- org.apache.jackrabbit.oak.commons.sort,version=1.0.1
- oak-core-spi
- oak-core
- oak-jcr
- oak-lucene
    -- also exports all of org.apache.lucene
- oak-query-spi 
- oak-search
- oak-security-spi 
- oak-segment-azure 
- oak-segment-tar 
- oak-solr-core 
- oak-solr-osgi
- oak-store-composite (below public packages not listed in pom.xml)
    -- org.apache.jackrabbit.oak.composite,version=0.3.0
    -- org.apache.jackrabbit.oak.composite.checks,version=0.0.0
- oak-store-document 
- oak-store-spi



was (Author: alex.parvulescu):
I tried a different approach (bash script see  [^extract-guava.sh]), it wasn't 
obvious but I think I was able to collect usages of Guava.

There are 2 sets attached:
* complete usage set  [^guava-global.log] 
* only public packages set  [^guava-public.log]

Format is class and import (both normal import and static imports are captured)
{noformat}
oak-security-spi/src/main/java/org/apache/jackrabbit/oak/plugins/tree/TreeUtil.java:import
 com.google.common.base.Strings;
oak-security-spi/src/main/java/org/apache/jackrabbit/oak/plugins/tree/TreeUtil.java:import
 static com.google.common.collect.Iterables.contains;
{noformat}

this is how I had the global usage:
{code}
grep -Rw . -e 'import\( static\)\? com.google.common' --include=\*.java | grep 
-v '/src/test/' | sort
{code}

[edit] just realised that this will only catch packages exported in the 
pom.xml, which is not the case for {{oak-commons}} for example.

I did another pass through the exports to correct the output manually and it 
turns out it wasn't too far off. there was only oak-auth-external, oak-commons, 
oak-store-composite that had nothing specified in the pom.xml file. Attached a 
new version of the intersection:  [^guava-public-v2.log].

Modules analyzed:
- oak-auth-external (below public packages not listed in pom.xml)
    -- 
org.apache.jackrabbit.oak.spi.security.authentication.external,version=2.3.1
    -- 
org.apache.jackrabbit.oak.spi.security.authentication.external.basic,version=1.3.2
- oak-authorization-cug
- oak-authorization-principalbased
- oak-blob-cloud-azure
- oak-blob-cloud
   -- exports a package that doesn't exist 
'org.apache.jackrabbit.oak.blob.cloud.aws.s3'
- oak-blob-plugins
- oak-blob
- oak-commons (below public packages not listed in pom.xml)
    -- org.apache.jackrabbit.oak.commons,version=1.3.0
    -- org.apache.jackrabbit.oak.commons.cache,version=1.0.0
    -- org.apache.jackrabbit.oak.commons.concurrent,version=1.0.1
    -- org.apache.jackrabbit.oak.commons.io,version=1.0.0
    -- org.apache.jackrabbit.oak.commons.json,version=1.0.1
    -- org.apache.jackrabbit.oak.commons.sort,version=1.0.1
- oak-core-spi
- oak-core
- oak-jcr
- oak-lucene
    -- also exports all of org.apache.lucene
- oak-query-spi 
- oak-search
- oak-security-spi 
- oak-segment-azure 
- oak-segment-tar 
- oak-solr-core 
- oak-solr-osgi
- oak-store-composite (below public packages not listed in pom.xml)
    -- org.apache.jackrabbit.oak.composite,version=0.3.0
    -- org.apache.jackrabbit.oak.composite.checks,version=0.0.0
- oak-store-document 
- oak-store-spi


> check public Oak APIs for references to Guava
> ---------------------------------------------
>
>                 Key: OAK-7217
>                 URL: https://issues.apache.org/jira/browse/OAK-7217
>             Project: Jackrabbit Oak
>          Issue Type: Technical task
>            Reporter: Julian Reschke
>            Priority: Minor
>         Attachments: detect-api.diff, extract-guava.sh, guava-global.log, 
> guava-public-v2.log, guava-public.log
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to