Skip to content

Commit a5a874e

Browse files
committed
[Java] Basic type should be treated the same as more complex types when generating IR regarding description and deprecation.
1 parent 52a6342 commit a5a874e

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/IrGenerator.java

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ private void addAllFields(final List<Field> fieldList)
161161
{
162162
final Type type = field.type();
163163

164-
if (type == null)
164+
if (null == type)
165165
{
166166
addFieldSignal(field, Signal.BEGIN_GROUP);
167167
add(field.dimensionType(), 0, field);
@@ -219,7 +219,7 @@ private void add(final CompositeType type, final int currOffset, final Field fie
219219
.semanticType(semanticTypeOf(type, field))
220220
.build());
221221

222-
if (field != null)
222+
if (null != field)
223223
{
224224
builder.version(Math.max(field.sinceVersion(), type.sinceVersion()));
225225
}
@@ -281,7 +281,7 @@ private void add(final EnumType type, final int offset, final Field field)
281281
.description(type.description())
282282
.encoding(encodingBuilder.build());
283283

284-
if (field != null)
284+
if (null != field)
285285
{
286286
builder.version(Math.max(field.sinceVersion(), type.sinceVersion()));
287287
}
@@ -333,7 +333,7 @@ private void add(final SetType type, final int offset, final Field field)
333333
.primitiveType(encodingType)
334334
.build());
335335

336-
if (field != null)
336+
if (null != field)
337337
{
338338
builder.version(Math.max(field.sinceVersion(), type.sinceVersion()));
339339
}
@@ -391,16 +391,9 @@ private void add(final EncodedDataType type, final int offset, final Field field
391391
.deprecated(type.deprecated())
392392
.offset(offset);
393393

394-
if (field != null && !(field.type() instanceof CompositeType))
394+
if (null != field && !(field.type() instanceof CompositeType))
395395
{
396396
tokenBuilder.version(Math.max(field.sinceVersion(), type.sinceVersion()));
397-
tokenBuilder.deprecated(field.deprecated());
398-
399-
final String description = field.description();
400-
if (null != description && description.length() > 0)
401-
{
402-
tokenBuilder.description(description);
403-
}
404397
}
405398

406399
switch (type.presence())

0 commit comments

Comments
 (0)