Skip to content

Cannot convert Boolean object to Primitive value #19

@upahsan

Description

@upahsan

This issue is present in 2.0.0 but not 3.1.1

When trying to print a Boolean object, the javascript created by j2s crashes because it cannot convert the object to a primitive value.

Code:

package test;

public class BooleanValuePrinting {
    	
	public static void main(String[] args) 
	{
		Boolean b = Boolean.FALSE;
		
		System.out.println("Checking Boolean.FALSE");
		System.out.println(Boolean.FALSE);
		
		System.out.println("Checking Boolean.TRUE");
		System.out.println(Boolean.TRUE);
		
		System.out.println("Checking b");
		System.out.println(b);
		
		System.out.println("done");
	}
}

Regardless of order, the j2s version crashes when trying to print a Boolean.

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