1717
1818import org .agrona .*;
1919import org .agrona .generation .OutputManager ;
20+ import org .agrona .sbe .*;
2021import uk .co .real_logic .sbe .PrimitiveType ;
2122import uk .co .real_logic .sbe .generation .CodeGenerator ;
2223import uk .co .real_logic .sbe .generation .Generators ;
@@ -48,11 +49,6 @@ enum CodecType
4849 private static final String PACKAGE_INFO = "package-info" ;
4950 private static final String BASE_INDENT = "" ;
5051 private static final String INDENT = " " ;
51- private static final String FLYWEIGHT = "Flyweight" ;
52- private static final String COMPOSITE_DECODER_FLYWEIGHT = "CompositeDecoderFlyweight" ;
53- private static final String COMPOSITE_ENCODER_FLYWEIGHT = "CompositeEncoderFlyweight" ;
54- private static final String MESSAGE_DECODER_FLYWEIGHT = "MessageDecoderFlyweight" ;
55- private static final String MESSAGE_ENCODER_FLYWEIGHT = "MessageEncoderFlyweight" ;
5652
5753 private final Ir ir ;
5854 private final OutputManager outputManager ;
@@ -193,7 +189,7 @@ private void generateEncoder(
193189 throws IOException
194190 {
195191 final String className = formatClassName (encoderName (msgToken .name ()));
196- final String implementsString = implementsInterface (MESSAGE_ENCODER_FLYWEIGHT );
192+ final String implementsString = implementsInterface (MessageEncoderFlyweight . class . getSimpleName () );
197193
198194 try (Writer out = outputManager .createOutput (className ))
199195 {
@@ -220,7 +216,7 @@ private void generateDecoder(
220216 throws IOException
221217 {
222218 final String className = formatClassName (decoderName (msgToken .name ()));
223- final String implementsString = implementsInterface (MESSAGE_DECODER_FLYWEIGHT );
219+ final String implementsString = implementsInterface (MessageDecoderFlyweight . class . getSimpleName () );
224220
225221 try (Writer out = outputManager .createOutput (className ))
226222 {
@@ -1187,7 +1183,7 @@ private void generateBitSet(final List<Token> tokens) throws IOException
11871183 final String decoderName = decoderName (bitSetName );
11881184 final String encoderName = encoderName (bitSetName );
11891185 final List <Token > messageBody = getMessageBody (tokens );
1190- final String implementsString = implementsInterface (FLYWEIGHT );
1186+ final String implementsString = implementsInterface (Flyweight . class . getSimpleName () );
11911187
11921188 try (Writer out = outputManager .createOutput (decoderName ))
11931189 {
@@ -1261,7 +1257,7 @@ private void generateComposite(final List<Token> tokens) throws IOException
12611257
12621258 try (Writer out = outputManager .createOutput (decoderName ))
12631259 {
1264- final String implementsString = implementsInterface (COMPOSITE_DECODER_FLYWEIGHT );
1260+ final String implementsString = implementsInterface (CompositeDecoderFlyweight . class . getSimpleName () );
12651261 generateCompositeFlyweightHeader (
12661262 token , decoderName , out , readOnlyBuffer , fqReadOnlyBuffer , implementsString );
12671263
@@ -1309,7 +1305,7 @@ private void generateComposite(final List<Token> tokens) throws IOException
13091305
13101306 try (Writer out = outputManager .createOutput (encoderName ))
13111307 {
1312- final String implementsString = implementsInterface (COMPOSITE_ENCODER_FLYWEIGHT );
1308+ final String implementsString = implementsInterface (CompositeEncoderFlyweight . class . getSimpleName () );
13131309 generateCompositeFlyweightHeader (token , encoderName , out , mutableBuffer , fqMutableBuffer , implementsString );
13141310
13151311 for (int i = 1 , end = tokens .size () - 1 ; i < end ;)
0 commit comments