I was building a class using play framework 1.2.x .
I have a Controller class which contains a non-anonymous(named) private inner class.
When I try to access one of the public fields of the inner class via its constructor I get the following error 
The above code
private static class FinancialTransactionJSONPacket implements JSONPacket{
public final boolean isSuccess;
public final List<FinancialTransaction> financialTransactions;
public final OPERATIONS operation;
public FinancialTransactionJSONPacket(boolean isSuccess,FinancialTransaction financialTransaction,OPERATIONS operation) {
this(isSuccess,new ArrayList<FinancialTransaction>(),operation);
/* Line 43 */ this.financialTransactions.add(financialTransaction);
}
}
I don’t get the Logic , how is this even possible ? I am accessing an attribute of a class from within its constructor how do access specifiers matter ?
I tried searching and found this article but it relates to anonymous Inner Classes, and the solution proposed is to make the anonymous inner class as a named class.
Declarations
public final List<FinancialTransaction> financialTransactions;private static class FinancialTransactionJSONPacket
The static class is private, so only the enclosing class can access its members, whether they are public or not.
I can’t see any evidence in your illegible graphic that the access is happening within the static class’s own constructor. It looks when I peer at it more like an external class is trying to access the class’s innards.
NB This is not an inner class, because it is static.