>
> So, your official position is that declaring a variable as constant is
> typically pointless because some future programmer can always change the
> variable to not be constant
That is it! I do that a lot.. specially if I cannot find a reason to
declare a variable final. That is why quality co
So, your official position is that declaring a variable as constant is
typically pointless because some future programmer can always change the
variable to not be constant. :)
In this case, to appease both parties (you and Wido), I’ll leave it final, but
add a comment to explain why it’s final.
No setters help to make an object immutable, but in Java we have
reflection, and the only way to really avoid changing a property is using
the final modifier. However, even when using final, it is possible to do so
by manipulating the byte code of the class that describes the object and is
loaded t
“For instance, when we have to design/create a library and we want to make sure
an object is immutable.”
According to your argument, though, you don’t need final here either: just make
sure to never provide setters or change those values (and document).
> On Jan 20, 2018, at 9:37 AM, Tutkowski,
Personally, I’m OK with it either way here. If @wido reads what you wrote and
asks me to change it back to the way I wrote it initially, I’m happy to do so.
I believe he sees the explicitly declared constant here not only as a
protection against ourselves, but to prevent a future programmer from
Never is a strong word. In any case, let it be if you believe it is going
to provide benefits…
I believe `final` modifier should be used in certain situation when it is
truly required. For instance, when we have to design/create a library and
we want to make sure an object is immutable. Then, we
Perhaps your argument against the final keyword is that it should never be
used? If so, you and @wido can debate that and let me know which way you’d like
this bit of code to end up.
> On Jan 20, 2018, at 9:05 AM, Tutkowski, Mike
> wrote:
>
> It’s pretty much the reason why the final variable
It’s pretty much the reason why the final variable exists in Java: to make a
variable a constant so no one accidentally changes it. @wido just wanted the
code to protect against the variable being changed...that’s all.
> On Jan 20, 2018, at 8:25 AM, Rafael Weingärtner
> wrote:
>
> Changed by
Changed by a future programmer that may develop some changes in your code?
Because, if you do not code any other assignment to that variable, it will
never happen.
On Sat, Jan 20, 2018 at 1:16 PM, Tutkowski, Mike
wrote:
> @wido just wanted to make sure the Boolean variable didn’t accidentally
>
@wido just wanted to make sure the Boolean variable didn’t accidentally get
changed later since it’s critical it keep that value.
> On Jan 20, 2018, at 8:14 AM, Tutkowski, Mike
> wrote:
>
> I made it final per @wido’s comment (in #2415). How’s about you guys hash it
> out and get back to me.
I made it final per @wido’s comment (in #2415). How’s about you guys hash it
out and get back to me. :)
> On Jan 20, 2018, at 8:06 AM, GitBox wrote:
>
> rafaelweingartner commented on a change in pull request #2416:
> CLOUDSTACK-10244: KVM online storage migration fails
> URL: https://github.c
No problem,
To be honest host-ha was developed *because* vm-ha was not reliable under a
number of conditions, including a host failure.
paul.an...@shapeblue.com
www.shapeblue.com
53 Chandos Place, Covent Garden, London WC2N 4HSUK
@shapeblue
-Original Message-
From: Nux! [mailto:
12 matches
Mail list logo