From 00d49983018143ecf4a2f32b12c0427a5a6c0841 Mon Sep 17 00:00:00 2001 From: Dave Holoway Date: Sun, 7 Jun 2020 14:01:57 +0100 Subject: [PATCH] allow all primitive-number-type casts --- langserver/java/body-parser3.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/langserver/java/body-parser3.js b/langserver/java/body-parser3.js index 2c91450..50cea68 100644 --- a/langserver/java/body-parser3.js +++ b/langserver/java/body-parser3.js @@ -1063,10 +1063,13 @@ function isTypeCastable(source_type, cast_type) { case 'B': case 'S': case 'I': - case 'J': return /^([BSIJCFD]|Ljava\/lang\/(Byte|Short|Integer|Long|Character);)$/.test(source_type.typeSignature); + case 'J': + case 'C': case 'F': - case 'D': return /^([BSIJCFD]|Ljava\/lang\/(Byte|Short|Integer|Long|Character|Float|Double);)$/.test(source_type.typeSignature); - case 'Z': return /^([Z]|Ljava\/lang\/(Boolean);)$/.test(source_type.typeSignature); + case 'D': + return /^([BSIJCFD]|Ljava\/lang\/(Byte|Short|Integer|Long|Character|Float|Double);)$/.test(source_type.typeSignature); + case 'Z': + return /^([Z]|Ljava\/lang\/(Boolean);)$/.test(source_type.typeSignature); } return false; }