From: Joshua Maurice on
On May 14, 5:24 pm, le...(a)lewscanon.com wrote:
> Arne Vajhøj wrote:
> >> static final is constant in Java.
>
> Joshua Maurice <joshuamaur...(a)gmail.com> wrote:
> > Ok. Let me try again. I recall only discussions of static finals. The
> > problem of expanding inline "things" also happens with non-static
> > final fields. I do not recall any discussion previous to that post of
> > mine about non-static final fields being a problem. I'm sorry; I did
> > not know that "constant" means "static final" in Java.
>
> Strictly speaking, it doesn't.  It's a really, really, really good
> idea to study the language spec if you actually want to learn Java.
> The relevant section is:
> <http://java.sun.com/docs/books/jls/third_edition/html/
> typesValues.html#10931>

I was being facetious. Oh nevermind. This little train of conversation
is going nowhere.

tl;dr I mentioned debug information in class files combined with ghost
dependencies might be enough. Later, when I found out it wasn't
enough, I posted here correcting myself saying "Actually, it's not".
Arne Vajhøj said "We told you". I said "No you didn't". He said "Yes
we did". And that is about the extent of the short thread of
conversation.
From: Arne Vajhøj on
On 14-05-2010 19:25, Joshua Maurice wrote:
> On May 14, 3:46 pm, Arne Vajh�j<a...(a)vajhoej.dk> wrote:
>> On 13-05-2010 21:14, Joshua Maurice wrote:
>>> On May 13, 5:07 pm, Arne Vajh�j<a...(a)vajhoej.dk> wrote:
>>>> On 13-05-2010 03:43, Joshua Maurice wrote:
>>>>> On May 12, 2:37 pm, Arne Vajh�j<a...(a)vajhoej.dk> wrote:
>>>>>> On 12-05-2010 17:35, Joshua Maurice wrote:
>>>>>>> Bad news. It appears that class files do not contain the necessary
>>>>>>> dependency information for my goal of not rebuilding all java files
>>>>>>> downstream. Ex:
>>
>>>>>>> //AA.java
>>>>>>> public class AA { public final int x = 1; }
>>
>>>>>>> //BB.java
>>>>>>> public class BB { public int x = new AA().x; }
>>
>>>>>> Well - we told you that last week, so that should not
>>>>>> come as a surprise.
>>
>>>>> I believe no one suggested specifically that "The dependency
>>>>> information contained in class files compiled with debug information
>>>>> ala javac -g and ghost dependencies obtained via JavacTask in
>>>>> tools.jar (which alone is highly underspecified) is insufficient to do
>>>>> a Java file level incremental build which does not cascade endlessly
>>>>> downstream."
>>
>>>> No but the case of constants not being in the class file
>>>> where explicitly discussed.
>>
>>> I'm sorry. Perhaps I am mistaken, but I recall only discussion of
>>> "static finals", not "constants". It does appear that "constants" is
>>> the correct conclusion.
>>
>> static final is constant in Java.
>
> Ok. Let me try again. I recall only discussions of static finals. The
> problem of expanding inline "things" also happens with non-static
> final fields. I do not recall any discussion previous to that post of
> mine about non-static final fields being a problem.

True.

It was static final we discussed.

But given that something is final the difference between
static and non-static is pretty small.

Arne
From: Arne Vajhøj on
On 14-05-2010 20:24, lewis(a)lewscanon.com wrote:
> Arne Vajh�j wrote:
>>> static final is constant in Java.
> Joshua Maurice<joshuamaur...(a)gmail.com> wrote:
>> Ok. Let me try again. I recall only discussions of static finals. The
>> problem of expanding inline "things" also happens with non-static
>> final fields. I do not recall any discussion previous to that post of
>> mine about non-static final fields being a problem. I'm sorry; I did
>> not know that "constant" means "static final" in Java.
>>
>
> Strictly speaking, it doesn't. It's a really, really, really good
> idea to study the language spec if you actually want to learn Java.
> The relevant section is:
> <http://java.sun.com/docs/books/jls/third_edition/html/
> typesValues.html#10931>

someaccess static final sometype somename = somevalue;

is Java's implementation of what is generally known as
a constant.

Arne
From: Joshua Maurice on
On May 14, 6:21 pm, Arne Vajhøj <a...(a)vajhoej.dk> wrote:
> On 14-05-2010 19:25, Joshua Maurice wrote:
>
>
>
> > On May 14, 3:46 pm, Arne Vajhøj<a...(a)vajhoej.dk>  wrote:
> >> On 13-05-2010 21:14, Joshua Maurice wrote:
> >>> On May 13, 5:07 pm, Arne Vajhøj<a...(a)vajhoej.dk>    wrote:
> >>>> On 13-05-2010 03:43, Joshua Maurice wrote:
> >>>>> On May 12, 2:37 pm, Arne Vajhøj<a...(a)vajhoej.dk>      wrote:
> >>>>>> On 12-05-2010 17:35, Joshua Maurice wrote:
> >>>>>>> Bad news. It appears that class files do not contain the necessary
> >>>>>>> dependency information for my goal of not rebuilding all java files
> >>>>>>> downstream. Ex:
>
> >>>>>>> //AA.java
> >>>>>>> public class AA { public final int x = 1; }
>
> >>>>>>> //BB.java
> >>>>>>> public class BB { public int x = new AA().x; }
>
> >>>>>> Well - we told you that last week, so that should not
> >>>>>> come as a surprise.
>
> >>>>> I believe no one suggested specifically that "The dependency
> >>>>> information contained in class files compiled with debug information
> >>>>> ala javac -g and ghost dependencies obtained via JavacTask in
> >>>>> tools.jar (which alone is highly underspecified) is insufficient to do
> >>>>> a Java file level incremental build which does not cascade endlessly
> >>>>> downstream."
>
> >>>> No but the case of constants not being in the class file
> >>>> where explicitly discussed.
>
> >>> I'm sorry. Perhaps I am mistaken, but I recall only discussion of
> >>> "static finals", not "constants". It does appear that "constants" is
> >>> the correct conclusion.
>
> >> static final is constant in Java.
>
> > Ok. Let me try again. I recall only discussions of static finals. The
> > problem of expanding inline "things" also happens with non-static
> > final fields. I do not recall any discussion previous to that post of
> > mine about non-static final fields being a problem.
>
> True.
>
> It was static final we discussed.
>
> But given that something is final the difference between
> static and non-static is pretty small.

Apparently. I'm sorry. I did not know. I was definitely under the
impression that specifically "static final" primitives can be expanded
inline. I thought there was a special language allowance for
specifically "static final". Apparently it's for "final", static or
not, (or Sun's javac is broken).
From: Lew on

Arne Vajhøj wrote:
>>>> static final is constant in Java.

Joshua Maurice<joshuamaur...(a)gmail.com> wrote:
>>> not know that "constant" means "static final" in Java.

Lew wrote:
>> Strictly speaking, it doesn't. It's a really, really, really good
>> idea to study the language spec if you actually want to learn Java.
>> The relevant section is:
>> <http://java.sun.com/docs/books/jls/third_edition/html/typesValues.html#10931>

Arne Vajhøj wrote:
> someaccess static final sometype somename = somevalue;
>
> is Java's implementation of what is generally known as
> a constant.

The point is that the JLS defines what a constant is, and "static" is not
necessary for the definition, nor is "final" sufficient.

Some say that it used to be "generally known" that the Earth is flat, but that
didn't make it so.

In the Java world, the term "constant" (actually, "constant variable") has a
precise definition. It ought to be be "generally known" to be what it
actually is, and to promulgate a different conception is a disservice to those
seeking to achieve proficiency in Java programming.

--
Lew