Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
d45494b4
Commit
d45494b4
authored
Sep 13, 2021
by
Piotr Gawron
Browse files
curly braces are required in for/if statements
parent
d7d2e99a
Pipeline
#46991
failed with stage
in 63 minutes and 39 seconds
Changes
27
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/ElementAnnotator.java
View file @
d45494b4
...
...
@@ -158,7 +158,7 @@ public abstract class ElementAnnotator extends CachableInterface {
*/
public
List
<
Class
<?
extends
BioEntity
>>
getValidClasses
()
{
return
validClasses
;
}
;
}
/**
* Returns <code>true</code> if this annotator can annotate the object given in
...
...
annotation/src/test/java/lcsb/mapviewer/annotation/AnnotationTestFunctions.java
View file @
d45494b4
...
...
@@ -203,8 +203,9 @@ public abstract class AnnotationTestFunctions extends AbstractTransactionalJUnit
}
protected
String
nodeToString
(
Node
node
,
boolean
includeHeadNode
)
{
if
(
node
==
null
)
if
(
node
==
null
)
{
return
null
;
}
StringWriter
sw
=
new
StringWriter
();
try
{
Transformer
t
=
TransformerFactory
.
newInstance
().
newTransformer
();
...
...
annotation/src/test/java/lcsb/mapviewer/annotation/services/MiriamConnectorTest.java
View file @
d45494b4
...
...
@@ -96,8 +96,9 @@ public class MiriamConnectorTest extends AnnotationTestFunctions {
boolean
deprecated
=
false
;
try
{
Field
f
=
MiriamType
.
class
.
getField
(
mt
.
name
());
if
(
f
.
isAnnotationPresent
(
Deprecated
.
class
))
if
(
f
.
isAnnotationPresent
(
Deprecated
.
class
))
{
deprecated
=
true
;
}
}
catch
(
NoSuchFieldException
|
SecurityException
e
)
{
}
...
...
annotation/src/test/java/lcsb/mapviewer/annotation/services/ModelAnnotatorTest.java
View file @
d45494b4
...
...
@@ -127,10 +127,11 @@ public class ModelAnnotatorTest extends AnnotationTestFunctions {
modelAnnotator
.
copyAnnotationFromOtherSpecies
(
model
,
updater
);
for
(
Species
element
:
model
.
getSpeciesList
())
{
if
(
element
.
getName
().
equals
(
"s4"
))
if
(
element
.
getName
().
equals
(
"s4"
))
{
assertEquals
(
0
,
element
.
getMiriamData
().
size
());
else
if
(
element
.
getName
().
equals
(
"hello"
))
}
else
if
(
element
.
getName
().
equals
(
"hello"
))
{
assertEquals
(
1
,
element
.
getMiriamData
().
size
());
}
}
}
...
...
checkstyle.xml
View file @
d45494b4
...
...
@@ -70,7 +70,7 @@
<property
name=
"tokens"
value=
"LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"
/>
</module>
<!--
<module name="NeedBraces">
<module
name=
"NeedBraces"
>
<property
name=
"tokens"
value=
"LITERAL_DO, LITERAL_ELSE, LITERAL_FOR, LITERAL_IF, LITERAL_WHILE"
/>
</module>
...
...
@@ -95,7 +95,7 @@
value=
"CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT,
INSTANCE_INIT, ANNOTATION_DEF, ENUM_DEF"
/>
</module>
<module name="WhitespaceAround">
<!--
<module name="WhitespaceAround">
<property name="allowEmptyConstructors" value="true"/>
<property name="allowEmptyLambdas" value="true"/>
<property name="allowEmptyMethods" value="true"/>
...
...
commons/src/test/java/lcsb/mapviewer/common/XmlParserTest.java
View file @
d45494b4
...
...
@@ -121,8 +121,9 @@ public class XmlParserTest extends CommonTestFunctions {
@Test
public
void
testConcurrencyParse
()
throws
Exception
{
StringBuilder
builder
=
new
StringBuilder
(
"<doc>"
);
for
(
int
i
=
0
;
i
<
30000
;
i
++)
for
(
int
i
=
0
;
i
<
30000
;
i
++)
{
builder
.
append
(
"<test_node>test_x</test_node>"
);
}
builder
.
append
(
"</doc>"
);
final
String
xml
=
builder
.
toString
();
threadSucceded
=
false
;
...
...
converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/annotation/RestAnnotationParser.java
View file @
d45494b4
...
...
@@ -921,8 +921,9 @@ public class RestAnnotationParser {
boolean
isFieldAnnotated
(
NoteField
field
,
Class
<?
extends
Annotation
>
annotationClass
)
{
try
{
Field
f
=
field
.
getClass
().
getField
(
field
.
name
());
if
(
f
.
isAnnotationPresent
(
annotationClass
))
if
(
f
.
isAnnotationPresent
(
annotationClass
))
{
return
true
;
}
}
catch
(
NoSuchFieldException
|
SecurityException
e
)
{
}
return
false
;
...
...
converter-CellDesigner/src/main/java/lcsb/mapviewer/converter/model/celldesigner/reaction/ReactionCollectionXmlParser.java
View file @
d45494b4
...
...
@@ -111,8 +111,9 @@ public class ReactionCollectionXmlParser {
for
(
Reaction
reaction
:
collection
)
{
boolean
reactionToCompartment
=
false
;
for
(
ReactionNode
node
:
reaction
.
getReactionNodes
())
{
if
(
node
.
getElement
()
instanceof
Compartment
)
if
(
node
.
getElement
()
instanceof
Compartment
)
{
reactionToCompartment
=
true
;
}
}
if
(
reactionToCompartment
)
{
logger
.
warn
(
new
LogMarker
(
ProjectLogEntryType
.
EXPORT_ISSUE
,
reaction
),
...
...
converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/CellDesignerTestFunctions.java
View file @
d45494b4
...
...
@@ -165,8 +165,9 @@ public abstract class CellDesignerTestFunctions {
}
protected
String
nodeToString
(
Node
node
,
boolean
includeHeadNode
)
{
if
(
node
==
null
)
if
(
node
==
null
)
{
return
null
;
}
StringWriter
sw
=
new
StringWriter
();
try
{
Transformer
t
=
TransformerFactory
.
newInstance
().
newTransformer
();
...
...
converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/alias/AliasCollectionXmlParserTest.java
View file @
d45494b4
...
...
@@ -66,14 +66,18 @@ public class AliasCollectionXmlParserTest extends CellDesignerTestFunctions {
Species
aliasSa10
=
null
;
Species
aliasSa11
=
null
;
for
(
Species
alias
:
list
)
{
if
(
alias
.
getElementId
().
equals
(
"sa8"
))
if
(
alias
.
getElementId
().
equals
(
"sa8"
))
{
aliasSa8
=
alias
;
if
(
alias
.
getElementId
().
equals
(
"sa9"
))
}
if
(
alias
.
getElementId
().
equals
(
"sa9"
))
{
aliasSa9
=
alias
;
if
(
alias
.
getElementId
().
equals
(
"sa10"
))
}
if
(
alias
.
getElementId
().
equals
(
"sa10"
))
{
aliasSa10
=
alias
;
if
(
alias
.
getElementId
().
equals
(
"sa11"
))
}
if
(
alias
.
getElementId
().
equals
(
"sa11"
))
{
aliasSa11
=
alias
;
}
}
assertNotNull
(
aliasSa8
);
assertNotNull
(
aliasSa9
);
...
...
@@ -165,12 +169,15 @@ public class AliasCollectionXmlParserTest extends CellDesignerTestFunctions {
Complex
aliasSa2
=
null
;
Complex
aliasSa3
=
null
;
for
(
Complex
alias
:
list
)
{
if
(
alias
.
getElementId
().
equals
(
"csa1"
))
if
(
alias
.
getElementId
().
equals
(
"csa1"
))
{
aliasSa1
=
alias
;
if
(
alias
.
getElementId
().
equals
(
"csa2"
))
}
if
(
alias
.
getElementId
().
equals
(
"csa2"
))
{
aliasSa2
=
alias
;
if
(
alias
.
getElementId
().
equals
(
"csa3"
))
}
if
(
alias
.
getElementId
().
equals
(
"csa3"
))
{
aliasSa3
=
alias
;
}
}
assertNotNull
(
aliasSa1
);
assertNotNull
(
aliasSa2
);
...
...
@@ -196,12 +203,15 @@ public class AliasCollectionXmlParserTest extends CellDesignerTestFunctions {
Complex
aliasSa2
=
null
;
Complex
aliasSa3
=
null
;
for
(
Complex
alias
:
list
)
{
if
(
alias
.
getElementId
().
equals
(
"csa1"
))
if
(
alias
.
getElementId
().
equals
(
"csa1"
))
{
aliasSa1
=
alias
;
if
(
alias
.
getElementId
().
equals
(
"csa2"
))
}
if
(
alias
.
getElementId
().
equals
(
"csa2"
))
{
aliasSa2
=
alias
;
if
(
alias
.
getElementId
().
equals
(
"csa3"
))
}
if
(
alias
.
getElementId
().
equals
(
"csa3"
))
{
aliasSa3
=
alias
;
}
}
assertNotNull
(
aliasSa1
);
assertNotNull
(
aliasSa2
);
...
...
@@ -243,12 +253,15 @@ public class AliasCollectionXmlParserTest extends CellDesignerTestFunctions {
Compartment
aliasCa2
=
null
;
Compartment
aliasCa3
=
null
;
for
(
Compartment
alias
:
list
)
{
if
(
alias
.
getElementId
().
equals
(
"ca1"
))
if
(
alias
.
getElementId
().
equals
(
"ca1"
))
{
aliasCa1
=
alias
;
if
(
alias
.
getElementId
().
equals
(
"ca2"
))
}
if
(
alias
.
getElementId
().
equals
(
"ca2"
))
{
aliasCa2
=
alias
;
if
(
alias
.
getElementId
().
equals
(
"ca3"
))
}
if
(
alias
.
getElementId
().
equals
(
"ca3"
))
{
aliasCa3
=
alias
;
}
}
assertNotNull
(
aliasCa1
);
assertNotNull
(
aliasCa2
);
...
...
converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/reaction/ReactionParserTests.java
View file @
d45494b4
...
...
@@ -239,8 +239,9 @@ public class ReactionParserTests extends CellDesignerTestFunctions {
assertEquals
(
1
,
reactant
.
getLine
().
getLines
().
size
());
NodeOperator
operator
=
null
;
for
(
NodeOperator
operator2
:
reaction
.
getOperators
())
{
if
(
operator2
instanceof
SplitOperator
)
if
(
operator2
instanceof
SplitOperator
)
{
operator
=
operator2
;
}
}
assertEquals
(
LineType
.
DASH_DOT_DOT
,
operator
.
getLine
().
getType
());
...
...
@@ -361,8 +362,9 @@ public class ReactionParserTests extends CellDesignerTestFunctions {
assertEquals
(
2
,
model
.
getReactions
().
size
());
Reaction
reaction
=
null
;
for
(
Reaction
reaction2
:
model
.
getReactions
())
{
if
(
reaction2
.
getIdReaction
().
equals
(
"re1"
))
if
(
reaction2
.
getIdReaction
().
equals
(
"re1"
))
{
reaction
=
reaction2
;
}
}
assertTrue
(
reaction
instanceof
DissociationReaction
);
assertEquals
(
1
,
reaction
.
getReactants
().
size
());
...
...
@@ -396,8 +398,9 @@ public class ReactionParserTests extends CellDesignerTestFunctions {
assertEquals
(
2
,
model
.
getReactions
().
size
());
Reaction
reaction
=
null
;
for
(
Reaction
reaction2
:
model
.
getReactions
())
{
if
(
reaction2
.
getIdReaction
().
equals
(
"re1"
))
if
(
reaction2
.
getIdReaction
().
equals
(
"re1"
))
{
reaction
=
reaction2
;
}
}
assertTrue
(
reaction
instanceof
DissociationReaction
);
assertEquals
(
2
,
reaction
.
getReactants
().
size
());
...
...
@@ -548,10 +551,12 @@ public class ReactionParserTests extends CellDesignerTestFunctions {
Reaction
reaction1
=
null
;
Reaction
reaction2
=
null
;
for
(
Reaction
reaction
:
model
.
getReactions
())
{
if
(
reaction
.
getIdReaction
().
equals
(
"re2"
))
if
(
reaction
.
getIdReaction
().
equals
(
"re2"
))
{
reaction1
=
reaction
;
if
(
reaction
.
getIdReaction
().
equals
(
"re3"
))
}
if
(
reaction
.
getIdReaction
().
equals
(
"re3"
))
{
reaction2
=
reaction
;
}
}
Reactant
reactant
=
reaction1
.
getReactants
().
get
(
0
);
Element
alias1
=
reaction1
.
getReactants
().
get
(
0
).
getElement
();
...
...
@@ -577,8 +582,9 @@ public class ReactionParserTests extends CellDesignerTestFunctions {
Model
model
=
getModelForFile
(
"testFiles/reactions/problemWithAnchors3.xml"
);
Reaction
reaction
=
null
;
for
(
Reaction
reaction2
:
model
.
getReactions
())
{
if
(
reaction2
.
getIdReaction
().
equals
(
"re3"
))
if
(
reaction2
.
getIdReaction
().
equals
(
"re3"
))
{
reaction
=
reaction2
;
}
}
Point2D
point
=
new
Point2D
.
Double
(
164.85583789974368
,
86.060142902597
);
Point2D
point2
=
new
Point2D
.
Double
(
397.06477630152193
,
284.99999999999994
);
...
...
converter-CellDesigner/src/test/java/lcsb/mapviewer/converter/model/celldesigner/species/SpeciesCollectionXmlParserTest.java
View file @
d45494b4
...
...
@@ -257,10 +257,12 @@ public class SpeciesCollectionXmlParserTest extends CellDesignerTestFunctions {
int
complexes
=
0
;
int
proteins
=
0
;
for
(
Pair
<
String
,
?
extends
CellDesignerSpecies
<?>>
species
:
list
)
{
if
(
species
.
getRight
()
instanceof
CellDesignerComplexSpecies
)
if
(
species
.
getRight
()
instanceof
CellDesignerComplexSpecies
)
{
complexes
++;
if
(
species
.
getRight
()
instanceof
CellDesignerProtein
)
}
if
(
species
.
getRight
()
instanceof
CellDesignerProtein
)
{
proteins
++;
}
}
assertEquals
(
1
,
complexes
);
assertEquals
(
2
,
proteins
);
...
...
converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/bioEntity/element/compartment/CompartmentConverter.java
View file @
d45494b4
...
...
@@ -82,7 +82,7 @@ public abstract class CompartmentConverter<T extends Compartment> extends Elemen
*/
protected
CompartmentConverter
(
ColorExtractor
colorExtractor
)
{
super
(
colorExtractor
);
}
;
}
/**
* @return the alphaLevel
...
...
converter-graphics/src/main/java/lcsb/mapviewer/converter/graphics/bioEntity/element/species/SpeciesConverter.java
View file @
d45494b4
...
...
@@ -123,7 +123,7 @@ public abstract class SpeciesConverter<T extends Species> extends ElementConvert
*/
protected
SpeciesConverter
(
ColorExtractor
colorExtractor
)
{
super
(
colorExtractor
);
}
;
}
/**
* Returns default shape of the {@link Species}.
...
...
converter/src/test/java/lcsb/mapviewer/converter/ConverterTestFunctions.java
View file @
d45494b4
...
...
@@ -142,8 +142,9 @@ public abstract class ConverterTestFunctions {
}
protected
String
nodeToString
(
Node
node
,
boolean
includeHeadNode
)
{
if
(
node
==
null
)
if
(
node
==
null
)
{
return
null
;
}
StringWriter
sw
=
new
StringWriter
();
try
{
Transformer
t
=
TransformerFactory
.
newInstance
().
newTransformer
();
...
...
model/src/main/java/lcsb/mapviewer/model/security/Privilege.java
View file @
d45494b4
...
...
@@ -62,10 +62,12 @@ public class Privilege implements Serializable {
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
if
(
this
==
o
)
{
return
true
;
if
(!(
o
instanceof
Privilege
))
}
if
(!(
o
instanceof
Privilege
))
{
return
false
;
}
Privilege
that
=
(
Privilege
)
o
;
return
type
==
that
.
type
&&
Objects
.
equals
(
objectId
,
that
.
objectId
);
...
...
model/src/test/java/lcsb/mapviewer/model/map/MiriamTypeGenericTest.java
View file @
d45494b4
...
...
@@ -53,8 +53,9 @@ public class MiriamTypeGenericTest extends ModelTestFunctions {
boolean
deprecated
=
false
;
try
{
Field
f
=
MiriamType
.
class
.
getField
(
mt
.
name
());
if
(
f
.
isAnnotationPresent
(
clazz
))
if
(
f
.
isAnnotationPresent
(
clazz
))
{
deprecated
=
true
;
}
}
catch
(
NoSuchFieldException
|
SecurityException
e
)
{
}
return
deprecated
;
...
...
model/src/test/java/lcsb/mapviewer/modelutils/map/ElementUtilsTest.java
View file @
d45494b4
...
...
@@ -86,8 +86,9 @@ public class ElementUtilsTest extends ModelTestFunctions {
throw
new
InvalidArgumentException
();
}
String
tmp
=
""
;
for
(
int
i
=
0
;
i
<
indent
;
i
++)
for
(
int
i
=
0
;
i
<
indent
;
i
++)
{
tmp
+=
" "
;
}
logger
.
debug
(
tmp
+
top
.
getCommonName
());
for
(
ClassTreeNode
node
:
top
.
getChildren
())
{
print
(
node
,
indent
+
1
);
...
...
pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/ModelContructor.java
View file @
d45494b4
...
...
@@ -1129,8 +1129,9 @@ public class ModelContructor {
Integer
result
=
null
;
for
(
Species
species
:
allChildren
)
{
if
(
species
.
getZ
()
!=
null
)
{
if
(
result
==
null
)
if
(
result
==
null
)
{
result
=
species
.
getZ
();
}
result
=
Math
.
min
(
result
,
species
.
getZ
());
}
}
...
...
pathvisio/src/main/java/lcsb/mapviewer/wikipathway/XML/ReactionLayoutFinder.java
View file @
d45494b4
...
...
@@ -333,8 +333,9 @@ class ReactionLayoutFinder {
private
boolean
pointOnPolyline
(
PolylineData
line
,
Point2D
point
)
{
// point cannot be on the edge
if
(
line
.
getStartPoint
().
distance
(
point
)
<=
Configuration
.
EPSILON
||
line
.
getEndPoint
().
distance
(
point
)
<=
Configuration
.
EPSILON
)
line
.
getEndPoint
().
distance
(
point
)
<=
Configuration
.
EPSILON
)
{
return
false
;
}
for
(
Line2D
l
:
line
.
getLines
())
{
if
(
lt
.
distBetweenPointAndLineSegment
(
l
,
point
)
<=
Configuration
.
EPSILON
)
{
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment