Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9698c38

Browse files
committed
[Java] Formatting.
1 parent 9d100e0 commit 9698c38

File tree

12 files changed

+34
-42
lines changed

12 files changed

+34
-42
lines changed

sbe-tool/src/main/java/uk/co/real_logic/sbe/PrimitiveType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public static PrimitiveType get(final String name)
117117
{
118118
for (final PrimitiveType p : Singleton.VALUES)
119119
{
120-
if (name.equals(p.name))
120+
if (p.name.equals(name))
121121
{
122122
return p;
123123
}

sbe-tool/src/main/java/uk/co/real_logic/sbe/PrimitiveValue.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,13 @@ public static PrimitiveValue parse(final String value, final PrimitiveType primi
200200
* Parse constant value string and set representation based on type, length, and characterEncoding
201201
*
202202
* @param value expressed as a String
203-
* @param primitiveType that this is supposed to be
204203
* @param length of the type
205204
* @param characterEncoding of the String
206205
* @return a new {@link PrimitiveValue} for the value.
207206
* @throws IllegalArgumentException if parsing malformed type
208207
*/
209208
public static PrimitiveValue parse(
210-
final String value, final PrimitiveType primitiveType, final int length, final String characterEncoding)
209+
final String value, final int length, final String characterEncoding)
211210
{
212211
// TODO: handle incorrect length, characterEncoding, etc.
213212
return new PrimitiveValue(value.getBytes(forName(characterEncoding)), characterEncoding, length);

sbe-tool/src/main/java/uk/co/real_logic/sbe/SbeTool.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,10 @@ public static MessageSchema parseSchema(final String sbeSchemaFilename)
214214
final ParserOptions.Builder optionsBuilder =
215215
ParserOptions
216216
.builder()
217-
.xsdFilename(System.getProperty(SbeTool.VALIDATION_XSD))
218-
.stopOnError(Boolean.parseBoolean(System.getProperty(SbeTool.VALIDATION_STOP_ON_ERROR)))
219-
.warningsFatal(Boolean.parseBoolean(System.getProperty(SbeTool.VALIDATION_WARNINGS_FATAL)))
220-
.suppressOutput(Boolean.parseBoolean(System.getProperty(SbeTool.VALIDATION_SUPPRESS_OUTPUT)));
217+
.xsdFilename(System.getProperty(VALIDATION_XSD))
218+
.stopOnError(Boolean.parseBoolean(System.getProperty(VALIDATION_STOP_ON_ERROR)))
219+
.warningsFatal(Boolean.parseBoolean(System.getProperty(VALIDATION_WARNINGS_FATAL)))
220+
.suppressOutput(Boolean.parseBoolean(System.getProperty(VALIDATION_SUPPRESS_OUTPUT)));
221221

222222
try (final BufferedInputStream in = new BufferedInputStream(new FileInputStream(sbeSchemaFilename)))
223223
{

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ public class CompositeType extends Type
4444
* @param node from the XML Schema Parsing
4545
* @throws XPathExpressionException if the XPath is invalid.
4646
*/
47-
public CompositeType(final Node node)
48-
throws XPathExpressionException
47+
public CompositeType(final Node node) throws XPathExpressionException
4948
{
5049
super(node);
5150

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import org.w3c.dom.Node;
2323

24+
import static uk.co.real_logic.sbe.xml.Presence.CONSTANT;
2425
import static uk.co.real_logic.sbe.xml.XmlSchemaParser.handleError;
2526
import static uk.co.real_logic.sbe.xml.XmlSchemaParser.handleWarning;
2627
import static uk.co.real_logic.sbe.xml.XmlSchemaParser.getAttributeValue;
@@ -58,7 +59,7 @@ public EncodedDataType(final Node node)
5859
sinceVersion = Integer.parseInt(getAttributeValue(node, "sinceVersion", "0"));
5960
offsetAttribute = Integer.parseInt(getAttributeValue(node, "offset", "-1"));
6061

61-
if (presence() == Presence.CONSTANT)
62+
if (presence() == CONSTANT)
6263
{
6364
if (node.getFirstChild() == null)
6465
{
@@ -76,7 +77,7 @@ public EncodedDataType(final Node node)
7677
}
7778
else
7879
{
79-
constValue = PrimitiveValue.parse(nodeValue, primitiveType, nodeValue.length(), characterEncoding);
80+
constValue = PrimitiveValue.parse(nodeValue, nodeValue.length(), characterEncoding);
8081
}
8182
}
8283
else
@@ -188,7 +189,7 @@ public PrimitiveType primitiveType()
188189
*/
189190
public int encodedLength()
190191
{
191-
if (presence() == Presence.CONSTANT)
192+
if (presence() == CONSTANT)
192193
{
193194
return 0;
194195
}
@@ -209,7 +210,7 @@ public int encodedLength()
209210
public PrimitiveValue constVal()
210211
throws IllegalArgumentException
211212
{
212-
if (presence() != Presence.CONSTANT)
213+
if (presence() != CONSTANT)
213214
{
214215
throw new IllegalStateException("type is not of constant presence");
215216
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import java.util.LinkedHashMap;
2929
import java.util.Map;
3030

31+
import static uk.co.real_logic.sbe.xml.Presence.OPTIONAL;
3132
import static uk.co.real_logic.sbe.xml.XmlSchemaParser.handleError;
3233
import static uk.co.real_logic.sbe.xml.XmlSchemaParser.handleWarning;
3334
import static uk.co.real_logic.sbe.xml.XmlSchemaParser.checkForValidName;
@@ -50,8 +51,7 @@ public class EnumType extends Type
5051
* @param node from the XML Schema Parsing
5152
* @throws XPathExpressionException if the XPath is invalid
5253
*/
53-
public EnumType(final Node node)
54-
throws XPathExpressionException
54+
public EnumType(final Node node) throws XPathExpressionException
5555
{
5656
super(node);
5757

@@ -75,7 +75,7 @@ public EnumType(final Node node)
7575
// might not have ran into this type yet, so look for it
7676
final Node encodingTypeNode =
7777
(Node)xPath.compile(String.format("%s[@name=\'%s\']", XmlSchemaParser.TYPE_XPATH_EXPR, encodingTypeStr))
78-
.evaluate(node.getOwnerDocument(), XPathConstants.NODE);
78+
.evaluate(node.getOwnerDocument(), XPathConstants.NODE);
7979

8080
if (null == encodingTypeNode)
8181
{
@@ -96,14 +96,14 @@ public EnumType(final Node node)
9696
final String nullValueStr = getAttributeValueOrNull(node, "nullValue");
9797
if (null != nullValueStr)
9898
{
99-
if (presence() != Presence.OPTIONAL)
99+
if (presence() != OPTIONAL)
100100
{
101101
handleError(node, "nullValue set, but presence is not optional");
102102
}
103103

104104
nullValue = PrimitiveValue.parse(nullValueStr, encodingType);
105105
}
106-
else if (presence() == Presence.OPTIONAL)
106+
else if (presence() == OPTIONAL)
107107
{
108108
if (null != encodedDataType && null != encodedDataType.nullValue())
109109
{

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ public String timeUnit()
183183

184184
public String toString()
185185
{
186-
return "Field{" +
187-
"name='" + name + '\'' +
186+
return
187+
"Field{name='" + name + '\'' +
188188
", description='" + description + '\'' +
189189
", id=" + id +
190190
", type=" + type +

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,7 @@ public String headerType()
150150
return headerType;
151151
}
152152

153-
private List<Field> parseFieldsAndGroups(final Node node)
154-
throws XPathExpressionException
153+
private List<Field> parseFieldsAndGroups(final Node node) throws XPathExpressionException
155154
{
156155
final XPath xPath = XPathFactory.newInstance().newXPath();
157156
final NodeList list = (NodeList)xPath.compile(FIELD_OR_GROUP_OR_DATA_EXPR).evaluate(node, XPathConstants.NODESET);

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ public class SetType extends Type
4646
* @throws XPathExpressionException on invalid XPath.
4747
* @throws IllegalArgumentException on illegal encoding type.
4848
*/
49-
public SetType(final Node node)
50-
throws XPathExpressionException, IllegalArgumentException
49+
public SetType(final Node node) throws XPathExpressionException, IllegalArgumentException
5150
{
5251
super(node);
5352

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424
*/
2525
public abstract class Type
2626
{
27-
/** Default presence attribute for Types */
28-
public static final String DEFAULT_PRESENCE = "required";
29-
3027
private final String name;
3128
private final Presence presence;
3229
private final String description;

0 commit comments

Comments
 (0)