nrainer

Germany

Jul
2
awarded Popular Question
Jun
24
comment When can I write Mockito.anyInt()?
Mockito.anyInt() has no effect if it is just invoked but not used. It does not affect the first code snippet, you could drop line 1 of the first code chunk.
Jun
19
answered Is it possible to use Mockito to completely stop a method from running?
Jun
18
answered Java way to create an object based on enum type
Jun
4
awarded Tumbleweed
Jun
2
comment Annotations to detect method calls with wrong order of String parameters
I disagree with your sidenote. An own wrapper class for each type (eg: SerialNumber.create("0001-1213-007")) gives you exactly the type safety you want to achieve...
May
28
asked Test Eclipse JDT refactoring
May
28
comment Can unchecked warnings be avoided when overriding a method with raw type parameters?
Can you please explain why methods with the same (erased) signature can be different methods for the compiler? The compiler does not know what the developer meant when coding... ;-)
May
18
comment In which condition which overloaded version of toArray() and toArray(T[] a) should be use?
Never, unless you want to get a ClassCastException. You can use the parameterless method if you want to work with an object array.
May
18
comment In which condition which overloaded version of toArray() and toArray(T[] a) should be use?
Your cast is not working, try it out! You don't waste memory if you pass in an array of the correct size: iName.toArray(new String[iName.size()]) is better than iName.toArray(new String[0]).
May
18
revised In which condition which overloaded version of toArray() and toArray(T[] a) should be use?
added 83 characters in body
May
18
answered In which condition which overloaded version of toArray() and toArray(T[] a) should be use?
Apr
27
awarded Organizer
Apr
27
revised Security - Method returns internal array - Sonar security warning - even when I am returning a clone
adjusted tags
Apr
27
answered Security - Method returns internal array - Sonar security warning - even when I am returning a clone
Apr
16
awarded Good Question
Apr
16
accepted Why can this generic method with a bound return any type?
Apr
16
revised Why can this generic method with a bound return any type?
replaced incorrect tag
Apr
16
awarded Yearling
Apr
16
awarded Nice Question
1 2 3 4 5