Skip to content

Commit 99db7a8

Browse files
committed
[Java] Style consistency and add JavadocVariable Checkstyle test.
1 parent eca18dd commit 99db7a8

18 files changed

+36
-78
lines changed

config/checkstyle/checkstyle.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333

3434
<module name="SuppressWarningsHolder"/>
3535

36+
<module name="JavadocVariable">
37+
<property name="scope" value="public"/>
38+
</module>
3639
<module name="MissingJavadocType"/>
3740
<module name="MissingJavadocMethod"/>
3841
<module name="MissingJavadocPackage"/>

config/checkstyle/suppressions.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
<suppress files=".*generated.*" checks="."/>
88
<suppress files="[\\/]test[\\/]" checks="MissingJavadoc.*"/>
99
<suppress files="[\\/]propertyTest[\\/]" checks="MissingJavadoc.*"/>
10+
<suppress files="[\\/]propertyTest[\\/]" checks="JavadocVariable"/>
1011
<suppress files="[\\/]sbe-benchmarks[\\/]" checks="MissingJavadoc.*"/>
1112
</suppressions>

sbe-tool/src/propertyTest/java/uk/co/real_logic/sbe/properties/DtosPropertyTest.java

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ public class DtosPropertyTest
6464
@Property
6565
void javaDtoEncodeShouldBeTheInverseOfDtoDecode(
6666
@ForAll("encodedMessage") final SbeArbitraries.EncodedMessage encodedMessage,
67-
final Footnotes footnotes
68-
) throws IOException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException,
67+
final Footnotes footnotes)
68+
throws IOException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException,
6969
IllegalAccessException
7070
{
7171
final String packageName = encodedMessage.ir().applicableNamespace();
@@ -136,8 +136,8 @@ void javaDtoEncodeShouldBeTheInverseOfDtoDecode(
136136
@Property
137137
void csharpDtoEncodeShouldBeTheInverseOfDtoDecode(
138138
@ForAll("encodedMessage") final SbeArbitraries.EncodedMessage encodedMessage,
139-
final Footnotes footnotes
140-
) throws IOException, InterruptedException
139+
final Footnotes footnotes)
140+
throws IOException, InterruptedException
141141
{
142142
final Path tempDir = Files.createTempDirectory("sbe-csharp-dto-test");
143143

@@ -201,17 +201,14 @@ void csharpDtoEncodeShouldBeTheInverseOfDtoDecode(
201201
@Property(shrinking = ShrinkingMode.OFF)
202202
void cppDtoEncodeShouldBeTheInverseOfDtoDecode(
203203
@ForAll("encodedMessage") final SbeArbitraries.EncodedMessage encodedMessage,
204-
final Footnotes footnotes
205-
) throws IOException, InterruptedException
204+
final Footnotes footnotes) throws IOException, InterruptedException
206205
{
207206
final Path tempDir = Files.createTempDirectory("sbe-cpp-dto-test");
208207

209208
try
210209
{
211210
final NamespaceOutputManager outputManager = new NamespaceOutputManager(
212-
tempDir.toString(),
213-
"sbe_property_test"
214-
);
211+
tempDir.toString(), "sbe_property_test");
215212

216213
try
217214
{
@@ -244,7 +241,7 @@ void cppDtoEncodeShouldBeTheInverseOfDtoDecode(
244241
{
245242
throw new AssertionError(
246243
"Input and output files differ\n\n" +
247-
"SCHEMA:\n" + encodedMessage.schema());
244+
"SCHEMA:\n" + encodedMessage.schema());
248245
}
249246
}
250247
catch (final Throwable throwable)

sbe-tool/src/propertyTest/java/uk/co/real_logic/sbe/properties/JsonPropertyTest.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
1716
package uk.co.real_logic.sbe.properties;
1817

1918
import net.jqwik.api.Arbitrary;
@@ -29,9 +28,7 @@
2928
public class JsonPropertyTest
3029
{
3130
@Property
32-
void shouldGenerateValidJson(
33-
@ForAll("encodedMessage") final SbeArbitraries.EncodedMessage encodedMessage
34-
)
31+
void shouldGenerateValidJson(@ForAll("encodedMessage") final SbeArbitraries.EncodedMessage encodedMessage)
3532
{
3633
final StringBuilder output = new StringBuilder();
3734
final JsonPrinter printer = new JsonPrinter(encodedMessage.ir());

sbe-tool/src/propertyTest/java/uk/co/real_logic/sbe/properties/ParserPropertyTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
1716
package uk.co.real_logic.sbe.properties;
1817

1918
import net.jqwik.api.Arbitrary;

sbe-tool/src/propertyTest/java/uk/co/real_logic/sbe/properties/arbitraries/SbeArbitraries.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
1716
package uk.co.real_logic.sbe.properties.arbitraries;
1817

1918
import net.jqwik.api.Arbitraries;
@@ -268,9 +267,7 @@ private static Arbitrary<VarDataSchema> varDataSchema()
268267
(short)0,
269268
(short)0,
270269
(short)1,
271-
(short)2
272-
)
273-
);
270+
(short)2));
274271
}
275272

