#28 Invoking static methods via void but typed references

open
nobody
General (151)
1
2001-05-04
2001-03-27
Allan Crooks
No

Hi,

The following piece of code works in Java, but
generates a null pointer problem in BeanShell. Hardly
the most important of things, but for consistency's
sake, it might be worth changing.

System system;
system.currentTimeMillis();

Allan.

Discussion

  • Pat Niemeyer
    Pat Niemeyer
    2001-05-04

    • priority: 5 --> 1
    • summary: Invoking static methods via references --> Invoking static methods via void but typed references
     
  • Pat Niemeyer
    Pat Niemeyer
    2001-05-04

    Logged In: YES
    user_id=18885

    I don't think I'd ever thought of that ;) In bsh the
    unassigned var cannot currently be used to make a static
    reference. I agree that this is wrong, but it's a low
    priority...

    Interestingly, the following works in bsh, but is not legal
    in Java:

    System system = System;
    system.currentTimeMillis();

    Thanks,
    Pat