[
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: [email protected]
For additional commands, e-mail: [email protected]