My Java is a little bit rusty, but in the following line:
String message = nonce + 12345 + key;
you're adding up 2 integers and a string. Does that work properly in Java? I can imagine you'd need to explicitly convert the ints to strings first.
you're totally right. + is left associative so written like that it didn't work because it did integer addition first and then conversion to string, finally strings concatenation.
However, my original code saves the client ID within a constant of type String.
Also, simply replacing
String message = nonce + 12345 + key
with
String message = nonce + "" + 12345 + key
does the trick and I get the same exact signature you are getting.
However, if I change the values of key,secret and client ID to suit my needs, I still get an invalid signature.
I have tried deactivating that api key and generate a new pair of key-secret but nothing changed. Response is always:
{"error": "Invalid signature"}
And Bitstamp support sucks since they haven't replied in 5 days