You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bsf-dev@jakarta.apache.org by "Rony G. Flatscher (JIRA)" <ji...@apache.org> on 2007/11/01 20:45:50 UTC

[jira] Created: (BSF-9) SimpleScriptContext.java cannot be compiled with Java 1.4

SimpleScriptContext.java cannot be compiled with Java 1.4
---------------------------------------------------------

                 Key: BSF-9
                 URL: https://issues.apache.org/jira/browse/BSF-9
             Project: BSF
          Issue Type: Bug
    Affects Versions: BSF-3.0
         Environment: Java 1.4
            Reporter: Rony G. Flatscher
            Assignee: Sanka Samaranayake


While attempting to create the BSF3.0 beta2 distribution from ant elder's sources with Java 1.4, the building stops with an error stating:

------------- cut here ----------
F:\download\Apache\bsf\bsf3\bsf-3.0-beta2-src\bsf-api\src\main\java\javax\script\SimpleScriptContext.java:46: cannot resolve symbol
symbol  : method valueOf (int)
location: class java.lang.Integer
	private static final List SCOPES = Arrays.asList(new Integer[] { Integer.valueOf(ENGINE_SCOPE), Integer.valueOf(GLOBAL_SCOPE) });
                                                                                ^
F:\download\Apache\bsf\bsf3\bsf-3.0-beta2-src\bsf-api\src\main\java\javax\script\SimpleScriptContext.java:46: cannot resolve symbol
symbol  : method valueOf (int)
location: class java.lang.Integer
	private static final List SCOPES = Arrays.asList(new Integer[] { Integer.valueOf(ENGINE_SCOPE), Integer.valueOf(GLOBAL_SCOPE) });
                                                                                                               ^
2 errors
------------- cut here ----------

Indeed, "Integer.valueOf(int)" got introduced with Java 1.5.

As BSF3 should be deployable with Java 1.4, this would need to be fixed.

Here is a unified diff which corrects the problem:

------------- cut here ----------
--- bkp\SimpleScriptContext.java	2007-11-01 16:48:10.000000000 +0100
+++ SimpleScriptContext.java	2007-11-01 20:35:07.906250000 +0100
@@ -43,7 +43,7 @@
 

 	private Writer errorWriter;

 

-	private static final List SCOPES = Arrays.asList(new Integer[] { Integer.valueOf(ENGINE_SCOPE), Integer.valueOf(GLOBAL_SCOPE) });

