Skip to content

Commit a581a71

Browse files
committed
Merge pull request #191 in G/truffle from ~ANDREAS.WOESS_ORACLE.COM/truffle:fix_warnings to master
* commit '514d19bc55be3b82f76b7b3cddfe27b34d245348': Fix warning: declared exception IOException is not actually thrown
2 parents 255d3fe + 514d19b commit a581a71

File tree

3 files changed

+14
-16
lines changed

3 files changed

+14
-16
lines changed

truffle/com.oracle.truffle.sl.test/src/com/oracle/truffle/sl/test/SLPolyglotEngineValueExecuteBenchmark.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@
4040
*/
4141
package com.oracle.truffle.sl.test;
4242

43-
import java.io.IOException;
4443
import java.util.concurrent.TimeUnit;
4544

4645
import org.openjdk.jmh.annotations.Benchmark;
46+
import org.openjdk.jmh.annotations.Fork;
4747
import org.openjdk.jmh.annotations.Measurement;
4848
import org.openjdk.jmh.annotations.OutputTimeUnit;
4949
import org.openjdk.jmh.annotations.Scope;
@@ -55,7 +55,6 @@
5555
import com.oracle.truffle.api.vm.PolyglotEngine;
5656
import com.oracle.truffle.sl.SLLanguage;
5757
import com.oracle.truffle.sl.runtime.SLFunction;
58-
import org.openjdk.jmh.annotations.Fork;
5958

6059
@State(value = Scope.Benchmark)
6160
@Warmup(iterations = 15)
@@ -68,7 +67,7 @@ public class SLPolyglotEngineValueExecuteBenchmark {
6867
private SLFunction slFunction;
6968

7069
@Setup
71-
public void prepare() throws IOException {
70+
public void prepare() {
7271
vm = PolyglotEngine.newBuilder().build();
7372
vm.eval(Source.newBuilder("function plus(x, y) { return x + y; }").name("plus.sl").mimeType(SLLanguage.MIME_TYPE).build());
7473
plus = vm.findGlobalSymbol("plus");
@@ -77,7 +76,7 @@ public void prepare() throws IOException {
7776

7877
@Benchmark
7978
@OutputTimeUnit(TimeUnit.SECONDS)
80-
public long executePlus() throws IOException {
79+
public long executePlus() {
8180
long res = plus.execute(1L, 2L).as(Number.class).longValue();
8281
if (res != 3) {
8382
throw new AssertionError();

truffle/com.oracle.truffle.sl.test/src/com/oracle/truffle/sl/test/SLPolyglotTest.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,15 @@
4040
*/
4141
package com.oracle.truffle.sl.test;
4242

43+
import static org.junit.Assert.assertNotNull;
44+
45+
import org.junit.After;
4346
import org.junit.Test;
4447

4548
import com.oracle.truffle.api.vm.PolyglotEngine;
4649
import com.oracle.truffle.api.vm.PolyglotEngine.Language;
4750
import com.oracle.truffle.sl.SLLanguage;
4851

49-
import java.io.IOException;
50-
import org.junit.After;
51-
import static org.junit.Assert.assertNotNull;
52-
5352
public class SLPolyglotTest {
5453
private PolyglotEngine vm;
5554

@@ -61,7 +60,7 @@ public void dispose() {
6160
}
6261

6362
@Test
64-
public void accessGlobalObject() throws IOException {
63+
public void accessGlobalObject() {
6564
vm = PolyglotEngine.newBuilder().build();
6665
Language lang = vm.getLanguages().get(SLLanguage.MIME_TYPE);
6766
PolyglotEngine.Value global = lang.getGlobalObject();

truffle/com.oracle.truffle.sl.test/src/com/oracle/truffle/sl/test/ToStringOfEvalTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,18 @@
4040
*/
4141
package com.oracle.truffle.sl.test;
4242

43-
import com.oracle.truffle.api.source.Source;
44-
import com.oracle.truffle.api.vm.PolyglotEngine;
45-
import com.oracle.truffle.sl.SLLanguage;
46-
47-
import java.io.IOException;
48-
import org.junit.After;
4943
import static org.junit.Assert.assertEquals;
5044
import static org.junit.Assert.assertNotNull;
5145
import static org.junit.Assert.assertTrue;
46+
47+
import org.junit.After;
5248
import org.junit.Before;
5349
import org.junit.Test;
5450

51+
import com.oracle.truffle.api.source.Source;
52+
import com.oracle.truffle.api.vm.PolyglotEngine;
53+
import com.oracle.truffle.sl.SLLanguage;
54+
5555
public class ToStringOfEvalTest {
5656
PolyglotEngine engine;
5757

@@ -66,7 +66,7 @@ public void dispose() {
6666
}
6767

6868
@Test
69-
public void checkToStringOnAFunction() throws IOException {
69+
public void checkToStringOnAFunction() {
7070
PolyglotEngine.Language sl = engine.getLanguages().get(SLLanguage.MIME_TYPE);
7171
sl.eval(Source.newBuilder("function checkName() {}").name("defineFn").mimeType("content/unknown").build());
7272
PolyglotEngine.Value value1 = engine.findGlobalSymbol("checkName");

0 commit comments

Comments
 (0)