[ 
https://issues.apache.org/jira/browse/LUCENE-5463?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Muir updated LUCENE-5463:
--------------------------------

    Attachment: LUCENE-5463.patch

quick patch: I tried to clean things up so its clear which rules apply to:
1) both source and test code
2) just source code
3) just test code

some things fail that we must deal with:
{noformat}
[forbidden-apis] Reading bundled API signatures: jdk-system-out
[forbidden-apis] Reading API signatures: 
/home/rmuir/workspace/lucene-trunk/lucene/tools/forbiddenApis/rue.txt
[forbidden-apis] Loading classes to check...
[forbidden-apis] Scanning for API signatures and dependencies...
[forbidden-apis] Forbidden method invocation: 
org.apache.lucene.util.RamUsageEstimator#sizeOf(java.lang.Object) [slow]
[forbidden-apis]   in org.apache.lucene.util.RamUsageEstimator 
(RamUsageEstimator.java:586)
[forbidden-apis] Forbidden method invocation: 
org.apache.lucene.util.RamUsageEstimator#sizeOf(java.lang.Object) [slow]
[forbidden-apis]   in org.apache.lucene.search.CachingWrapperFilter 
(CachingWrapperFilter.java:163)
[forbidden-apis] Forbidden method invocation: 
org.apache.lucene.util.RamUsageEstimator#sizeOf(java.lang.Object) [slow]
[forbidden-apis]   in org.apache.lucene.search.FieldCache$CacheEntry 
(FieldCache.java:496)
[forbidden-apis] Scanned 1411 (and 173 related) class file(s) for forbidden API 
invocations (in 0.16s), 3 error(s).
{noformat}

> Make RamUsageEstimator.(human)sizeOf(Object) a forbidden API
> ------------------------------------------------------------
>
>                 Key: LUCENE-5463
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5463
>             Project: Lucene - Core
>          Issue Type: Task
>            Reporter: Adrien Grand
>            Assignee: Adrien Grand
>         Attachments: LUCENE-5463.patch
>
>
> We have had a few issues with {{RamUsageEstimator}} recently so I think we 
> should consider making the {{sizeOf(Object)}} and {{humanSizeOf(Object)}} 
> methods forbidden under src/java (however still allowed for tests as it is 
> handy to check the size computations which are done "manually"). However, 
> {{sizeOf(byte[])}}, {{shallowSizeOf(Class)}}, etc. remain useful so I think 
> we should keep them allowed.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to