diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/RandFunctionsNodes.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/RandFunctionsNodes.java
index 1a554b01cf9a7ced2787277621b026e20253f4ee..07da33f6dc710f901e0d53cc5d5b836ebbd50f01 100644
--- a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/RandFunctionsNodes.java
+++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/RandFunctionsNodes.java
@@ -47,7 +47,7 @@ import com.oracle.truffle.r.runtime.nmath.RandomFunctions.RandFunction1_Double;
 import com.oracle.truffle.r.runtime.nmath.RandomFunctions.RandFunction2_Double;
 import com.oracle.truffle.r.runtime.nmath.RandomFunctions.RandFunction3_Double;
 import com.oracle.truffle.r.runtime.nmath.RandomFunctions.RandomNumberProvider;
-import com.oracle.truffle.r.runtime.nodes.RNode;
+import com.oracle.truffle.r.runtime.nodes.RBaseNode;
 import com.oracle.truffle.r.runtime.rng.RRNG;
 
 /**
@@ -133,7 +133,7 @@ public final class RandFunctionsNodes {
         private Object evaluateWrapper(RAbstractVector lengthVec, RAbstractDoubleVector a, RAbstractDoubleVector b, RAbstractDoubleVector c, RandomNumberProvider rand,
                         RandGenerationNodeData nodeData) {
             int length = nodeData.resultVectorLengthProfile.profile(convertToLength.execute(lengthVec));
-            RNode.reportWork(this, length);
+            RBaseNode.reportWork(this, length);
             return evaluate(length, a, b, c, nodeData, rand);
         }
 
diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/StatsFunctionsNodes.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/StatsFunctionsNodes.java
index 73325ec93fbbffdf268f68c05cb3f07b46757a68..5ea680278a4d36207f0c5ecc3febd9e228d1da61 100644
--- a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/StatsFunctionsNodes.java
+++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/stats/StatsFunctionsNodes.java
@@ -46,7 +46,7 @@ import com.oracle.truffle.r.runtime.nmath.MathFunctions.Function3_1;
 import com.oracle.truffle.r.runtime.nmath.MathFunctions.Function3_2;
 import com.oracle.truffle.r.runtime.nmath.MathFunctions.Function4_1;
 import com.oracle.truffle.r.runtime.nmath.MathFunctions.Function4_2;
-import com.oracle.truffle.r.runtime.nodes.RNode;
+import com.oracle.truffle.r.runtime.nodes.RBaseNode;
 import com.oracle.truffle.r.runtime.ops.na.NACheck;
 
 // inspired by arithmetic.c
@@ -86,7 +86,7 @@ public final class StatsFunctionsNodes {
             return RDataFactory.createEmptyDoubleVector();
         }
         int length = profiles.resultVectorLengthProfile.profile(Math.max(aLength, Math.max(bLength, Math.max(cLength, dLength))));
-        RNode.reportWork(node, length);
+        RBaseNode.reportWork(node, length);
         double[] result = new double[length];
 
         boolean complete = true;
diff --git a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/utils/Rprof.java b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/utils/Rprof.java
index 626125e07e2a0367573de73da88e6bc20c7df4c1..c33cfab250c8d98a67b346e54b0f9fd39618e499 100644
--- a/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/utils/Rprof.java
+++ b/com.oracle.truffle.r.library/src/com/oracle/truffle/r/library/utils/Rprof.java
@@ -188,8 +188,8 @@ public abstract class Rprof extends RExternalBuiltinNode.Arg8 implements RDataFa
      * collects the stack of functions.
      */
     private final class StatementListener implements ExecutionEventListener {
-        private ArrayList<ArrayList<RSyntaxElement>> intervalStacks = new ArrayList<>();
-        private ArrayList<RprofState.MemoryQuad> intervalMemory = new ArrayList<>();
+        private final ArrayList<ArrayList<RSyntaxElement>> intervalStacks = new ArrayList<>();
+        private final ArrayList<RprofState.MemoryQuad> intervalMemory = new ArrayList<>();
         private volatile boolean newInterval;
 
         private StatementListener() {
diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Combine.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Combine.java
index 1c53a2a22f3c49d902566448a343248d18502451..021f7bd900f511ce9c80f6325cd099d980eaa572 100644
--- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Combine.java
+++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Combine.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -76,6 +76,7 @@ import com.oracle.truffle.r.runtime.data.RNull;
 import com.oracle.truffle.r.runtime.data.RStringVector;
 import com.oracle.truffle.r.runtime.data.RVector;
 import com.oracle.truffle.r.runtime.data.model.RAbstractVector;
+import com.oracle.truffle.r.runtime.nodes.RBaseNode;
 import com.oracle.truffle.r.runtime.nodes.RNode;
 import com.oracle.truffle.r.runtime.ops.na.NACheck;
 
@@ -148,7 +149,7 @@ public abstract class Combine extends RBuiltinNode {
         // get the actual contents of the result
         RVector<?> result = foldContents(cachedPrecedence, elements, size, namesVector);
 
-        RNode.reportWork(this, size);
+        RBaseNode.reportWork(this, size);
 
         return result;
     }
diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Drop.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Drop.java
index bb060fb21b0ac5b918907432c43338dc83c381b9..5edaedbcbe3deb34d6e44342fde765197ca61fee 100644
--- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Drop.java
+++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Drop.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -74,12 +74,11 @@ public abstract class Drop extends RBuiltinNode {
 
         // the result is single value, all dims == 1
         if (resultIsScalarProfile.profile(lastNonOneIndex == -1)) {
-            @SuppressWarnings("unused")
             RAbstractVector r = x.copy();
-            setDimsNode.setDimensions(x, null);
-            setDimsNamesNode.setDimNames(x, null);
-            setNamesNode.setNames(x, null);
-            return x;
+            setDimsNode.setDimensions(r, null);
+            setDimsNamesNode.setDimNames(r, null);
+            setNamesNode.setNames(r, null);
+            return r;
         }
 
         // the result is vector
diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Match.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Match.java
index e53aed54ee26ee160ff5fd2996c3a962ccd318f3..56288f90caae83a7a6386f6229ff967146890fef 100644
--- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Match.java
+++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Match.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -800,7 +800,7 @@ public abstract class Match extends RBuiltinNode {
     }
 
     private static class NonRecursiveHashSetInt {
-        private NonRecursiveHashMapInt map;
+        private final NonRecursiveHashMapInt map;
 
         NonRecursiveHashSetInt(int approxCapacity) {
             map = new NonRecursiveHashMapInt(approxCapacity);
@@ -816,7 +816,7 @@ public abstract class Match extends RBuiltinNode {
     }
 
     private static class NonRecursiveHashSetDouble {
-        private NonRecursiveHashMapDouble map;
+        private final NonRecursiveHashMapDouble map;
 
         NonRecursiveHashSetDouble(int approxCapacity) {
             map = new NonRecursiveHashMapDouble(approxCapacity);
@@ -832,7 +832,7 @@ public abstract class Match extends RBuiltinNode {
     }
 
     private static class NonRecursiveHashSetCharacter {
-        private NonRecursiveHashMapCharacter map;
+        private final NonRecursiveHashMapCharacter map;
 
         NonRecursiveHashSetCharacter(int approxCapacity) {
             map = new NonRecursiveHashMapCharacter(approxCapacity);
@@ -848,7 +848,7 @@ public abstract class Match extends RBuiltinNode {
     }
 
     private static class NonRecursiveHashSetComplex {
-        private NonRecursiveHashMapComplex map;
+        private final NonRecursiveHashMapComplex map;
 
         NonRecursiveHashSetComplex(int approxCapacity) {
             map = new NonRecursiveHashMapComplex(approxCapacity);
diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Transpose.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Transpose.java
index db8fcf308280a90a6933d6a4afd755b6a69584b6..5daa1ab7ddd5e6022c21a24a673e20d6012270bf 100644
--- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Transpose.java
+++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Transpose.java
@@ -6,7 +6,7 @@
  * Copyright (c) 1995, 1996, 1997  Robert Gentleman and Ross Ihaka
  * Copyright (c) 1995-2014, The R Core Team
  * Copyright (c) 2002-2008, The R Foundation
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates
  *
  * All rights reserved.
  */
@@ -45,7 +45,7 @@ import com.oracle.truffle.r.runtime.data.model.RAbstractLogicalVector;
 import com.oracle.truffle.r.runtime.data.model.RAbstractRawVector;
 import com.oracle.truffle.r.runtime.data.model.RAbstractStringVector;
 import com.oracle.truffle.r.runtime.data.model.RAbstractVector;
-import com.oracle.truffle.r.runtime.nodes.RNode;
+import com.oracle.truffle.r.runtime.nodes.RBaseNode;
 
 @RBuiltin(name = "t.default", kind = INTERNAL, parameterNames = {"x"}, behavior = PURE)
 public abstract class Transpose extends RBuiltinNode {
@@ -80,7 +80,7 @@ public abstract class Transpose extends RBuiltinNode {
             firstDim = length;
             secondDim = 1;
         }
-        RNode.reportWork(this, length);
+        RBaseNode.reportWork(this, length);
 
         A array = createArray.apply(length);
         int j = 0;
diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/fastpaths/IntersectFastPath.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/fastpaths/IntersectFastPath.java
index 611cf68d898d0ed50f0630d15a1059eee1cf0174..0089dad0f3bf6b5dc35c88ee84c4cc4b129677b9 100644
--- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/fastpaths/IntersectFastPath.java
+++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/fastpaths/IntersectFastPath.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,8 +31,8 @@ import com.oracle.truffle.api.dsl.Specialization;
 import com.oracle.truffle.api.profiles.ConditionProfile;
 import com.oracle.truffle.r.runtime.data.RDataFactory;
 import com.oracle.truffle.r.runtime.data.model.RAbstractIntVector;
+import com.oracle.truffle.r.runtime.nodes.RBaseNode;
 import com.oracle.truffle.r.runtime.nodes.RFastPathNode;
-import com.oracle.truffle.r.runtime.nodes.RNode;
 
 public abstract class IntersectFastPath extends RFastPathNode {
 
@@ -53,7 +53,7 @@ public abstract class IntersectFastPath extends RFastPathNode {
 
         int xLength = profiledX.getLength();
         int yLength = profiledY.getLength();
-        RNode.reportWork(this, xLength + yLength);
+        RBaseNode.reportWork(this, xLength + yLength);
 
         int count = 0;
         int[] result = EMPTY_INT_ARRAY;
diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRStats.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRStats.java
index 2cc1e37a4cd7c0f7c75f50ddc446cd6be0999a07..d0886976b712755dfebd50126d4ee3e1c5fe8362 100644
--- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRStats.java
+++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/fastr/FastRStats.java
@@ -420,8 +420,8 @@ public class FastRStats {
         }
 
         private static final class SortableCounter implements Comparable<SortableCounter> {
-            private boolean timing;
-            private Profiler.Counter counter;
+            private final boolean timing;
+            private final Profiler.Counter counter;
 
             private SortableCounter(Profiler.Counter counter, boolean timing) {
                 this.counter = counter;
diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/helpers/DebugHandling.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/helpers/DebugHandling.java
index 801a83f816c25b5822288e925ed6b6a4f5384bf6..80f96d66aa3d6895cfc9aee862ccb5d78126473b 100644
--- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/helpers/DebugHandling.java
+++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/helpers/DebugHandling.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -581,7 +581,7 @@ public class DebugHandling {
      * Listener for (transient) step into.
      */
     private static class StepIntoInstrumentListener implements ExecutionEventListener {
-        private FunctionStatementsEventListener functionStatementsEventListener;
+        private final FunctionStatementsEventListener functionStatementsEventListener;
 
         StepIntoInstrumentListener(FunctionStatementsEventListener debugEventReceiver) {
             this.functionStatementsEventListener = debugEventReceiver;
diff --git a/com.oracle.truffle.r.nodes.test/src/com/oracle/truffle/r/nodes/casts/FilterSamplerFactory.java b/com.oracle.truffle.r.nodes.test/src/com/oracle/truffle/r/nodes/casts/FilterSamplerFactory.java
index bc27e20cff7fa53c0d6879e514addaf5f39b55bd..e1c486f861275ad6a8832032af14246269736f1e 100644
--- a/com.oracle.truffle.r.nodes.test/src/com/oracle/truffle/r/nodes/casts/FilterSamplerFactory.java
+++ b/com.oracle.truffle.r.nodes.test/src/com/oracle/truffle/r/nodes/casts/FilterSamplerFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -207,11 +207,11 @@ public final class FilterSamplerFactory
                 return filter.getFilter().isNarrowing() ? toNegate.trueBranchType().not() : toNegate.trueBranchType();
             }
 
-            @SuppressWarnings({"unchecked", "cast"})
+            @SuppressWarnings({"unchecked"})
             @Override
             public Samples<Object> collectSamples(TypeExpr inputType) {
                 Samples thisSamples = toNegate.collectSamples(inputType);
-                return (Samples<Object>) thisSamples.swap();
+                return thisSamples.swap();
             }
 
         };
diff --git a/com.oracle.truffle.r.nodes.test/src/com/oracle/truffle/r/nodes/test/ChimneySweeping.java b/com.oracle.truffle.r.nodes.test/src/com/oracle/truffle/r/nodes/test/ChimneySweeping.java
index 0caff997158ece3fa6b2eca40a8e449d5047de54..eccc3ed746eba4396b7d76046a17ccfa3401f2ca 100644
--- a/com.oracle.truffle.r.nodes.test/src/com/oracle/truffle/r/nodes/test/ChimneySweeping.java
+++ b/com.oracle.truffle.r.nodes.test/src/com/oracle/truffle/r/nodes/test/ChimneySweeping.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -76,7 +76,7 @@ import com.oracle.truffle.r.test.generate.TestOutputManager.TestInfo;
  */
 class ChimneySweeping extends SingleBuiltinDiagnostics {
 
-    private Set<String> blacklistedBuiltins = new HashSet<>();
+    private final Set<String> blacklistedBuiltins = new HashSet<>();
     {
         blacklistedBuiltins.add(".dfltWarn");
         blacklistedBuiltins.add("browser");
diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/vector/CachedExtractVectorNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/vector/CachedExtractVectorNode.java
index 600fa6067e875a27512ba5b531495e98066abbea..85dcea77b1c86b3275668ad63b373fa3f24ac1fa 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/vector/CachedExtractVectorNode.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/vector/CachedExtractVectorNode.java
@@ -58,7 +58,7 @@ import com.oracle.truffle.r.runtime.data.model.RAbstractContainer;
 import com.oracle.truffle.r.runtime.data.model.RAbstractStringVector;
 import com.oracle.truffle.r.runtime.data.model.RAbstractVector;
 import com.oracle.truffle.r.runtime.env.REnvironment;
-import com.oracle.truffle.r.runtime.nodes.RNode;
+import com.oracle.truffle.r.runtime.nodes.RBaseNode;
 
 final class CachedExtractVectorNode extends CachedVectorNode {
 
@@ -188,7 +188,7 @@ final class CachedExtractVectorNode extends CachedVectorNode {
                 writeVectorNode.enableValueNACheck(vector);
                 writeVectorNode.apply(extractedVector, extractedVectorLength, positions, vector, vectorLength, dimensions);
                 extractedVector.setComplete(writeVectorNode.neverSeenNAInValue());
-                RNode.reportWork(this, extractedVectorLength);
+                RBaseNode.reportWork(this, extractedVectorLength);
             }
             if (oneDimensionProfile.profile(numberOfDimensions == 1)) {
                 // names only need to be considered for single dimensional accesses
@@ -217,7 +217,7 @@ final class CachedExtractVectorNode extends CachedVectorNode {
 
         } else {
             writeVectorNode.apply(extractedVector, extractedVectorLength, positions, vector, vectorLength, dimensions);
-            RNode.reportWork(this, 1);
+            RBaseNode.reportWork(this, 1);
             assert extractedVectorLength == 1;
             return extractedVector.getDataAtAsObject(0);
         }
diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/vector/CachedReplaceVectorNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/vector/CachedReplaceVectorNode.java
index 2113155262a366925b79e1963772fda9a23f2806..a7c9dee70e9e192371a8479730adbc0d96baa1a0 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/vector/CachedReplaceVectorNode.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/vector/CachedReplaceVectorNode.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -68,7 +68,7 @@ import com.oracle.truffle.r.runtime.data.model.RAbstractStringVector;
 import com.oracle.truffle.r.runtime.data.model.RAbstractVector;
 import com.oracle.truffle.r.runtime.env.REnvironment;
 import com.oracle.truffle.r.runtime.env.REnvironment.PutException;
-import com.oracle.truffle.r.runtime.nodes.RNode;
+import com.oracle.truffle.r.runtime.nodes.RBaseNode;
 
 final class CachedReplaceVectorNode extends CachedVectorNode {
 
@@ -298,7 +298,7 @@ final class CachedReplaceVectorNode extends CachedVectorNode {
             }
         }
 
-        RNode.reportWork(this, replacementLength);
+        RBaseNode.reportWork(this, replacementLength);
 
         if (isDeleteElements()) {
             assert deleteElementsNode != null;
diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/builtin/ArgumentFilter.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/builtin/ArgumentFilter.java
index a6357445beccdf46f742fd368b10352c8fb66e5c..005315e5ec1539329e94abff71f65b8aaa39a0e0 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/builtin/ArgumentFilter.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/builtin/ArgumentFilter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -187,13 +187,12 @@ public interface ArgumentFilter<T, R> {
 
                 private final ConditionProfile profile = ConditionProfile.createBinaryProfile();
 
-                @SuppressWarnings({"cast", "unchecked"})
                 @Override
                 public boolean test(T arg) {
                     if (profile.profile(!InverseArgumentFilter.this.test(arg))) {
                         return false;
                     } else {
-                        return other.test((R) arg);
+                        return other.test(arg);
                     }
                 }
 
diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/builtin/CastBuilder.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/builtin/CastBuilder.java
index c7f6bc6ef0902217fbd27c9c934c964dba756359..4b215d7d58229e919462b1d477fa4d5499a109df 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/builtin/CastBuilder.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/builtin/CastBuilder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -665,20 +665,20 @@ public final class CastBuilder {
             return new TypeFilter<>(x -> true, Object.class);
         }
 
-        @SuppressWarnings({"rawtypes", "unchecked", "cast"})
+        @SuppressWarnings({"rawtypes", "unchecked"})
         public static Filter<Object, RAbstractVector> numericValue() {
             Filter f = integerValue().or(doubleValue()).or(logicalValue());
-            return (Filter<Object, RAbstractVector>) f;
+            return f;
         }
 
         /**
          * Checks that the argument is a list or vector/scalar of type numeric, string, complex or
          * raw.
          */
-        @SuppressWarnings({"rawtypes", "unchecked", "cast"})
+        @SuppressWarnings({"rawtypes", "unchecked"})
         public static Filter<Object, RAbstractVector> abstractVectorValue() {
             Filter f = numericValue().or(stringValue()).or(complexValue()).or(rawValue()).or(instanceOf(RAbstractListVector.class));
-            return (Filter<Object, RAbstractVector>) f;
+            return f;
         }
 
         public static Filter<Object, Integer> atomicIntegerValue() {
diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/ArgumentStatePush.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/ArgumentStatePush.java
index 6100faa0f41002be34f10714130b93693fffade9..5439f6c486fd2d8c28031076fa1a8667a932aa64 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/ArgumentStatePush.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/ArgumentStatePush.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,6 @@
 package com.oracle.truffle.r.nodes.function;
 
 import com.oracle.truffle.api.CompilerDirectives;
-import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
 import com.oracle.truffle.api.dsl.Cached;
 import com.oracle.truffle.api.dsl.Specialization;
 import com.oracle.truffle.api.dsl.TypeSystemReference;
@@ -54,7 +53,7 @@ public abstract class ArgumentStatePush extends Node {
     private final ConditionProfile isRefCountUpdateable = ConditionProfile.createBinaryProfile();
 
     private final int index;
-    @CompilationFinal private int mask = 0;
+
     @Child private WriteLocalFrameVariableNode writeArgNode;
 
     public static final int MAX_COUNTED_ARGS = 8;
diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/FunctionDefinitionNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/FunctionDefinitionNode.java
index 85c1172c4eaf3b0f99c93907ff20423516864768..9e0477b8a488117f4f6559bda63218b693398cb2 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/FunctionDefinitionNode.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/FunctionDefinitionNode.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -95,7 +95,6 @@ public final class FunctionDefinitionNode extends RRootNode implements RSyntaxNo
      * loaded from packages, where at the point of definition any assignee variable is unknown.
      */
     private String name;
-    private boolean instrumented = false;
     private SourceSection sourceSectionR;
     private final SourceSection[] argSourceSections;
 
@@ -438,10 +437,6 @@ public final class FunctionDefinitionNode extends RRootNode implements RSyntaxNo
         this.name = name;
     }
 
-    public boolean getInstrumented() {
-        return instrumented;
-    }
-
     @Override
     public RBuiltinFactory getBuiltin() {
         return null;
diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/PromiseNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/PromiseNode.java
index e9a22756634aa1683cf6ee0403f0649c818f0869..f879c3710032fa981b747e2314fd5af14136977c 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/PromiseNode.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/PromiseNode.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -371,7 +371,7 @@ public abstract class PromiseNode extends RNode {
                 if (RASTUtils.isLookup(nodes[i], ArgumentsSignature.VARARG_NAME)) {
                     this.promised[i] = nodes[i];
                 } else {
-                    this.promised[i] = PromisedNode.create(RPromiseFactory.create(PromiseState.Supplied, closure), false, forcedEager);
+                    this.promised[i] = PromiseNode.create(RPromiseFactory.create(PromiseState.Supplied, closure), false, forcedEager);
                 }
             }
             this.signature = signature;
diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/primitive/BinaryMapNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/primitive/BinaryMapNode.java
index a720fcbc354a2185eb2dfda7551dedf61aa7cce1..029608fbef96911b8aab5dd0c7ff8fcf2d14b254 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/primitive/BinaryMapNode.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/primitive/BinaryMapNode.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -51,7 +51,6 @@ import com.oracle.truffle.r.runtime.data.model.RAbstractRawVector;
 import com.oracle.truffle.r.runtime.data.model.RAbstractStringVector;
 import com.oracle.truffle.r.runtime.data.model.RAbstractVector;
 import com.oracle.truffle.r.runtime.nodes.RBaseNode;
-import com.oracle.truffle.r.runtime.nodes.RNode;
 
 /**
  * Implements a binary map operation that maps two vectors into a single result vector of the
@@ -264,7 +263,7 @@ public final class BinaryMapNode extends RBaseNode {
             assert isStoreCompatible(store, resultType, leftLength, rightLength);
 
             vectorNode.execute(function, store, leftCast, leftLength, rightCast, rightLength);
-            RNode.reportWork(this, maxLength);
+            RBaseNode.reportWork(this, maxLength);
             target.setComplete(function.isComplete());
         }
         if (mayContainMetadata) {
diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/primitive/UnaryMapNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/primitive/UnaryMapNode.java
index e0b9d614cae4b1e9d6a0fff7d469b945ce70213c..ccbd6106a60c14c2ae5b3e0a26a72fde87dc22c4 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/primitive/UnaryMapNode.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/primitive/UnaryMapNode.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,6 @@ import com.oracle.truffle.r.runtime.data.model.RAbstractLogicalVector;
 import com.oracle.truffle.r.runtime.data.model.RAbstractStringVector;
 import com.oracle.truffle.r.runtime.data.model.RAbstractVector;
 import com.oracle.truffle.r.runtime.nodes.RBaseNode;
-import com.oracle.truffle.r.runtime.nodes.RNode;
 
 public final class UnaryMapNode extends RBaseNode {
 
@@ -157,7 +156,7 @@ public final class UnaryMapNode extends RBaseNode {
             target = createOrShareVector(operandLength, operand);
             Object store = target.getInternalStore();
             vectorNode.apply(scalarNode, store, operandCast, operandLength);
-            RNode.reportWork(this, operandLength);
+            RBaseNode.reportWork(this, operandLength);
             target.setComplete(scalarNode.isComplete());
         }
         if (mayContainMetadata) {
diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/PrecedenceNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/PrecedenceNode.java
index c00a280c66c3b737a851b7b3a8a707889317b708..6a1843768d9cb6892e3dbe6838bc24cecde75d5a 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/PrecedenceNode.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/PrecedenceNode.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -156,8 +156,7 @@ public abstract class PrecedenceNode extends RBaseNode {
                     @Cached("createRecursive()") PrecedenceNode precedenceNode) {
         int precedence = -1;
         for (int i = 0; i < val.getLength(); i++) {
-            Object data = val.getDataAt(i);
-            precedence = Math.max(precedence, precedenceNode.executeInteger(val.getDataAtAsObject(i), recursive));
+            precedence = Math.max(precedence, precedenceNode.executeInteger(val.getDataAt(i), recursive));
         }
         return precedence;
     }
diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/UnaryArithmeticReduceNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/UnaryArithmeticReduceNode.java
index fe33372879cc5b419655302cd7523b48d75bc042..7c28bb9a4bdd4f78aa7e7567d96be7ed483fd703 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/UnaryArithmeticReduceNode.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/unary/UnaryArithmeticReduceNode.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,7 +42,6 @@ import com.oracle.truffle.r.runtime.data.RRawVector;
 import com.oracle.truffle.r.runtime.data.RStringVector;
 import com.oracle.truffle.r.runtime.data.RTypes;
 import com.oracle.truffle.r.runtime.nodes.RBaseNode;
-import com.oracle.truffle.r.runtime.nodes.RNode;
 import com.oracle.truffle.r.runtime.ops.BinaryArithmetic;
 import com.oracle.truffle.r.runtime.ops.BinaryArithmeticFactory;
 import com.oracle.truffle.r.runtime.ops.na.NACheck;
@@ -199,7 +198,7 @@ public abstract class UnaryArithmeticReduceNode extends RBaseNode {
 
     @Specialization
     protected int doIntVector(RIntVector operand, boolean naRm, @SuppressWarnings("unused") boolean finite) {
-        RNode.reportWork(this, operand.getLength());
+        RBaseNode.reportWork(this, operand.getLength());
         boolean profiledNaRm = naRmProfile.profile(naRm);
         int result = semantics.getIntStart();
         na.enable(operand);
@@ -226,7 +225,7 @@ public abstract class UnaryArithmeticReduceNode extends RBaseNode {
 
     @Specialization
     protected double doDoubleVector(RDoubleVector operand, boolean naRm, @SuppressWarnings("unused") boolean finite) {
-        RNode.reportWork(this, operand.getLength());
+        RBaseNode.reportWork(this, operand.getLength());
         boolean profiledNaRm = naRmProfile.profile(naRm);
         double result = semantics.getDoubleStart();
         na.enable(operand);
@@ -253,7 +252,7 @@ public abstract class UnaryArithmeticReduceNode extends RBaseNode {
 
     @Specialization
     protected int doLogicalVector(RLogicalVector operand, boolean naRm, @SuppressWarnings("unused") boolean finite) {
-        RNode.reportWork(this, operand.getLength());
+        RBaseNode.reportWork(this, operand.getLength());
         boolean profiledNaRm = naRmProfile.profile(naRm);
         int result = semantics.getIntStart();
         na.enable(operand);
@@ -280,7 +279,7 @@ public abstract class UnaryArithmeticReduceNode extends RBaseNode {
 
     @Specialization
     protected int doIntSequence(RIntSequence operand, @SuppressWarnings("unused") boolean naRm, @SuppressWarnings("unused") boolean finite) {
-        RNode.reportWork(this, operand.getLength());
+        RBaseNode.reportWork(this, operand.getLength());
         int result = semantics.getIntStart();
         int current = operand.getStart();
         for (int i = 0; i < operand.getLength(); i++) {
@@ -295,7 +294,7 @@ public abstract class UnaryArithmeticReduceNode extends RBaseNode {
 
     @Specialization
     protected double doDoubleSequence(RDoubleSequence operand, @SuppressWarnings("unused") boolean naRm, @SuppressWarnings("unused") boolean finite) {
-        RNode.reportWork(this, operand.getLength());
+        RBaseNode.reportWork(this, operand.getLength());
         double result = semantics.getDoubleStart();
         double current = operand.getStart();
         for (int i = 0; i < operand.getLength(); i++) {
@@ -310,7 +309,7 @@ public abstract class UnaryArithmeticReduceNode extends RBaseNode {
 
     @Specialization
     protected RComplex doComplexVector(RComplexVector operand, boolean naRm, @SuppressWarnings("unused") boolean finite) {
-        RNode.reportWork(this, operand.getLength());
+        RBaseNode.reportWork(this, operand.getLength());
         if (semantics.supportComplex) {
             boolean profiledNaRm = naRmProfile.profile(naRm);
             RComplex result = RRuntime.double2complex(semantics.getDoubleStart());
diff --git a/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jni/JNI_Glob.java b/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jni/JNI_Glob.java
index 975294266f0d1753ac9b461960a528a681701b97..e39000a54913d6e572794bee8792796f7dc01875 100644
--- a/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jni/JNI_Glob.java
+++ b/com.oracle.truffle.r.runtime.ffi/src/com/oracle/truffle/r/runtime/ffi/jni/JNI_Glob.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@ package com.oracle.truffle.r.runtime.ffi.jni;
 import java.util.ArrayList;
 
 public class JNI_Glob {
-    private ArrayList<String> paths = new ArrayList<>();
+    private final ArrayList<String> paths = new ArrayList<>();
 
     public static ArrayList<String> glob(String pattern) {
         JNI_Glob jniGlob = new JNI_Glob();
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/DCF.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/DCF.java
index a4b4387ce81acd55f7e7bc29b70cd354e087f81d..5f5fa9f83c5020a13f274dd3613ff463547e7d5e 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/DCF.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/DCF.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,7 +36,7 @@ public class DCF {
 
     public static class Fields {
         // A map because field may repeat and last one wins
-        private LinkedHashMap<String, String> fieldMap = new LinkedHashMap<>();
+        private final LinkedHashMap<String, String> fieldMap = new LinkedHashMap<>();
 
         private void add(String name, String content) {
             fieldMap.put(name, content);
@@ -47,7 +47,7 @@ public class DCF {
         }
     }
 
-    private ArrayList<Fields> paragraphs = new ArrayList<>();
+    private final ArrayList<Fields> paragraphs = new ArrayList<>();
 
     public static DCF read(String[] lines, Set<String> keepWhiteSet) {
         DCF result = new DCF();
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ExitException.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ExitException.java
index 53691d5cacc624a75a04234ed39c46cc85973af1..ba1179865854fc64615758ca3396de614f36df9a 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ExitException.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ExitException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@ package com.oracle.truffle.r.runtime;
  */
 public class ExitException extends RuntimeException {
     private static final long serialVersionUID = 1L;
-    private int status;
+    private final int status;
 
     public ExitException(int status) {
         this.status = status;
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/LazyDBCache.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/LazyDBCache.java
index 6b742edcf91819f1db05231372d374d31af946cf..62715c5023f1f05a5a8d3534824d4403101ffca8 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/LazyDBCache.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/LazyDBCache.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,7 @@ import com.oracle.truffle.r.runtime.context.RContext;
 public class LazyDBCache {
 
     public static final class ContextStateImpl implements RContext.ContextState {
-        private Map<String, byte[]> dbCache = new HashMap<>();
+        private final Map<String, byte[]> dbCache = new HashMap<>();
 
         public byte[] getData(String dbPath) {
             byte[] dbData = dbCache.get(dbPath);
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RChannel.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RChannel.java
index 13475477da4af40a519467e8e5d31948d45e7923..db41454ae064fd8a4a98ef1d178ddd4a0476359b 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RChannel.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RChannel.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -239,10 +239,10 @@ public class RChannel {
                 }
             }
 
-            private Bindings bindings;
+            private final Bindings bindings;
             // parent can be SerializedEnv or byte[]
-            private Object parent;
-            private DynamicObject attributes;
+            private final Object parent;
+            private final DynamicObject attributes;
 
             SerializedEnv(Bindings bindings, Object parent, DynamicObject attributes) {
                 this.bindings = bindings;
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RErrorHandling.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RErrorHandling.java
index ef3983b463ff1960d33350a7c04feb49fcf8e699..6bba048cb6b84e38b5bd1f030abb5c25ea0924a0 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RErrorHandling.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RErrorHandling.java
@@ -60,7 +60,7 @@ public class RErrorHandling {
     private static final RStringVector RESTART_CLASS = RDataFactory.createStringVectorFromScalar("restart");
 
     private static class Warnings {
-        private ArrayList<Warning> list = new ArrayList<>();
+        private final ArrayList<Warning> list = new ArrayList<>();
 
         int size() {
             return list.size();
@@ -95,11 +95,11 @@ public class RErrorHandling {
         /**
          * Current list of (deferred) warnings.
          */
-        private Warnings warnings = new Warnings();
+        private final Warnings warnings = new Warnings();
         /**
          * Max warnings accumulated.
          */
-        private int maxWarnings = 50;
+        private final int maxWarnings = 50;
         /**
          * Set/get by seterrmessage/geterrmessage builtins.
          */
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RInternalCode.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RInternalCode.java
index f47dda016857a979b6e7ece30d3ffc88a381de07..5abb022ae2315b9730dbdc2bc582100f064bfc01 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RInternalCode.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RInternalCode.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -42,7 +42,7 @@ import com.oracle.truffle.r.runtime.env.REnvironment;
 public final class RInternalCode {
     private final RContext context;
     private final String basePackage;
-    private Source source;
+    private final Source source;
 
     private REnvironment evaluatedEnvironment;
 
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RSerialize.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RSerialize.java
index 3cfaeb8f1ef3c197eae8b310ac86663dfdf6365a..156ab436c3abca2700e2169928fac1b40e075b29 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RSerialize.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RSerialize.java
@@ -5,7 +5,7 @@
  *
  * Copyright (c) 1995-2012, The R Core Team
  * Copyright (c) 2003, The R Foundation
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates
  *
  * All rights reserved.
  */
@@ -982,8 +982,9 @@ public class RSerialize {
                     Object car = readBCLang(SEXPTYPE.mapInt(stream.readInt()), reps);
                     Object cdr = readBCLang(SEXPTYPE.mapInt(stream.readInt()), reps);
                     Object ans = RDataFactory.createPairList(car, cdr, tag, type);
-                    if (pos >= 0)
+                    if (pos >= 0) {
                         reps[pos] = ans;
+                    }
                     return ans;
                 }
                 default: {
@@ -1188,7 +1189,7 @@ public class RSerialize {
     }
 
     private static class XdrOutputFormat extends POutputStream {
-        private byte[] buf;
+        private final byte[] buf;
         private int offset;
 
         XdrOutputFormat(OutputStream os) {
@@ -1295,12 +1296,13 @@ public class RSerialize {
 
     private static final class Output extends Common {
 
-        private State state;
-        protected final POutputStream stream;
-        private int version;
+        private final State state;
+        private final POutputStream stream;
+        private final int version;
 
         private Output(OutputStream os, int format, int version, CallHook hook) throws IOException {
             super(hook);
+            this.state = new PLState();
             this.version = version;
             switch (format) {
                 case ASCII:
@@ -1313,8 +1315,7 @@ public class RSerialize {
             }
         }
 
-        private void serialize(State s, Object obj) throws IOException {
-            this.state = s;
+        private void serialize(Object obj) throws IOException {
             switch (version) {
                 case DEFAULT_VERSION:
                     stream.writeInt(version);
@@ -1330,22 +1331,30 @@ public class RSerialize {
         }
 
         private static SEXPTYPE saveSpecialHook(Object item) {
-            if (item == RNull.instance)
+            if (item == RNull.instance) {
                 return SEXPTYPE.NILVALUE_SXP;
-            if (item == REnvironment.emptyEnv())
+            }
+            if (item == REnvironment.emptyEnv()) {
                 return SEXPTYPE.EMPTYENV_SXP;
-            if (item == REnvironment.baseEnv())
+            }
+            if (item == REnvironment.baseEnv()) {
                 return SEXPTYPE.BASEENV_SXP;
-            if (item == REnvironment.globalEnv())
+            }
+            if (item == REnvironment.globalEnv()) {
                 return SEXPTYPE.GLOBALENV_SXP;
-            if (item == RUnboundValue.instance)
+            }
+            if (item == RUnboundValue.instance) {
                 return SEXPTYPE.UNBOUNDVALUE_SXP;
-            if (item == RMissing.instance)
+            }
+            if (item == RMissing.instance) {
                 return SEXPTYPE.MISSINGARG_SXP;
-            if (item == REmpty.instance)
+            }
+            if (item == REmpty.instance) {
                 return SEXPTYPE.MISSINGARG_SXP;
-            if (item == REnvironment.baseNamespaceEnv())
+            }
+            if (item == REnvironment.baseNamespaceEnv()) {
                 return SEXPTYPE.BASENAMESPACE_SXP;
+            }
             if (item instanceof RArgsValuesAndNames && ((RArgsValuesAndNames) item).getLength() == 0) {
                 // empty DOTSXP
                 return SEXPTYPE.NILVALUE_SXP;
@@ -1814,12 +1823,7 @@ public class RSerialize {
      */
     private abstract static class State {
 
-        @SuppressWarnings("unused") protected final Output output;
-        private Map<String, RSymbol> symbolMap = new HashMap<>();
-
-        private State(Output output) {
-            this.output = output;
-        }
+        private final Map<String, RSymbol> symbolMap = new HashMap<>();
 
         /**
          * Pushes a new virtual pairlist (no type) onto the stack. An untyped pairlist is subject to
@@ -1927,11 +1931,7 @@ public class RSerialize {
      */
     private static class PLState extends State {
         private static final RPairList NULL = RDataFactory.createPairList();
-        private Deque<RPairList> active = new LinkedList<>();
-
-        private PLState(Output output) {
-            super(output);
-        }
+        private final Deque<RPairList> active = new LinkedList<>();
 
         @Override
         public State openPairList() {
@@ -2081,8 +2081,7 @@ public class RSerialize {
         ByteArrayOutputStream out = new ByteArrayOutputStream();
         try {
             Output output = new Output(out, type, version, (CallHook) refhook);
-            State state = new PLState(output);
-            output.serialize(state, obj);
+            output.serialize(obj);
             return out.toByteArray();
         } catch (IOException ex) {
             throw RInternalError.shouldNotReachHere();
@@ -2092,8 +2091,7 @@ public class RSerialize {
     @TruffleBoundary
     public static void serialize(RConnection conn, Object obj, int type, int version, Object refhook) throws IOException {
         Output output = new Output(conn.getOutputStream(), type, version, (CallHook) refhook);
-        State state = new PLState(output);
-        output.serialize(state, obj);
+        output.serialize(obj);
     }
 
     private static class Debug {
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RStartParams.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RStartParams.java
index c3de0108a860ff1780206fb560f0545185033725..854b3c93b6bd5580f61f6084f1ae8fe534c4d490 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RStartParams.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RStartParams.java
@@ -88,7 +88,7 @@ public class RStartParams {
     /**
      * The original command line arguments that were parsed by {@link RCmdOptions}.
      */
-    private String[] arguments;
+    private final String[] arguments;
 
     /**
      * Indicates that FastR is running embedded.
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/Utils.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/Utils.java
index f4f61fb5edcf57d2c3ffa6a1f4b517f9fd675de2..751f209ca90f7dd5ac9bf099d255e6168cb33cb2 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/Utils.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/Utils.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -828,7 +828,7 @@ public final class Utils {
     }
 
     public static class NonRecursiveHashSet<VAL> {
-        private NonRecursiveHashMap<VAL> map;
+        private final NonRecursiveHashMap<VAL> map;
 
         public NonRecursiveHashSet(int approxCapacity) {
             map = new NonRecursiveHashMap<>(approxCapacity);
@@ -844,7 +844,7 @@ public final class Utils {
     }
 
     public static class NonRecursiveHashSetInt {
-        private NonRecursiveHashMapInt map;
+        private final NonRecursiveHashMapInt map;
 
         public NonRecursiveHashSetInt(int approxCapacity) {
             map = new NonRecursiveHashMapInt(approxCapacity);
@@ -860,7 +860,7 @@ public final class Utils {
     }
 
     public static class NonRecursiveHashSetDouble {
-        private NonRecursiveHashMapDouble map;
+        private final NonRecursiveHashMapDouble map;
 
         public NonRecursiveHashSetDouble(int approxCapacity) {
             map = new NonRecursiveHashMapDouble(approxCapacity);
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/conn/CompressedConnections.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/conn/CompressedConnections.java
index 4530f65c9fdf88e51cd6f695f3837f15e0fe423d..f914930fdb4de04ac1e9da3ec2c2496def98c4c4 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/conn/CompressedConnections.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/conn/CompressedConnections.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -157,7 +157,7 @@ public class CompressedConnections {
     }
 
     private static class CompressedInputRConnection extends DelegateReadRConnection implements ReadWriteHelper {
-        private InputStream inputStream;
+        private final InputStream inputStream;
 
         protected CompressedInputRConnection(CompressedRConnection base, InputStream is) {
             super(base);
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/conn/FileConnections.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/conn/FileConnections.java
index 0d9d532e6b8067c4cd06176db2782bde0f2c6513..10e9a7ce172cdb19cf95775c1b76f9566cca8bc4 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/conn/FileConnections.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/conn/FileConnections.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -167,7 +167,7 @@ public class FileConnections {
     }
 
     private static class FileWriteTextRConnection extends DelegateWriteRConnection implements ReadWriteHelper {
-        private BufferedOutputStream outputStream;
+        private final BufferedOutputStream outputStream;
 
         FileWriteTextRConnection(FileRConnection base, boolean append) throws IOException {
             super(base);
@@ -218,7 +218,7 @@ public class FileConnections {
     }
 
     static class FileReadBinaryRConnection extends DelegateReadRConnection implements ReadWriteHelper {
-        private FileInputStream inputStream;
+        private final FileInputStream inputStream;
 
         FileReadBinaryRConnection(BasePathRConnection base) throws IOException {
             super(base);
@@ -290,7 +290,7 @@ public class FileConnections {
     }
 
     private static class FileWriteBinaryConnection extends DelegateWriteRConnection implements ReadWriteHelper {
-        private FileOutputStream outputStream;
+        private final FileOutputStream outputStream;
 
         FileWriteBinaryConnection(FileRConnection base, boolean append) throws IOException {
             super(base);
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/conn/SocketConnections.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/conn/SocketConnections.java
index 4de2db23b0a4e9cd07c22f15d95dfd9f04edb3e4..e7da9ceca6c5ac57c0273d57c0c631a8dc9898e9 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/conn/SocketConnections.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/conn/SocketConnections.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -172,7 +172,7 @@ public class SocketConnections {
     }
 
     private static class RServerSocketConnection extends RSocketReadWriteConnection {
-        private Socket connectionSocket;
+        private final Socket connectionSocket;
 
         RServerSocketConnection(RSocketConnection base) throws IOException {
             super(base);
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/conn/TextConnections.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/conn/TextConnections.java
index a8e290b98b4282799ba5ca2e86e5c62132acdf99..8c85df0c7d046d60b1a27ae91d5f3c1bb2b917bd 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/conn/TextConnections.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/conn/TextConnections.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -87,7 +87,7 @@ public class TextConnections {
     }
 
     private static class TextReadRConnection extends DelegateReadRConnection implements GetConnectionValue {
-        private String[] lines;
+        private final String[] lines;
         private int index;
 
         TextReadRConnection(TextRConnection base) {
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/conn/URLConnections.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/conn/URLConnections.java
index 08403f65692cc7e4af2f7048e165c9ed7b84d215..7aad2be8e1da673e7e06da3e01258bc900eccacf 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/conn/URLConnections.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/conn/URLConnections.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -67,7 +67,7 @@ public class URLConnections {
 
     private static class URLReadRConnection extends DelegateReadRConnection implements ReadWriteHelper {
 
-        private BufferedInputStream inputStream;
+        private final BufferedInputStream inputStream;
 
         protected URLReadRConnection(URLRConnection base) throws MalformedURLException, IOException {
             super(base);
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/context/RContext.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/context/RContext.java
index a140e87e36be058b7b0406c79f936edaa940e5b8..2b36adaa26cf1df40d2f3a85bcb5c7b7174b2674 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/context/RContext.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/context/RContext.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -333,7 +333,7 @@ public final class RContext extends ExecutionContext implements TruffleObject {
      */
     private boolean methodTableDispatchOn = false;
     private boolean allowPrimitiveMethods = true;
-    private HashMap<String, RStringVector> s4ExtendsTable = new HashMap<>();
+    private final HashMap<String, RStringVector> s4ExtendsTable = new HashMap<>();
 
     private boolean nullS4Object = false;
 
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/AgentObjectSizeFactory.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/AgentObjectSizeFactory.java
index 7e303054edb4f818d2153f011bac4e37a0baebff..152f88fedcaf6a89df664d6b227145d0d8c2b8cb 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/AgentObjectSizeFactory.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/data/AgentObjectSizeFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -58,7 +58,7 @@ import com.oracle.truffle.r.runtime.data.RObjectSize.TypeCustomizer;
  */
 public class AgentObjectSizeFactory extends ObjectSizeFactory {
 
-    private Map<Class<?>, ArrayList<Field>> objectFieldsMap = new HashMap<>();
+    private final Map<Class<?>, ArrayList<Field>> objectFieldsMap = new HashMap<>();
     private static Map<Class<?>, TypeCustomizer> customizerMap = new HashMap<>(); // system wide
 
     public AgentObjectSizeFactory() {
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/DLL.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/DLL.java
index bff24d02281e3874c40b0c6648be35a83b339980..a20cbe325d123a191d94fde8565660a08b49f96d 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/DLL.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/ffi/DLL.java
@@ -164,7 +164,7 @@ public class DLL {
         public final Object handle;
         private boolean dynamicLookup;
         private boolean forceSymbols;
-        private DotSymbol[][] nativeSymbols = new DotSymbol[NativeSymbolType.values().length][];
+        private final DotSymbol[][] nativeSymbols = new DotSymbol[NativeSymbolType.values().length][];
 
         private DLLInfo(String name, String path, boolean dynamicLookup, Object handle) {
             this.id = ID.getAndIncrement();
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/instrument/InstrumentationState.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/instrument/InstrumentationState.java
index 4af3bde56a12da075ef32fb01242f384c846c925..cf8ff63d1cfb0127224309737983045c17058f0a 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/instrument/InstrumentationState.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/instrument/InstrumentationState.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -137,7 +137,7 @@ public final class InstrumentationState implements RContext.ContextState {
 
         private RCaller caller;
         private String lastEmptyLineCommand = "n";
-        private ArrayList<HelperState> helperStateList = new ArrayList<>();
+        private final ArrayList<HelperState> helperStateList = new ArrayList<>();
 
         public void setInBrowser(RCaller caller) {
             this.caller = caller;
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/distr/PTukey.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/distr/PTukey.java
index b238d42c7797c61d15ddc7e2ed17462e60c460e2..5b6f589c6f832bf7c8ad80ddd0d25b11cefe352b 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/distr/PTukey.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/distr/PTukey.java
@@ -164,7 +164,7 @@ public class PTukey implements Function4_2 {
         return DPQ.rdtval(ans, lowerTail, logP);
     }
 
-    private double getULen(double df) {
+    private static double getULen(double df) {
         if (df <= dhaf) {
             return ulen1;
         } else if (df <= dquar) {
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/distr/QBeta.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/distr/QBeta.java
index 02e634aff2c39d4bfe4c2155a4148c616be59aa8..c05b3e752d034baa55381b186b0080456cf2837f 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/distr/QBeta.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/distr/QBeta.java
@@ -524,8 +524,9 @@ public final class QBeta implements Function3_2 {
                     w = log_p
                                     ? (y - la) * Math.exp(y + logbeta + r * Math.log(xinbta) + t * Math.log1p(-xinbta))
                                     : (y - a) * Math.exp(logbeta + r * Math.log(xinbta) + t * Math.log1p(-xinbta));
-                    if (i_pb >= n_N && w * wprev <= 0.)
+                    if (i_pb >= n_N && w * wprev <= 0.) {
                         prev = RMath.fmax2(Math.abs(adj), fpu);
+                    }
                     debugPrintf("N(i=%d): x0=%.15g, pb(x0)=%.15g, w=%.15g, %s prev=%g,",
                                     i_pb, xinbta, y, w, (w * wprev <= 0.) ? "new" : "old", prev);
                     g = 1;
diff --git a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/distr/Signrank.java b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/distr/Signrank.java
index 8d0f14b55465e532472cdd511250b1d50ce322ee..2d1baf7bbb09de6887be963fc120e934f6304e5c 100644
--- a/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/distr/Signrank.java
+++ b/com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/nmath/distr/Signrank.java
@@ -175,7 +175,7 @@ public final class Signrank {
          * Makes sure that the value can be reached by integer counter, this is probably just really
          * defensive, since the allocation with such number is bound to fail anyway.
          */
-        private int getUpperIntBound(double x) {
+        private static int getUpperIntBound(double x) {
             return (x + 1) > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) Math.ceil(x);
         }
     }
diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/generate/TestOutputManager.java b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/generate/TestOutputManager.java
index 5c35c1784eba2e2527927b56971812618a92f2a0..da01131596867aa995cec32575a0fe560592ad15 100644
--- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/generate/TestOutputManager.java
+++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/generate/TestOutputManager.java
@@ -120,7 +120,7 @@ public class TestOutputManager {
     /**
      * Maps inputs to expected outputs, used during generation.
      */
-    private SortedMap<String, SortedMap<String, TestInfo>> testMaps = new TreeMap<>();
+    private final SortedMap<String, SortedMap<String, TestInfo>> testMaps = new TreeMap<>();
     /**
      * A fast lookup map used at runtime to located the expected output.
      */