Select Git revision

Johannes Mey authored
A.java 1021 B
package p1;
public abstract class ClassA {
int fieldA;
int fieldB;
public ClassA(int constructorParameterA) {
int localConstructorVarA = 0;
}
public void methodNameA(int parameterA) {
int localVarA = 1;
int localVarB = 1;
{
int localVarInBlockA = 2;
// this is shadowed (and forbidden)
int localVarA = 3;
}
// this is shadowed (over two levels, not forbidden)
int fieldA;
try (
// this is forbidden
java.util.zip.ZipFile localVarB = new java.util.zip.ZipFile("zipFileName");
// this is okay
java.io.BufferedWriter fieldB = java.nio.file.Files.newBufferedWriter(null)
) { /* do stuff */ } catch (java.io.IOException e) {/* do stuff */}
}
int i;
class Local {
{
for (int i = 0; i < 10; i++) System.out.println(i);
}
}
// this does not appear as a scope (and, more importantly, the parameters are not added anywhere else)
public abstract void methodNameB(int parameterForAbstractMethodB);
}