Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: Java-Dev

[jira] [Comment Edited] (LUCENE-4202) allow check-forbidden-apis to look for fields too

 

 

Lucene java-dev RSS feed   Index | Next | Previous | View Threaded


jira at apache

Jul 9, 2012, 2:02 PM

Post #1 of 2 (47 views)
Permalink
[jira] [Comment Edited] (LUCENE-4202) allow check-forbidden-apis to look for fields too

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

Uwe Schindler edited comment on LUCENE-4202 at 7/9/12 9:01 PM:
---------------------------------------------------------------

Hi Robert,
here the patch that implements this. You can add the remaining fields and commit if you like.

There is one general problem with adding deprecations in general (when doing byte-code analysis):

In bytecode, we only know two things:
- The type of field or local variable or static class, on which we do the invoke/putfield/getfield, but we don't know any parent class (in ASM this is called "owner").
- the name and signature of the method/field to call/getfield/putfield.

So if you add java.lang.Throwable#printStackTrace() to the list, it will only find invocations of local variables/fields of type java.lang.Throwable. So code like:

{code:java}
Exception e = .... / } catch (IOException e) {
e.printStackTrace()
{code}

will in bytecocde have no reference to java.lang.Throwable. This would need more work. I will sleep a night about it...

was (Author: thetaphi):
Hi Robert,
here the patch that implements this. You can add the remaining fields and commit if you like.

There is one general problem with adding deprecations in general (when doing byte-code analysis):

In bytecode, we only know two things:
- The type of field or local variable or static class, on which we do the invoke/putfield/getfield, but we don't know any parent class.
- the name and signature of the method/field to call/getfield/putfield

So if you add java.lang.Throwable#printStackTrace() to the list, it will only find invocations of local variables/fields of type java.lang.Throwable. So code like:

{code:java}
Exception e = .... / } catch (IOException e) {
e.printStackTrace()
{code}

will in bytecocde have no reference to java.lang.Throwable. This would need more work. I will sleep a night about it...

> allow check-forbidden-apis to look for fields too
> -------------------------------------------------
>
> Key: LUCENE-4202
> URL: https://issues.apache.org/jira/browse/LUCENE-4202
> Project: Lucene - Java
> Issue Type: New Feature
> Components: general/build
> Reporter: Robert Muir
> Assignee: Uwe Schindler
> Attachments: LUCENE-4202.patch
>
>
> Currently this supports classes and methods, but there are some deprecated fields in the java API, it would be nice to check for those, too.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe [at] lucene
For additional commands, e-mail: dev-help [at] lucene


jira at apache

Jul 9, 2012, 11:01 PM

Post #2 of 2 (44 views)
Permalink
[jira] [Comment Edited] (LUCENE-4202) allow check-forbidden-apis to look for fields too [In reply to]

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

Uwe Schindler edited comment on LUCENE-4202 at 7/10/12 6:01 AM:
----------------------------------------------------------------

Robert, I have no solution until now. I fogot to mention yesterday: You can add your fields and then commit this you like.

was (Author: thetaphi):
Robert, I have solution until now. I fogot to mention yesterday: You can add your fields and then commit this you like.

> allow check-forbidden-apis to look for fields too
> -------------------------------------------------
>
> Key: LUCENE-4202
> URL: https://issues.apache.org/jira/browse/LUCENE-4202
> Project: Lucene - Java
> Issue Type: New Feature
> Components: general/build
> Reporter: Robert Muir
> Assignee: Uwe Schindler
> Attachments: LUCENE-4202.patch
>
>
> Currently this supports classes and methods, but there are some deprecated fields in the java API, it would be nice to check for those, too.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe [at] lucene
For additional commands, e-mail: dev-help [at] lucene

Lucene java-dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.