Skip to content

WORDByReference.getValue() cause boundsCheck error at runtime #795

@kdeines

Description

@kdeines

I want to report a problem that I have fought for the last day or so.
WORDByReference TFS=new WORDByReference();
TFS.setValue(new WORD (10000));
System.out.println( "TFS="+ TFS.getPointer().getShort(0));//works shows a value of 10000
System.out.println( "TFS="+ TFS.getValue());//gives error
The line using TFS.getValue() causes an Memory.boundsCheck error at run time.
The line using TFS.getPointer().getShort(0) works.

The code for getValue in the WORDByReference Class is
public WORD getValue() {
return new WORD(getPointer().getInt(0));
}
shouldn't it be
public WORD getValue() {
return new WORD(getPointer().getShort(0));
}
I am no Java expert, but makes sense to me.
Thank you, Kent

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions