Skip to content

Commit 6b93039

Browse files
poms
1 parent 7bebded commit 6b93039

File tree

6 files changed

+11
-23
lines changed

6 files changed

+11
-23
lines changed

SerialX-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
<version>1.3.7</version>
1212

1313
<name>SerialX core</name>
14-
<description>Core of SerialX</description>
14+
<description>Core of SerialX. Contains core features and utilities shared across the library.</description>
1515
</project>

SerialX-core/src/main/java/org/ugp/serialx/converters/ProtocolConverter.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -190,23 +190,18 @@ public CharSequence toString(ParserRegistry myHomeRegistry, Object arg, Serializ
190190

191191
if (preferedProtocol != null || (preferedProtocol = (SerializationProtocol<Object>) getProtocolFor(arg, SerializationProtocol.MODE_SERIALIZE, args)) != null)
192192
{
193-
Object[] objArgs;
194193
Class<?> oldObjectClass = null;
195194
try
196195
{
197-
int tabs = 0, index = 0;
198-
if (args.length > 1 && args[1] instanceof Integer)
199-
tabs = (int) args[1];
200-
201-
if (args.length > 2 && args[2] instanceof Integer)
202-
index = (int) args[2];
196+
int tabs = args.length > 1 && args[1] instanceof Integer ? (int) args[1] : 0;
197+
int index = args.length > 2 && args[2] instanceof Integer ? (int) args[2] : 0;
203198

204199
if (args.length < 5)
205200
args = Arrays.copyOf(args, 5);
206201
oldObjectClass = (Class<?>) args[4];
207202
args[4] = arg.getClass();;
208203

209-
objArgs = preferedProtocol.serialize(arg);
204+
Object[] objArgs = preferedProtocol.serialize(arg);
210205
StringBuilder sb = new StringBuilder(ImportsProvider.getAliasFor(args.length > 0 ? args[0] : null, arg.getClass()) + (objArgs.length <= 0 ? "" : " "));
211206

212207
args = args.clone();
@@ -231,7 +226,7 @@ public CharSequence toString(ParserRegistry myHomeRegistry, Object arg, Serializ
231226
args[4] = oldObjectClass;
232227
return index > 0 && objArgs.length > 0 ? sb.insert(0, '{').append('}') : sb;
233228
}
234-
catch (Exception e)
229+
catch (Exception e)
235230
{
236231
LogProvider.instance.logErr("Exception while serializing instance of \"" + arg.getClass().getName() + "\":", e);
237232
e.printStackTrace();

SerialX-devtools/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<version>1.3.7</version>
1212

1313
<name>SerialX devtools</name>
14-
<description>Tools for debugging...</description>
14+
<description>Tools for debugging, mainly for Parser/Converter API. It is intended for DSL developers and people who want to add their own data formats.</description>
1515

1616
<dependencies>
1717
<dependency>

SerialX-json/src/main/java/org/ugp/serialx/json/JsonSerializer.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,7 @@ public <S extends Scope> S LoadFrom(Reader reader, Object... formatArgs)
177177
@Override
178178
public <A extends Appendable> A SerializeTo(A source, Object... args) throws IOException
179179
{
180-
int tabs = 0;
181-
if (args.length > 1 && args[1] instanceof Integer)
182-
tabs = (int) args[1];
180+
int tabs = args.length > 1 && args[1] instanceof Integer ? (int) args[1] : 0;
183181

184182
if (tabs == 0 && !(valuesCount() == 1 && variablesCount() <= 0 && get(0) instanceof Scope))
185183
{

SerialX-juss/src/main/java/org/ugp/serialx/juss/converters/ArrayConverter.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,11 @@ public CharSequence toString(ParserRegistry myHomeRegistry, Object obj, Object..
9090
{
9191
if (obj != null && myHomeRegistry != null && obj.getClass().isArray())
9292
{
93-
int tabs = 0, index = 0;
94-
if (args.length > 2 && args[2] instanceof Integer)
95-
index = (int) args[2];
93+
int index = args.length > 2 && args[2] instanceof Integer ? (int) args[2] : 0;
9694

9795
if (index <= 0 || myHomeRegistry.indexOf(OperationGroups.class) > -1)
9896
{
99-
if (args.length > 1 && args[1] instanceof Integer)
100-
tabs = (int) args[1];
97+
int tabs = args.length > 1 && args[1] instanceof Integer ? (int) args[1] : 0;
10198

10299
if (args.length > 2)
103100
{

SerialX-juss/src/main/java/org/ugp/serialx/juss/converters/VariableConverter.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,9 @@ public CharSequence toString(ParserRegistry myHomeRegistry, Object obj, Object..
132132
if (obj instanceof Entry)
133133
{
134134
Entry<?, ?> var = (Entry<?, ?>) obj;
135-
int tabs = 0;
136-
if (args.length > 1 && args[1] instanceof Integer)
137-
tabs = (int) args[1];
135+
int tabs = args.length > 1 && args[1] instanceof Integer ? (int) args[1] : 0;
138136

139-
boolean jsonStyle = isJsonStyle(), genericVar = false;
137+
boolean jsonStyle = isJsonStyle(), genericVar;
140138
Object key = (genericVar = !((key = var.getKey()) instanceof String)) ? myHomeRegistry.toString(key, args) : key, val = var.getValue();
141139
return new StringBuilder().append(jsonStyle && !genericVar ? "\""+key+"\"" : key)
142140
.append(val instanceof GenericScope && !((GenericScope<?, ?>) val).isEmpty() ? (jsonStyle ? " : " : " =\n" + multilpy('\t', tabs)) : (jsonStyle ? " : " : " = "))

0 commit comments

Comments
 (0)