Janino

Duplicate Single-Type-Imports and Single-Static-Imports cause compilation errors

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

Marcelll posted the following bug report on [janino-user]:

Hello Arno

I've tried to compile my class body with the new 2.53 version and the
integrated new static import feature.
When trying this i receive the strange error :

Class "myclass" was first imported as "com.xxx.xxx", now as "com.xxx.xxx"

Again i'm using the class body evaluator. Any idea what's going wrong ?

Thanks in advance fo any help !

Activity

Hide
Arno Unkrig added a comment -

According to the JLS3, duplicate single-type-imports, e.g.

import java.util.Map;
import java.util.Map;

or duplicate single-static-imports, e.g.

import java.lang.Integer.toString;
import java.lang.Integer.toString;

are not an error (as JANINO reports).

Inconsistent single-type-imports or single-static-imports, e.g.

import java.lang.Integer.toString;
import java.lang.Long.toString;

are errors, of course!

Show
Arno Unkrig added a comment - According to the JLS3, duplicate single-type-imports, e.g.
import java.util.Map;
import java.util.Map;
or duplicate single-static-imports, e.g.
import java.lang.Integer.toString;
import java.lang.Integer.toString;
are not an error (as JANINO reports). Inconsistent single-type-imports or single-static-imports, e.g.
import java.lang.Integer.toString;
import java.lang.Long.toString;
are errors, of course!
Hide
Arno Unkrig added a comment -

Fixed the behavior of JANINO according to the JLS.

Show
Arno Unkrig added a comment - Fixed the behavior of JANINO according to the JLS.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: