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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to