changeset 22382:fb607f23d1eb

Apply formating rules
author Jaroslav Tulach <jaroslav.tulach@oracle.com>
date Wed, 18 Nov 2015 12:41:41 +0100
parents d3facd428d1d
children 37fabf84537a
files truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/TruffleLanguage.java truffle/com.oracle.truffle.sl.test/src/com/oracle/truffle/sl/test/SLTckTest.java truffle/com.oracle.truffle.tck/src/com/oracle/truffle/tck/TckLanguage.java truffle/com.oracle.truffle.tck/src/com/oracle/truffle/tck/TruffleTCK.java
diffstat 4 files changed, 19 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/TruffleLanguage.java	Wed Nov 18 12:37:32 2015 +0100
+++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/TruffleLanguage.java	Wed Nov 18 12:41:41 2015 +0100
@@ -387,14 +387,14 @@
         /**
          * Evaluates source of (potentially different) language. The {@link Source#getMimeType()
          * MIME type) is used to identify the {@link TruffleLanguage} to use to perform the
-         * {@link #parse(com.oracle.truffle.api.source.Source, com.oracle.truffle.api.nodes.Node, java.lang.String...)}.
-         * The names of arguments are parameters for the resulting
-         * {#link CallTarget} that allow the <code>source</code> to reference
-         * the actual parameters passed to {@link CallTarget#call(java.lang.Object...)}.
+         * {@link #parse(com.oracle.truffle.api.source.Source, com.oracle.truffle.api.nodes.Node, java.lang.String...)}
+         * . The names of arguments are parameters for the resulting {#link CallTarget} that allow
+         * the <code>source</code> to reference the actual parameters passed to
+         * {@link CallTarget#call(java.lang.Object...)}.
          * 
          * @param source the source to evaluate
-         * @param argumentNames the names of {@link CallTarget#call(java.lang.Object...)}
-         *   arguments that can be referenced from the source
+         * @param argumentNames the names of {@link CallTarget#call(java.lang.Object...)} arguments
+         *            that can be referenced from the source
          * @return the call target representing the parsed result
          * @throws IOException if the parsing or evaluation fails for some reason
          */
--- a/truffle/com.oracle.truffle.sl.test/src/com/oracle/truffle/sl/test/SLTckTest.java	Wed Nov 18 12:37:32 2015 +0100
+++ b/truffle/com.oracle.truffle.sl.test/src/com/oracle/truffle/sl/test/SLTckTest.java	Wed Nov 18 12:41:41 2015 +0100
@@ -160,9 +160,12 @@
 
     @Override
     protected String multiplyCode(String firstName, String secondName) {
-        return "function multiply(" + firstName + ", " + secondName + ") {\n" +
+        // @formatter:off
+        return
+            "function multiply(" + firstName + ", " + secondName + ") {\n" +
             "  return " + firstName + " * " + secondName + ";\n" +
             "}\n";
+        // @formatter:on
     }
 
     @Override
--- a/truffle/com.oracle.truffle.tck/src/com/oracle/truffle/tck/TckLanguage.java	Wed Nov 18 12:37:32 2015 +0100
+++ b/truffle/com.oracle.truffle.tck/src/com/oracle/truffle/tck/TckLanguage.java	Wed Nov 18 12:41:41 2015 +0100
@@ -115,7 +115,7 @@
                 return this;
             }
             try {
-                CallTarget call = env.parse(code, (String)frame.getArguments()[1], (String)frame.getArguments()[2]);
+                CallTarget call = env.parse(code, (String) frame.getArguments()[1], (String) frame.getArguments()[2]);
                 return call.call(6, 7);
             } catch (IOException ex) {
                 throw new AssertionError("Cannot parse " + code, ex);
--- a/truffle/com.oracle.truffle.tck/src/com/oracle/truffle/tck/TruffleTCK.java	Wed Nov 18 12:37:32 2015 +0100
+++ b/truffle/com.oracle.truffle.tck/src/com/oracle/truffle/tck/TruffleTCK.java	Wed Nov 18 12:41:41 2015 +0100
@@ -170,8 +170,9 @@
     }
 
     /**
-     * Code snippet to multiplyCode two two variables. The test uses the snippet
-     * as a parameter to your language's {@link TruffleLanguage#parse(com.oracle.truffle.api.source.Source, com.oracle.truffle.api.nodes.Node, java.lang.String...)}
+     * Code snippet to multiplyCode two two variables. The test uses the snippet as a parameter to
+     * your language's
+     * {@link TruffleLanguage#parse(com.oracle.truffle.api.source.Source, com.oracle.truffle.api.nodes.Node, java.lang.String...)}
      * method.
      *
      * @param firstName name of the first variable to multiplyCode
@@ -631,22 +632,21 @@
         double expect = Math.floor(RANDOM.nextDouble() * 100000.0) / 10.0;
         Object parsed = function.invoke(null, "application/x-tck", "" + expect).get();
         assertTrue("Expecting numeric result, was:" + expect, parsed instanceof Number);
-        double value = ((Number)parsed).doubleValue();
+        double value = ((Number) parsed).doubleValue();
         assertEquals("Gets the double", expect, value, 0.01);
     }
 
     @Test
     public void multiplyTwoVariables() throws Exception {
-        final String firstVar = "var" + (char)('A' + RANDOM.nextInt(24));
-        final String secondVar = "var" + (char)('0' + RANDOM.nextInt(10));
+        final String firstVar = "var" + (char) ('A' + RANDOM.nextInt(24));
+        final String secondVar = "var" + (char) ('0' + RANDOM.nextInt(10));
         String mulCode = multiplyCode(firstVar, secondVar);
-        Source source = Source.fromText("TCK42:" + mimeType() + ":" + mulCode, "evaluate " + firstVar + " * " + secondVar)
-            .withMimeType("application/x-tck");
+        Source source = Source.fromText("TCK42:" + mimeType() + ":" + mulCode, "evaluate " + firstVar + " * " + secondVar).withMimeType("application/x-tck");
         final PolyglotEngine.Value evalSource = vm().eval(source);
         final PolyglotEngine.Value invokeMul = evalSource.invoke(null, firstVar, secondVar);
         Object result = invokeMul.get();
         assertTrue("Expecting numeric result, was:" + result, result instanceof Number);
-        assertEquals("Right value", 42, ((Number)result).intValue());
+        assertEquals("Right value", 42, ((Number) result).intValue());
     }
 
     private PolyglotEngine.Value findGlobalSymbol(String name) throws Exception {