Skip to content

bug in java.text.SimpleDateFormat.parse(..) #291

Open

Description

@foreveremain

Found a deep seated bug in 5.0.1:

The following runs fine in Java but dies with

TypeError: Cannot read properties of null (reading 'hashCode$')
TypeError: Cannot read properties of null (reading 'hashCode$')
at Object.eval (swingjs/j2s/java/util/ResourceBundle.js:333:33)
at Object.eval [as c$$S$java_util_Locale$O] (swingjs/j2s/java/util/ResourceBundle.js:281:47)
at Clazz.new_ (http://localhost:8000/swingjs/swingjs2.js:15503:19)
at Function.eval [as getBundleImpl$S$java_util_Locale$O$java_util_ResourceBundle_Control] (swingjs/j2s/java/util/ResourceBundle.js:80:21)
at eval (swingjs/j2s/java/util/ResourceBundle.js:64:11)
at $I$ (swingjs/j2s/sun/util/resources/LocaleData.js:1:530)
at Function.eval [as getBundle$S$java_util_Locale] (swingjs/j2s/sun/util/resources/LocaleData.js:68:8)
at Function.eval [as getDateFormatData$java_util_Locale] (swingjs/j2s/sun/util/resources/LocaleData.js:41:11)
at clazz.eval [as cacheLookup$java_util_Locale] (swingjs/j2s/java/text/DateFormatSymbols.js:140:11)
at clazz.eval (swingjs/j2s/java/text/DateFormatSymbols.js:147:17)
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.Date;

public class testCal
{
  public static void main(String[] args)
  {
    var parser = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
    try
    {
      Date timestamp = parser.parse("1970-01-01T01:00:00",
              new ParsePosition(0));
      System.out.print("Success.");
    } catch (Throwable t)
    {
      System.err.print("Failed! ");
      t.printStackTrace();
    }

  }
}

Activity

  1. foreveremain commented on Oct 14, 2026

    @foreveremain
    Author

    history - I've been tracking down something screwy with SimpleDateFormat.parser in the 5.0.x runtime - that was fixed in 78c7b1d (cal was never updated with the new calendar before returning), but the same code yielded yet another problem.

  2. BobHanson commented on Oct 14, 2026

    @BobHanson
    Owner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions