I am submitting a patch for log4j's SMTPAppender. The patch has two changes: 1) new method: protected CyclicBuffer getCyclicBuffer() 2) SMTPAppender uses getCyclicBuffer() whenever it needs to access the buffer object This change makes it easier for third parties to subclass (extend) SMTPAppender.
Created attachment 23597 [details] patch for SMTPAppender.java
I don't see how the benefit of the mod. The cb member is protected and non-final, so if you wanted to replace the current implementation with your own CyclicBuffer implementation, you could do it in either the constructor or activateOptions. Could you explain the use case?
The use case is that I plan to maintain a CyclicBuffer per Thread. If there were a getCyclicBuffer() method, I would be able to do this: protected CyclicBuffer getCyclicBuffer() { return threadLocalCyclicBuffer.get(); }