replace increment / decrement synthetic access method, pull-request #373
This commit is contained in:
44
testData/src/pkg/TestSyntheticAccess.java
Normal file
44
testData/src/pkg/TestSyntheticAccess.java
Normal file
@@ -0,0 +1,44 @@
|
||||
package pkg;
|
||||
|
||||
/**
|
||||
* @author Alexandru-Constantin Bledea
|
||||
* @since March 20, 2016
|
||||
*/
|
||||
class TestSyntheticAccess {
|
||||
|
||||
private static int s;
|
||||
private int i;
|
||||
|
||||
private class Incrementer {
|
||||
void orI() {
|
||||
i|=1;
|
||||
}
|
||||
|
||||
void incrementI() {
|
||||
i++;
|
||||
}
|
||||
|
||||
void decrementI() {
|
||||
--i;
|
||||
}
|
||||
|
||||
void incrementS() {
|
||||
++s;
|
||||
}
|
||||
|
||||
void decrementS() {
|
||||
s--;
|
||||
}
|
||||
}
|
||||
|
||||
private class Assigner {
|
||||
void assignI(int newValue) {
|
||||
i = newValue;
|
||||
}
|
||||
|
||||
void assignS(int newValue) {
|
||||
s = newValue;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user