Bug 577799 - NumberFormatException for 0x80000000 Expression
Summary: NumberFormatException for 0x80000000 Expression
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.22   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-14 09:50 EST by Jörg Kubitz CLA
Modified: 2023-12-06 07:30 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jörg Kubitz CLA 2021-12-14 09:50:20 EST
In java it is defined: java.lang.Integer.MIN_VALUE = 0x80000000;
It resolves to -2147483648
But typing "0x80000000" in Expression View results in Exception:

eclipse.buildId=4.22.0.I20211124-1800
java.version=11.0.13
java.vendor=Eclipse Adoptium
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de_DE
Framework arguments:  -product org.eclipse.epp.package.committers.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.committers.product

org.eclipse.jdt.debug
Error
Tue Dec 14 15:45:27 CET 2021
Exception processing async thread queue

java.lang.NumberFormatException: For input string: "80000000"
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.base/java.lang.Integer.parseInt(Integer.java:652)
	at org.eclipse.jdt.internal.debug.eval.ast.engine.ASTInstructionCompiler.parseIntValue(ASTInstructionCompiler.java:3292)
	at org.eclipse.jdt.internal.debug.eval.ast.engine.ASTInstructionCompiler.visit(ASTInstructionCompiler.java:3252)
	at org.eclipse.jdt.core.dom.NumberLiteral.accept0(NumberLiteral.java:127)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:3129)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:3177)
	at org.eclipse.jdt.core.dom.ReturnStatement.accept0(ReturnStatement.java:128)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:3129)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:3200)
	at org.eclipse.jdt.core.dom.Block.accept0(Block.java:128)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:3129)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:3177)
	at org.eclipse.jdt.core.dom.MethodDeclaration.accept0(MethodDeclaration.java:677)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:3129)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:3200)
	at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:499)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:3129)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:3200)
	at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:258)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:3129)
	at org.eclipse.jdt.internal.debug.eval.ast.engine.ASTEvaluationEngine.createExpressionFromAST(ASTEvaluationEngine.java:713)
	at org.eclipse.jdt.internal.debug.eval.ast.engine.ASTEvaluationEngine.getCompiledExpression(ASTEvaluationEngine.java:405)
	at org.eclipse.jdt.internal.debug.eval.ast.engine.ASTEvaluationEngine.evaluate(ASTEvaluationEngine.java:154)
	at org.eclipse.jdt.internal.debug.ui.JavaWatchExpressionDelegate$EvaluationRunnable.run(JavaWatchExpressionDelegate.java:153)
	at org.eclipse.jdt.internal.debug.core.model.JDIThread$ThreadJob.run(JDIThread.java:3436)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Comment 1 Jörg Kubitz CLA 2021-12-14 09:55:11 EST
There is also an error when using "-2147483648" in an expression:
"-2147483648" => -2147483648 OK
"0-2147483648" => "The literal 2147483648 of type int is out of range" NOK
"0+-2147483648" => -2147483648 OK
Comment 2 Sarika Sinha CLA 2021-12-15 13:27:20 EST
Try out :
Integer.parseInt("80000000", 16);

Gives same error:
Exception in thread "main" java.lang.NumberFormatException: For input string: "80000000" under radix 16
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
	at java.base/java.lang.Integer.parseInt(Integer.java:660)
Comment 3 Eclipse Genie CLA 2023-12-06 07:30:43 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.