+	private static final List SCOPES = Arrays.asList(new Integer[] { Integer.valueOf(""+ENGINE_SCOPE), Integer.valueOf(""+GLOBAL_SCOPE) });

 	

 	public SimpleScriptContext() {

         reader = new InputStreamReader(System.in);
------------- cut here ----------

Regards,

---rony



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: bsf-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bsf-dev-help@jakarta.apache.org


[jira] Commented: (BSF-9) SimpleScriptContext.java cannot be compiled with Java 1.4

Posted by "ant elder (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BSF-9?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12539464 ] 

ant elder commented on BSF-9:
-----------------------------

I'm hoping this is a limitation that although the BSF jars work with pre JDK5 JREs the actual build does requires JDK5. I'm moving house today/tomorrow so wont be able to verify this, can anyone else confirm?

> SimpleScriptContext.java cannot be compiled with Java 1.4
> ---------------------------------------------------------
>
>                 Key: BSF-9
>                 URL: https://issues.apache.org/jira/browse/BSF-9
>             Project: BSF
>          Issue Type: Bug
>    Affects Versions: BSF-3.0
>         Environment: Java 1.4
>            Reporter: Rony G. Flatscher
>            Assignee: Sanka Samaranayake
>
> While attempting to create the BSF3.0 beta2 distribution from ant elder's sources with Java 1.4, the building stops with an error stating:
> ------------- cut here ----------
> F:\download\Apache\bsf\bsf3\bsf-3.0-beta2-src\bsf-api\src\main\java\javax\script\SimpleScriptContext.java:46: cannot resolve symbol
> symbol  : method valueOf (int)
> location: class java.lang.Integer
> 	private static final List SCOPES = Arrays.asList(new Integer[] { Integer.valueOf(ENGINE_SCOPE), Integer.valueOf(GLOBAL_SCOPE) });
>                                                                                 ^
> F:\download\Apache\bsf\bsf3\bsf-3.0-beta2-src\bsf-api\src\main\java\javax\script\SimpleScriptContext.java:46: cannot resolve symbol
> symbol  : method valueOf (int)
> location: class java.lang.Integer
> 	private static final List SCOPES = Arrays.asList(new Integer[] { Integer.valueOf(ENGINE_SCOPE), Integer.valueOf(GLOBAL_SCOPE) });
>                                                                                                                ^
> 2 errors
> ------------- cut here ----------
> Indeed, "Integer.valueOf(int)" got introduced with Java 1.5.
> As BSF3 should be deployable with Java 1.4, this would need to be fixed.
> Here is a unified diff which corrects the problem:
> ------------- cut here ----------
> --- bkp\SimpleScriptContext.java	2007-11-01 16:48:10.000000000 +0100
> +++ SimpleScriptContext.java	2007-11-01 20:35:07.906250000 +0100
> @@ -43,7 +43,7 @@
>  
>  	private Writer errorWriter;
>  
> -	private static final List SCOPES = Arrays.asList(new Integer[] { Integer.valueOf(ENGINE_SCOPE), Integer.valueOf(GLOBAL_SCOPE) });
> +	private static final List SCOPES = Arrays.asList(new Integer[] { Integer.valueOf(""+ENGINE_SCOPE), Integer.valueOf(""+GLOBAL_SCOPE) });
>  	
>  	public SimpleScriptContext() {
>          reader = new InputStreamReader(System.in);
> ------------- cut here ----------
> Regards,
> ---rony

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: bsf-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bsf-dev-help@jakarta.apache.org


[jira] Resolved: (BSF-9) SimpleScriptContext.java cannot be compiled with Java 1.4

Posted by "Sebb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/BSF-9?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb resolved BSF-9.
--------------------

    Resolution: Fixed

> SimpleScriptContext.java cannot be compiled with Java 1.4
> ---------------------------------------------------------
>
>                 Key: BSF-9
>                 URL: https://issues.apache.org/jira/browse/BSF-9
>             Project: BSF
>          Issue Type: Bug
>    Affects Versions: BSF-3.0
>         Environment: Java 1.4
>            Reporter: Rony G. Flatscher
>            Assignee: Sanka Samaranayake
>
> While attempting to create the BSF3.0 beta2 distribution from ant elder's sources with Java 1.4, the building stops with an error stating:
> ------------- cut here ----------
> F:\download\Apache\bsf\bsf3\bsf-3.0-beta2-src\bsf-api\src\main\java\javax\script\SimpleScriptContext.java:46: cannot resolve symbol
> symbol  : method valueOf (int)
> location: class java.lang.Integer
> 	private static final List SCOPES = Arrays.asList(new Integer[] { Integer.valueOf(ENGINE_SCOPE), Integer.valueOf(GLOBAL_SCOPE) });
>                                                                                 ^
> F:\download\Apache\bsf\bsf3\bsf-3.0-beta2-src\bsf-api\src\main\java\javax\script\SimpleScriptContext.java:46: cannot resolve symbol
> symbol  : method valueOf (int)
> location: class java.lang.Integer
> 	private static final List SCOPES = Arrays.asList(new Integer[] { Integer.valueOf(ENGINE_SCOPE), Integer.valueOf(GLOBAL_SCOPE) });
>                                                                                                                ^
> 2 errors
> ------------- cut here ----------
> Indeed, "Integer.valueOf(int)" got introduced with Java 1.5.
> As BSF3 should be deployable with Java 1.4, this would need to be fixed.
> Here is a unified diff which corrects the problem:
> ------------- cut here ----------
> --- bkp\SimpleScriptContext.java	2007-11-01 16:48:10.000000000 +0100
> +++ SimpleScriptContext.java	2007-11-01 20:35:07.906250000 +0100
> @@ -43,7 +43,7 @@
>  
>  	private Writer errorWriter;
>  
> -	private static final List SCOPES = Arrays.asList(new Integer[] { Integer.valueOf(ENGINE_SCOPE), Integer.valueOf(GLOBAL_SCOPE) });
> +	private static final List SCOPES = Arrays.asList(new Integer[] { Integer.valueOf(""+ENGINE_SCOPE), Integer.valueOf(""+GLOBAL_SCOPE) });
>  	
>  	public SimpleScriptContext() {
>          reader = new InputStreamReader(System.in);
> ------------- cut here ----------
> Regards,
> ---rony

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: bsf-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bsf-dev-help@jakarta.apache.org


[jira] Commented: (BSF-9) SimpleScriptContext.java cannot be compiled with Java 1.4

Posted by "Rony G. Flatscher (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BSF-9?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12539466 ] 

Rony G. Flatscher commented on BSF-9:
-------------------------------------

Well, I am able to setup clean environments from JDK 1.1 through 1.6. The suggested change should allow it to be compiled on any JDK 1.4 and up (did test that successfully with all programs in the BSF-3 javax.script package).

(The reason why I am running JDK 1.4 is just to test whether methods get used, that are not available on 1.4 yet.)

> SimpleScriptContext.java cannot be compiled with Java 1.4
> ---------------------------------------------------------
>
>                 Key: BSF-9
>                 URL: https://issues.apache.org/jira/browse/BSF-9
>             Project: BSF
>          Issue Type: Bug
>    Affects Versions: BSF-3.0
>         Environment: Java 1.4
>            Reporter: Rony G. Flatscher
>            Assignee: Sanka Samaranayake
>
> While attempting to create the BSF3.0 beta2 distribution from ant elder's sources with Java 1.4, the building stops with an error stating:
> ------------- cut here ----------
> F:\download\Apache\bsf\bsf3\bsf-3.0-beta2-src\bsf-api\src\main\java\javax\script\SimpleScriptContext.java:46: cannot resolve symbol
> symbol  : method valueOf (int)
> location: class java.lang.Integer
> 	private static final List SCOPES = Arrays.asList(new Integer[] { Integer.valueOf(ENGINE_SCOPE), Integer.valueOf(GLOBAL_SCOPE) });
>                                                                                 ^
> F:\download\Apache\bsf\bsf3\bsf-3.0-beta2-src\bsf-api\src\main\java\javax\script\SimpleScriptContext.java:46: cannot resolve symbol
> symbol  : method valueOf (int)
> location: class java.lang.Integer
> 	private static final List SCOPES = Arrays.asList(new Integer[] { Integer.valueOf(ENGINE_SCOPE), Integer.valueOf(GLOBAL_SCOPE) });
>                                                                                                                ^
> 2 errors
> ------------- cut here ----------
> Indeed, "Integer.valueOf(int)" got introduced with Java 1.5.
> As BSF3 should be deployable with Java 1.4, this would need to be fixed.
> Here is a unified diff which corrects the problem:
> ------------- cut here ----------
> --- bkp\SimpleScriptContext.java	2007-11-01 16:48:10.000000000 +0100
> +++ SimpleScriptContext.java	2007-11-01 20:35:07.906250000 +0100
> @@ -43,7 +43,7 @@
>  
>  	private Writer errorWriter;
>  
> -	private static final List SCOPES = Arrays.asList(new Integer[] { Integer.valueOf(ENGINE_SCOPE), Integer.valueOf(GLOBAL_SCOPE) });
> +	private static final List SCOPES = Arrays.asList(new Integer[] { Integer.valueOf(""+ENGINE_SCOPE), Integer.valueOf(""+GLOBAL_SCOPE) });
>  	
>  	public SimpleScriptContext() {
>          reader = new InputStreamReader(System.in);
> ------------- cut here ----------
> Regards,
> ---rony

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: bsf-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bsf-dev-help@jakarta.apache.org


[jira] Commented: (BSF-9) SimpleScriptContext.java cannot be compiled with Java 1.4

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/BSF-9?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12688745#action_12688745 ] 

Sebb commented on BSF-9:
------------------------

This has been fixed as follows:

Arrays.asList(new Integer[] { new Integer(ENGINE_SCOPE), new Integer(GLOBAL_SCOPE) });

So I think this issue can be marked as resolved and/or closed

> SimpleScriptContext.java cannot be compiled with Java 1.4
> ---------------------------------------------------------
>
>                 Key: BSF-9
>                 URL: https://issues.apache.org/jira/browse/BSF-9
>             Project: BSF
>          Issue Type: Bug
>    Affects Versions: BSF-3.0
>         Environment: Java 1.4
>            Reporter: Rony G. Flatscher
>            Assignee: Sanka Samaranayake
>
> While attempting to create the BSF3.0 beta2 distribution from ant elder's sources with Java 1.4, the building stops with an error stating:
> ------------- cut here ----------
> F:\download\Apache\bsf\bsf3\bsf-3.0-beta2-src\bsf-api\src\main\java\javax\script\SimpleScriptContext.java:46: cannot resolve symbol
> symbol  : method valueOf (int)
> location: class java.lang.Integer
> 	private static final List SCOPES = Arrays.asList(new Integer[] { Integer.valueOf(ENGINE_SCOPE), Integer.valueOf(GLOBAL_SCOPE) });
>                                                                                 ^
> F:\download\Apache\bsf\bsf3\bsf-3.0-beta2-src\bsf-api\src\main\java\javax\script\SimpleScriptContext.java:46: cannot resolve symbol
> symbol  : method valueOf (int)
> location: class java.lang.Integer
> 	private static final List SCOPES = Arrays.asList(new Integer[] { Integer.valueOf(ENGINE_SCOPE), Integer.valueOf(GLOBAL_SCOPE) });
>                                                                                                                ^
> 2 errors
> ------------- cut here ----------
> Indeed, "Integer.valueOf(int)" got introduced with Java 1.5.
> As BSF3 should be deployable with Java 1.4, this would need to be fixed.
> Here is a unified diff which corrects the problem:
> ------------- cut here ----------
> --- bkp\SimpleScriptContext.java	2007-11-01 16:48:10.000000000 +0100
> +++ SimpleScriptContext.java	2007-11-01 20:35:07.906250000 +0100
> @@ -43,7 +43,7 @@
>  
>  	private Writer errorWriter;
>  
> -	private static final List SCOPES = Arrays.asList(new Integer[] { Integer.valueOf(ENGINE_SCOPE), Integer.valueOf(GLOBAL_SCOPE) });
> +	private static final List SCOPES = Arrays.asList(new Integer[] { Integer.valueOf(""+ENGINE_SCOPE), Integer.valueOf(""+GLOBAL_SCOPE) });
>  	
>  	public SimpleScriptContext() {
>          reader = new InputStreamReader(System.in);
> ------------- cut here ----------
> Regards,
> ---rony

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: bsf-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bsf-dev-help@jakarta.apache.org