276273
public static Arbitrary<MessageSchema> messageSchema()
@@ -352,8 +349,10 @@ public static CharacterArbitrary chars(final CharGenerationMode mode)
352349
{
353350
case UNRESTRICTED:
354351
return Arbitraries.chars();
352+
355353
case JSON_PRINTER_COMPATIBLE:
356354
return Arbitraries.chars().alpha();
355+
357356
default:
358357
throw new IllegalArgumentException("Unsupported mode: " + mode);
359358
}

sbe-tool/src/propertyTest/java/uk/co/real_logic/sbe/properties/schema/CompositeTypeSchema.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
1716
package uk.co.real_logic.sbe.properties.schema;
1817

1918
import java.util.List;
@@ -32,7 +31,6 @@ public List<TypeSchema> fields()
3231
return fields;
3332
}
3433

35-
@Override
3634
public void accept(final TypeSchemaVisitor visitor)
3735
{
3836
visitor.onComposite(this);

sbe-tool/src/propertyTest/java/uk/co/real_logic/sbe/properties/schema/EncodedDataTypeSchema.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
1716
package uk.co.real_logic.sbe.properties.schema;
1817

1918
import uk.co.real_logic.sbe.PrimitiveType;
@@ -30,8 +29,7 @@ public EncodedDataTypeSchema(
3029
final PrimitiveType primitiveType,
3130
final int length,
3231
final Encoding.Presence presence,
33-
final boolean isEmbedded
34-
)
32+
final boolean isEmbedded)
3533
{
3634
this.primitiveType = primitiveType;
3735
this.length = length;
@@ -54,16 +52,13 @@ public Encoding.Presence presence()
5452
return presence;
5553
}
5654

57-
@Override
5855
public boolean isEmbedded()
5956
{
6057
return isEmbedded;
6158
}
6259

63-
@Override
6460
public void accept(final TypeSchemaVisitor visitor)
6561
{
6662
visitor.onEncoded(this);
6763
}
68-
6964
}

sbe-tool/src/propertyTest/java/uk/co/real_logic/sbe/properties/schema/EnumTypeSchema.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
1716
package uk.co.real_logic.sbe.properties.schema;
1817

1918
import java.util.List;
@@ -41,7 +40,6 @@ public List<String> validValues()
4140
return validValues;
4241
}
4342

44-
@Override
4543
public void accept(final TypeSchemaVisitor visitor)
4644
{
4745
visitor.onEnum(this);

sbe-tool/src/propertyTest/java/uk/co/real_logic/sbe/properties/schema/FieldSchema.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
1716
package uk.co.real_logic.sbe.properties.schema;
1817

1918
import uk.co.real_logic.sbe.ir.Encoding;
@@ -27,8 +26,7 @@ public final class FieldSchema
2726
public FieldSchema(
2827
final TypeSchema type,
2928
final Encoding.Presence presence,
30-
final short sinceVersion
31-
)
29+
final short sinceVersion)
3230
{
3331
assert sinceVersion == 0 || presence.equals(Encoding.Presence.OPTIONAL);
3432
this.type = type;

0 commit comments

Comments
 (0)