Sophie

Sophie

distrib > Mageia > 3 > i586 > media > core-release-src > by-pkgid > 464b5842194bfb459a2561ea48d73774 > files > 5

gshell-2.6.5-4.mga3.src.rpm

diff -Nru gshell-2.6.5/gshell-core/pom.xml gshell-2.6.5-gil/gshell-core/pom.xml
--- gshell-2.6.5/gshell-core/pom.xml	2012-06-19 13:21:39.778988659 +0200
+++ gshell-2.6.5-gil/gshell-core/pom.xml	2012-06-19 13:16:22.927978964 +0200
@@ -56,11 +56,11 @@
             <artifactId>sisu-inject-bean</artifactId>
         </dependency>
         
-        <dependency>
+        <!--dependency>
             <groupId>commons-jexl</groupId>
             <artifactId>commons-jexl</artifactId>
             <optional>true</optional>
-        </dependency>
+        </dependency-->
 
         <dependency>
             <groupId>junit</groupId>
diff -Nru gshell-2.6.5/gshell-core/src/main/java/org/sonatype/gshell/parser/impl/eval/EvaluatorFactory.java gshell-2.6.5-gil/gshell-core/src/main/java/org/sonatype/gshell/parser/impl/eval/EvaluatorFactory.java
--- gshell-2.6.5/gshell-core/src/main/java/org/sonatype/gshell/parser/impl/eval/EvaluatorFactory.java	2011-12-28 20:41:12.000000000 +0100
+++ gshell-2.6.5-gil/gshell-core/src/main/java/org/sonatype/gshell/parser/impl/eval/EvaluatorFactory.java	2012-06-19 13:21:23.653988166 +0200
@@ -48,14 +48,14 @@
             }
         }
 
-        try {
+        /*try {
             cl.loadClass("org.apache.commons.jexl.Expression");
 
             return new JexlEvaluator();
         }
         catch (Exception e) {
             // ignore
-        }
+        }*/
 
         return new DefaultEvaluator();
     }
diff -Nru gshell-2.6.5/gshell-core/src/main/java/org/sonatype/gshell/parser/impl/eval/JexlEvaluator.java gshell-2.6.5-gil/gshell-core/src/main/java/org/sonatype/gshell/parser/impl/eval/JexlEvaluator.java
--- gshell-2.6.5/gshell-core/src/main/java/org/sonatype/gshell/parser/impl/eval/JexlEvaluator.java	2011-12-28 20:41:12.000000000 +0100
+++ gshell-2.6.5-gil/gshell-core/src/main/java/org/sonatype/gshell/parser/impl/eval/JexlEvaluator.java	1970-01-01 01:00:00.000000000 +0100
@@ -1,161 +0,0 @@
-/**
- * Copyright (c) 2009-2011 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.sonatype.gshell.parser.impl.eval;
-
-import org.apache.commons.jexl.Expression;
-import org.apache.commons.jexl.ExpressionFactory;
-import org.apache.commons.jexl.JexlContext;
-import org.apache.commons.jexl.resolver.FlatResolver;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.sonatype.gshell.shell.ShellHolder;
-import org.sonatype.gshell.util.ReplacementParser;
-import org.sonatype.gshell.variables.Variables;
-
-import java.util.Collection;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Uses Commons Jexl to evaluate expressions.
- *
- * @author <a href="mailto:jason@planet57.com">Jason Dillon</a>
- * @since 2.0
- */
-public class JexlEvaluator
-    implements Evaluator
-{
-    private final Logger log = LoggerFactory.getLogger(getClass());
-
-    private final ReplacementParser parser = new ReplacementParser()
-    {
-        @Override
-        protected Object replace(final String key) throws Exception {
-            assert key != null;
-
-            log.debug("Evaluating: {}", key);
-
-            JexlContext ctx = new Context();
-            Expression expr = ExpressionFactory.createExpression(key);
-            expr.addPostResolver(resolver);
-
-            Object result = expr.evaluate(ctx);
-
-            log.debug("Result: {}", result);
-
-            return result;
-        }
-    };
-
-    private final FlatResolver resolver = new FlatResolver(true);
-
-    public Object eval(String expression) throws Exception {
-        // expression could be null
-
-        // Skip evaluation if null or there is no start token
-        if (expression == null || !expression.contains("${")) {
-            return expression;
-        }
-
-        return parser.parse(expression);
-    }
-
-    private static class Context
-        implements JexlContext
-    {
-        private final ContextVariables vars = new ContextVariables();
-
-        public void setVars(final Map map) {
-            throw new UnsupportedOperationException();
-        }
-
-        public Map getVars() {
-            return vars;
-        }
-    }
-
-    private static class ContextVariables
-        implements Map<String, Object>
-    {
-        private final Variables vars = ShellHolder.get().getVariables();
-
-        public Object get(final Object key) {
-            assert key != null;
-
-            String name = String.valueOf(key);
-            Object value;
-
-            value = vars.get(name);
-            if (value == null) {
-                value = System.getProperty(name);
-            }
-
-            return value;
-        }
-
-        public Object put(final String key, final Object value) {
-            assert key != null;
-
-            Object prev = get(key);
-
-            vars.set(key, value);
-
-            return prev;
-        }
-
-        // Jexl only uses Map.put() and Map.get() stub everything else
-
-        public int size() {
-            return 0;
-        }
-
-        public boolean isEmpty() {
-            return false;
-        }
-
-        public boolean containsKey(Object key) {
-            return false;
-        }
-
-        public boolean containsValue(Object value) {
-            return false;
-        }
-
-        public Object remove(Object key) {
-            return null;
-        }
-
-        public void putAll(Map<? extends String, ? extends Object> m) {
-            // empty
-        }
-
-        public void clear() {
-            // empty
-        }
-
-        public Set<String> keySet() {
-            return null;
-        }
-
-        public Collection<Object> values() {
-            return null;
-        }
-
-        public Set<Entry<String, Object>> entrySet() {
-            return null;
-        }
-    }
-}
\ Manca newline alla fine del file
diff -Nru gshell-2.6.5/pom.xml gshell-2.6.5-gil/pom.xml
--- gshell-2.6.5/pom.xml	2012-06-19 13:21:39.780988659 +0200
+++ gshell-2.6.5-gil/pom.xml	2012-06-19 13:15:51.034977988 +0200
@@ -166,7 +166,7 @@
                 <classifier>tests</classifier>
             </dependency>
 
-            <dependency>
+            <!--dependency>
                 <groupId>commons-jexl</groupId>
                 <artifactId>commons-jexl</artifactId>
                 <version>1.1</version>
@@ -180,7 +180,7 @@
                         <artifactId>junit</artifactId>
                     </exclusion>
                 </exclusions>
-            </dependency>
+            </dependency-->
 
             <dependency>
                 <groupId>commons-cli</groupId>