reflection - synthetic static fields in java with type "java.lang.Class" -


i saw synthetic fields in class org.jfree.data.time.regulartimeperiod, , have no ideas , for. use code find them out:

for (field f : regulartimeperiod.class.getdeclaredfields())     if (f.issynthetic()) system.out.println(f); 

and give these:

static java.lang.class org.jfree.data.time.regulartimeperiod.class$java$util$date static java.lang.class org.jfree.data.time.regulartimeperiod.class$java$util$timezone static java.lang.class org.jfree.data.time.regulartimeperiod.class$org$jfree$data$time$year static java.lang.class org.jfree.data.time.regulartimeperiod.class$org$jfree$data$time$quarter static java.lang.class org.jfree.data.time.regulartimeperiod.class$org$jfree$data$time$month static java.lang.class org.jfree.data.time.regulartimeperiod.class$org$jfree$data$time$day static java.lang.class org.jfree.data.time.regulartimeperiod.class$org$jfree$data$time$hour static java.lang.class org.jfree.data.time.regulartimeperiod.class$org$jfree$data$time$minute static java.lang.class org.jfree.data.time.regulartimeperiod.class$org$jfree$data$time$second static java.lang.class org.jfree.data.time.regulartimeperiod.class$org$jfree$data$time$millisecond 

any body have idea? curious :) thanks.

as far know, synthetic members meant accessed trusted code generated compiler, not haphazardly reflection.

compiler synthesizes hidden fields , methods in order implement scoping of names. these fields private unless noted otherwise, or @ of package scope.

a synthetic field pointing outermost enclosing instance named this$0. next-outermost enclosing instance this$1, , forth. (at 1 such field necessary in given inner class.) synthetic field containing copy of constant v named val$v. these fields final.

all these synthetic fields initialized constructor parameters, have same names fields initialize. if 1 of parameters innermost enclosing instance, first. such constructor parameters deemed synthetic. if compiler determines synthetic field's value used in code of constructor, may omit field itself, , use parameter implement variable references.

a non-private final synthetic method grants access private member or constructor has name of form access$n, n decimal numeral. organization of such access protocols unspecified.

i hope helps.

cheers


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -