Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The problem is outside of your code snipplet. Besides i don't really know what you're trying to achieve with this code. It does absolutely nothing besides wasting time and calling <code>getCurrentLengthUnit()</code> if you are in one of the cases and throw an exception otherwise. All assignments write to LOCAL variables and do not have effects on any other variables.</p> <p>Your code has the same effect as the following implementation:</p> <pre><code>public static void getMinMaxValuesForNumberPicker(LengthType type, Integer min1, Integer max1, Integer min2, Integer max2) { switch (type) { case BODYSIZE: case CIRCUMFERENCE: case WRINKLE: case DISTANCE: getCurrentLengthUnit(); break; default: throw new RuntimeException("getMinMaxValuesForNumberPicker für " + type.name() + " nicht implementiert!"); } } </code></pre> <p>So either you call <code>getMinMaxValuesForNumberPicker</code> from <code>getCurrentLengthUnit</code> or you expect that your assignments have effect on the variables that are not local to your function. Writing to the parameters doesn't make the changes visible to the calling function:</p> <pre><code>Integer a=-1; Integer b=-1; Integer c=-1; Integer d=-1; getMinMaxValuesForNumberPicker(LengthType.BODYSIZE , a, b, c, d); // a, b, c, d are still -1 here although you never assigned -1 and "assigned" null to the parameters in getMinMaxValuesForNumberPicker // The parameters are just copies of the adresses of a, b, c and d and not aliases of a, b, c, and d </code></pre> <p>(I guess you didn't use the debugger to go through the code step by step. This may have caused some confusion.)</p> <h2>Note: Question has been edited since the code has been posted</h2>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload