maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tibor Digana <tibordig...@apache.org>
Subject Re: Why can't dependency plugin "see" statics /and staticimports
Date Wed, 25 Nov 2015 08:26:31 GMT
AFAIK javac must keeps calling static field Test2.AZAZ.
But the runtime compiler (JustInTime compiler JIT) may or may not compile
the field to constant and inline private methods. That's the reason why
Java Reflection won't see any changes on the field if you call
setAccessible(true) and rewrite the field earlier before the reads.

On Wed, Nov 25, 2015 at 8:26 AM, Andreas Gudian [via Maven] <
ml-node+s40175n5852870h10@n5.nabble.com> wrote:

> AFAIR, such constants (primitives and Strings) are inlined by the compiler
> - and the dependeny analyzer works on the bytecode and not the sources,
> right?
>
>
>
> Am Mittwoch, 25. November 2015 schrieb Jochen Wiedmann :
>
> > What exactly is it, you'd like to detect?
> >
> >
> > On Wed, Nov 25, 2015 at 8:11 AM, Kristian Rosenvold
> > <[hidden email] <http:///user/SendEmail.jtp?type=node&node=5852870&i=0>
> <javascript:;>> wrote:
> > > I poked around in the depdenedncy analyzer code to see if I could make
> > > it "see" the following code:
> > >
> > > Module 1:
> > > public class Test2 {
> > >     public static final int AZAZ = 42;
> > > }
> > >
> > > Module 2:
> > >
> > > import foo.Test2;
> > >
> > > public class BarMain
> > > {
> > >     public static void main(String[] args) {
> > >         System.out.println("AZ " + Test2.AZAZ);
> > >     }
> > > }
> > >
> > > Isn't this possible to detect or am I just a total n00b with asm ??
> > >
> > >
> > > Kristian
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5852870&i=1> <javascript:;>
> > > For additional commands, e-mail: [hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5852870&i=2>
> > <javascript:;>
> > >
> >
> >
> >
> > --
> > The next time you hear: "Don't reinvent the wheel!"
> >
> >
> >
> http://www.keystonedevelopment.co.uk/wp-content/uploads/2014/10/evolution-of-the-wheel-300x85.jpg
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5852870&i=3> <javascript:;>
> > For additional commands, e-mail: [hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5852870&i=4> <javascript:;>
> >
> >
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://maven.40175.n5.nabble.com/Why-can-t-dependency-plugin-see-statics-and-staticimports-tp5852860p5852870.html
> To start a new topic under Maven Developers, email
> ml-node+s40175n142166h86@n5.nabble.com
> To unsubscribe from Maven Developers, click here
> <http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=142166&code=dGlib3JkaWdhbmFAYXBhY2hlLm9yZ3wxNDIxNjZ8LTI4OTQ5MjEwMg==>
> .
> NAML
> <http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://maven.40175.n5.nabble.com/Why-can-t-dependency-plugin-see-statics-and-staticimports-tp5852860p5852872.html
Sent from the Maven Developers mailing list archive at Nabble.com.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message