Commit 09221ef7 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

operators should not be the last token in line

parent ee3ebaf0
......@@ -21,15 +21,14 @@ public class CdPluginFunctions {
public UnitTestFailedWatcher unitTestFailedWatcher = new UnitTestFailedWatcher();
String rdfString = "<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:vCard=\"http://www.w3.org/2001/vcard-rdf/3.0#\" xmlns:bqbiol=\"http://biomodels.net/biology-qualifiers/\" xmlns:bqmodel=\"http://biomodels.net/model-qualifiers/\">\n"
+
"<rdf:Description rdf:about=\"#s3\">\n" +
"<bqmodel:is>\n" +
"<rdf:Bag>\n" +
"<rdf:li rdf:resource=\"urn:miriam:wikipedia.en:1\"/>\n" +
"</rdf:Bag>\n" +
"</bqmodel:is>\n" +
"</rdf:Description>\n" +
"</rdf:RDF>\n";
+ "<rdf:Description rdf:about=\"#s3\">\n"
+ "<bqmodel:is>\n"
+ "<rdf:Bag>\n"
+ "<rdf:li rdf:resource=\"urn:miriam:wikipedia.en:1\"/>\n"
+ "</rdf:Bag>\n"
+ "</bqmodel:is>\n"
+ "</rdf:Description>\n"
+ "</rdf:RDF>\n";
private MinervaLoggerAppender appender;
......
......@@ -93,8 +93,8 @@ public class ChemicalSerializer extends JsonSerializer<Chemical> {
}
private void writeField(final JsonGenerator gen, final String field, final Object value, final PropertyFilter filter) throws IOException {
if (filter == null ||
(filter instanceof CustomExceptFilter && ((CustomExceptFilter) filter).includeField(field))) {
if (filter == null
|| (filter instanceof CustomExceptFilter && ((CustomExceptFilter) filter).includeField(field))) {
gen.writeObjectField(field, value);
}
}
......
......@@ -56,8 +56,8 @@ public class DrugSerializer extends JsonSerializer<Drug> {
}
private void writeField(final JsonGenerator gen, final String field, final Object value, final PropertyFilter filter) throws IOException {
if (filter == null ||
(filter instanceof CustomExceptFilter && ((CustomExceptFilter) filter).includeField(field))) {
if (filter == null
|| (filter instanceof CustomExceptFilter && ((CustomExceptFilter) filter).includeField(field))) {
gen.writeObjectField(field, value);
}
}
......
......@@ -50,8 +50,8 @@ public class MiRNASerializer extends JsonSerializer<MiRNA> {
}
private void writeField(final JsonGenerator gen, final String field, final Object value, final PropertyFilter filter) throws IOException {
if (filter == null ||
(filter instanceof CustomExceptFilter && ((CustomExceptFilter) filter).includeField(field))) {
if (filter == null
|| (filter instanceof CustomExceptFilter && ((CustomExceptFilter) filter).includeField(field))) {
gen.writeObjectField(field, value);
}
}
......
......@@ -478,8 +478,8 @@ public abstract class ElementAnnotator extends CachableInterface {
if (oldValue == null || oldValue.trim().equals("") || oldValue.equals(newValue)) {
return true;
} else {
logger.warn(getLogMarker(ProjectLogEntryType.ANNOTATION_CONFLICT), field.getCommonName() +
" doesn't match: \"" + newValue + "\", \"" + oldValue + "\"");
logger.warn(getLogMarker(ProjectLogEntryType.ANNOTATION_CONFLICT), field.getCommonName()
+ " doesn't match: \"" + newValue + "\", \"" + oldValue + "\"");
return false;
}
}
......
......@@ -143,8 +143,8 @@ public class ChemicalParser {
String content = dapiConnector
.getAuthenticatedContent(
url + "/drugs/?size=1000&columns=sourceIdentifier&target_identifier="
+ URLEncoder.encode(t.getPrefixedIdentifier(), "UTF-8") +
"&target_disease_identifier=" + URLEncoder.encode(disease.getPrefixedIdentifier(), "UTF-8"));
+ URLEncoder.encode(t.getPrefixedIdentifier(), "UTF-8")
+ "&target_disease_identifier=" + URLEncoder.encode(disease.getPrefixedIdentifier(), "UTF-8"));
ListChemicalEntityDto dto = objectMapper.readValue(content, ListChemicalEntityDto.class);
......
......@@ -234,7 +234,7 @@
value="COMMA, SEMI, POST_INC, POST_DEC, DOT, ELLIPSIS, METHOD_REF"/>
<property name="allowLineBreaks" value="true"/>
</module>
<!-- <module name="ParenPad">
<module name="ParenPad">
<property name="tokens"
value="ANNOTATION, ANNOTATION_FIELD_DEF, CTOR_CALL, CTOR_DEF, DOT, ENUM_CONSTANT_DEF,
EXPR, LITERAL_CATCH, LITERAL_DO, LITERAL_FOR, LITERAL_IF, LITERAL_NEW,
......@@ -247,7 +247,7 @@
value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR,
LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR, METHOD_REF "/>
</module>
<module name="AnnotationLocation">
<!-- <module name="AnnotationLocation">
<property name="id" value="AnnotationLocationMostCases"/>
<property name="tokens"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
......
......@@ -28,11 +28,11 @@ public class TextFileUtilsTest extends CommonTestFunctions {
@Test
public void testGetHeaderParametersFromFile() throws Exception {
String fileContent = "#header\n" +
"#param1=value1\n" +
"#\n" +
"no header\n" +
"#param2=value\n";
String fileContent = "#header\n"
+ "#param1=value1\n"
+ "#\n"
+ "no header\n"
+ "#param2=value\n";
Map<String, String> params = TextFileUtils
.getHeaderParametersFromFile(new ByteArrayInputStream(fileContent.getBytes(StandardCharsets.UTF_8)));
......
......@@ -130,8 +130,8 @@ public abstract class AbstractCellDesignerAliasConverter<T extends Element> impl
}
/**
* This method computes coordinates that should be associated with the angle on
* the border of the alias.
* This method computes coordinates that should be associated with the angle
* on the border of the alias.
*
* @param alias
* alias to be investigated
......@@ -230,8 +230,8 @@ public abstract class AbstractCellDesignerAliasConverter<T extends Element> impl
double minDist = Math.min(Math.min(distanceLeft, distanceRight), Math.min(distanceTop, distanceBottom));
if (distanceRight == minDist &&
pointOnBorder.getY() - element.getY() - element.getHeight() / 2 < epsilon) {
if (distanceRight == minDist
&& pointOnBorder.getY() - element.getY() - element.getHeight() / 2 < epsilon) {
double ratio = 1 - (pointOnBorder.getY() - element.getY()) / element.getHeight();
result = (ratio - 0.5) * (PI / 2);
} else if (distanceTop == minDist) {
......@@ -243,8 +243,8 @@ public abstract class AbstractCellDesignerAliasConverter<T extends Element> impl
} else if (distanceBottom == minDist) {
double ratio = (pointOnBorder.getX() - element.getX()) / element.getWidth();
result = ratio * (PI / 2) + LEFT_RESIDUE_MAX_ANGLE;
} else if (distanceRight == minDist &&
pointOnBorder.getY() - element.getY() - element.getHeight() < epsilon) {
} else if (distanceRight == minDist
&& pointOnBorder.getY() - element.getY() - element.getHeight() < epsilon) {
double ratio = 1 - (pointOnBorder.getY() - element.getY()) / element.getHeight();
result = ratio * (PI / 2) + BOTTOM_RESIDUE_MAX_ANGLE;
} else {
......@@ -280,7 +280,6 @@ public abstract class AbstractCellDesignerAliasConverter<T extends Element> impl
throw new NotImplementedException("Not implemented for: " + this.getClass());
}
/**
* This method returns border of the alias as a PathIterator.
*
......@@ -385,8 +384,8 @@ public abstract class AbstractCellDesignerAliasConverter<T extends Element> impl
* @param elemnt
* {@link Element} on border which the point is looked for
* @param angle
* angle between X axis center point of {@link Species} and point that
* we are looking for
* angle between X axis center point of {@link Species} and point
* that we are looking for
* @return coordinates on the {@link Species} border that correspond to the
* angle
*/
......
......@@ -67,7 +67,7 @@ public abstract class CellDesignerTestFunctions {
private static int BLOCK_SIZE = 65536;
protected static double EPSILON = Configuration.EPSILON;
@Rule
public UnitTestFailedWatcher unitTestFailedWatcher = new UnitTestFailedWatcher();
private Logger logger = LogManager.getLogger();
......@@ -261,10 +261,10 @@ public abstract class CellDesignerTestFunctions {
// import of unbounded compartments is problematic
for (final Compartment compartment : model.getCompartments()) {
if (compartment instanceof BottomSquareCompartment ||
compartment instanceof TopSquareCompartment ||
compartment instanceof LeftSquareCompartment ||
compartment instanceof RightSquareCompartment) {
if (compartment instanceof BottomSquareCompartment
|| compartment instanceof TopSquareCompartment
|| compartment instanceof LeftSquareCompartment
|| compartment instanceof RightSquareCompartment) {
model2.getElementByElementId(compartment.getElementId()).setWidth(compartment.getWidth());
model2.getElementByElementId(compartment.getElementId()).setHeight(compartment.getHeight());
}
......
......@@ -283,13 +283,13 @@ public class RestAnnotationParserTest extends CellDesignerTestFunctions {
public void testGetNotesWithMissingBody() throws Exception {
RestAnnotationParser rap = new RestAnnotationParser();
Node node = super.getNodeFromXmlString("<celldesigner:notes>\n" +
" <html xmlns=\"http://www.w3.org/1999/xhtml\">\n" +
" <head>\n" +
" <title/>\n" +
" </head>\n" +
" </html>\n" +
" </celldesigner:notes>");
Node node = super.getNodeFromXmlString("<celldesigner:notes>\n"
+ " <html xmlns=\"http://www.w3.org/1999/xhtml\">\n"
+ " <head>\n"
+ " <title/>\n"
+ " </head>\n"
+ " </html>\n"
+ " </celldesigner:notes>");
String notes = rap.getNotes(node);
assertNotNull(notes);
}
......@@ -298,18 +298,18 @@ public class RestAnnotationParserTest extends CellDesignerTestFunctions {
public void testGetNotesWithLinkInside() throws Exception {
RestAnnotationParser rap = new RestAnnotationParser();
Node node = super.getNodeFromXmlString("<notes>\n" +
"Name: L-cystine\n" +
"Synonyms: (R,R)-3,3&apos;-dithiobis(2-aminopropanoic acid), "
Node node = super.getNodeFromXmlString("<notes>\n"
+ "Name: L-cystine\n"
+ "Synonyms: (R,R)-3,3&apos;-dithiobis(2-aminopropanoic acid), "
+ "(R-(R*,R*))-3,3&apos;-Dithiobis(2-aminopropanoic acid), "
+ "3,3&apos;-Dithiobis-L-alanine, beta,beta&apos;-diamino-beta,beta&apos;-dicarboxydiethyl disulfide, "
+ "beta,beta&apos;-dithiodialanine, bis(beta-amino-beta-carboxyethyl) disulfide, E921, "
+ "L-alpha-Diamino-beta-dithiolactic acid, L-Cystine, L-Dicysteine, oxidized L-cysteine, final Recon metabolite: mma\n"
+ "Description: VMH database: <a xmlns=\"http://www.w3.org/1999/xhtml\" href=\"http://vmh.uni.lu/#metabolite/mma\">mma</a>\n"
+ "SemanticZoomLevelVisibility: 5\n" +
"Charge: 0\n" +
"</notes>\n" +
"");
+ "SemanticZoomLevelVisibility: 5\n"
+ "Charge: 0\n"
+ "</notes>\n"
+ "");
String notes = rap.getNotes(node);
assertFalse(notes.contains("http://www.w3.org/1999/xhtml"));
}
......
......@@ -1003,8 +1003,8 @@ public class SbgnmlXmlExporter {
arcList.add(getArcFromNode(node, glyphList));
} catch (final InvalidArgumentException ex) {
logger.warn(new LogMarker(ProjectLogEntryType.EXPORT_ISSUE, node),
new ElementUtils().getElementTag(node.getElement()) +
"Node skipped in export process, since it is not compliant with SBGN-ML format.");
new ElementUtils().getElementTag(node.getElement())
+ "Node skipped in export process, since it is not compliant with SBGN-ML format.");
continue;
}
}
......
......@@ -1722,8 +1722,8 @@ public class SbgnmlXmlParser {
Product firstProduct = reaction.getProducts().get(0);
boolean shouldReverse = reaction.getProducts().size() > 1;
for (final Product product : reaction.getProducts()) {
if (product.getLine().getStartPoint().distance(firstProduct.getLine().getStartPoint()) < Configuration.EPSILON &&
product.getLine().getEndPoint().distance(firstProduct.getLine().getEndPoint()) > Configuration.EPSILON) {
if (product.getLine().getStartPoint().distance(firstProduct.getLine().getStartPoint()) < Configuration.EPSILON
&& product.getLine().getEndPoint().distance(firstProduct.getLine().getEndPoint()) > Configuration.EPSILON) {
shouldReverse = false;
}
}
......
......@@ -107,11 +107,11 @@ public class ConverterParams {
@Override
public String toString() {
String result = "[" + this.getClass().getSimpleName() + "] " +
"level:" + level + "," +
"scale:" + scale + "," +
"nested:" + nested + "," +
"sbgnFormat:" + sbgnFormat;
String result = "[" + this.getClass().getSimpleName() + "] "
+ "level:" + level + ","
+ "scale:" + scale + ","
+ "nested:" + nested + ","
+ "sbgnFormat:" + sbgnFormat;
return result;
}
......
......@@ -95,8 +95,8 @@ public abstract class SbmlBioEntityExporter<T extends BioEntity, S extends org.s
}
sbmlElementByElementId.put(getElementId(bioEntity), sbmlElement);
} catch (final Exception e) {
throw new InconsistentModelException(new ElementUtils().getElementTag(bioEntity) +
"Problem with exporting bioEntity", e);
throw new InconsistentModelException(new ElementUtils().getElementTag(bioEntity)
+ "Problem with exporting bioEntity", e);
}
}
if (isExtensionEnabled(SbmlExtension.LAYOUT)) {
......@@ -106,8 +106,8 @@ public abstract class SbmlBioEntityExporter<T extends BioEntity, S extends org.s
AbstractReferenceGlyph elementGlyph = createGlyph(bioEntity);
sbmlGlyphByElementId.put(getElementId(bioEntity), elementGlyph);
} catch (final Exception e) {
throw new InconsistentModelException(new ElementUtils().getElementTag(bioEntity) +
"Problem with exporting bioEntity", e);
throw new InconsistentModelException(new ElementUtils().getElementTag(bioEntity)
+ "Problem with exporting bioEntity", e);
}
}
}
......
......@@ -288,8 +288,8 @@ public class SbmlParser extends Converter {
private void checkAvailableExtensions(final org.sbml.jsbml.Model sbmlModel) {
if (sbmlModel.getExtensionCount() > 0) {
for (final SBasePlugin plugin : sbmlModel.getExtensionPackages().values()) {
if (!plugin.getClass().equals(LayoutModelPlugin.class) &&
!plugin.getClass().equals(MultiModelPlugin.class)) {
if (!plugin.getClass().equals(LayoutModelPlugin.class)
&& !plugin.getClass().equals(MultiModelPlugin.class)) {
logger.warn("Unknown sbml plugin: " + plugin);
}
}
......
......@@ -126,7 +126,8 @@ public class SbmlReactionParser extends SbmlBioEntityParser {
try {
Map<ReactionNode, SpeciesReferenceGlyph> glyphByNode = new HashMap<>();
Reaction reactionWithLayout = source.copy();
// getId doesn't have to be unique, therefore we concatenate with reaction
// getId doesn't have to be unique, therefore we concatenate with
// reaction
reactionWithLayout.setIdReaction(glyph.getReaction() + "__" + glyph.getId());
// z index
......@@ -280,7 +281,8 @@ public class SbmlReactionParser extends SbmlBioEntityParser {
for (final Reaction reaction : reactions) {
if (!used.contains(reaction)) {
for (final ReactionNode node : reaction.getReactionNodes()) {
// we might have different elements here, the reason is that single SBML species
// we might have different elements here, the reason is that single
// SBML species
// can be split into two or more (due to layout)
node.setElement(speciesParser.getAnyElementBySbmlElementId(node.getElement().getElementId()));
}
......@@ -330,8 +332,8 @@ public class SbmlReactionParser extends SbmlBioEntityParser {
PolylineData line = new PolylineData();
reaction.setLine(line);
// if there is no layout don't create center line
if (startNode.getLine() != null && startNode.getLine().length() > Configuration.EPSILON &&
endNode.getLine() != null && endNode.getLine().length() > Configuration.EPSILON) {
if (startNode.getLine() != null && startNode.getLine().length() > Configuration.EPSILON
&& endNode.getLine() != null && endNode.getLine().length() > Configuration.EPSILON) {
startNode.getLine().trimEnd(ReactionCellDesignerConverter.RECT_SIZE);
endNode.getLine().trimBegin(ReactionCellDesignerConverter.RECT_SIZE);
......@@ -409,9 +411,10 @@ public class SbmlReactionParser extends SbmlBioEntityParser {
}
/**
* Extracts {@link Curve} associated to {@link ReactionGlyph}. If curve doesn't
* exist then method will try to create it from {@link BoundingBox} (due to SBML
* specification). This {@link Curve} is split into parts belonging to:
* Extracts {@link Curve} associated to {@link ReactionGlyph}. If curve
* doesn't exist then method will try to create it from {@link BoundingBox}
* (due to SBML specification). This {@link Curve} is split into parts
* belonging to:
* <ul>
* <li>input operator</li>
* <li>center line</li>
......@@ -421,9 +424,9 @@ public class SbmlReactionParser extends SbmlBioEntityParser {
*
* @param reactionGlyph
* @param operator
* class of {@link NodeOperator} that requires the line (this line can
* be separated into 3 different segments - reactant, center, product
* parts)
* class of {@link NodeOperator} that requires the line (this line
* can be separated into 3 different segments - reactant, center,
* product parts)
* @return
*/
PolylineData extractCurve(final ReactionGlyph reactionGlyph, final Reaction reaction,
......@@ -517,20 +520,20 @@ public class SbmlReactionParser extends SbmlBioEntityParser {
}
PolylineData result = new PolylineData();
if (operator == TruncationOperator.class ||
operator == DissociationOperator.class ||
operator == SplitOperator.class) {
if (operator == TruncationOperator.class
|| operator == DissociationOperator.class
|| operator == SplitOperator.class) {
// Product operator
for (int i = productLineStarts; i < curve.getCurveSegmentCount(); i++) {
CurveSegment segment = curve.getCurveSegment(i);
CurveSegment segment = curve.getCurveSegment(i);
result.addLine(segment.getStart().getX(), segment.getStart().getY(),
segment.getEnd().getX(), segment.getEnd().getY());
}
} else if (operator == AssociationOperator.class || operator == AndOperator.class) {
// Reactant operator
for (int i = 0; i < reactantLineEnds; i++) {
CurveSegment segment = curve.getCurveSegment(i);
CurveSegment segment = curve.getCurveSegment(i);
result.addLine(segment.getStart().getX(), segment.getStart().getY(), segment.getEnd().getX(), segment.getEnd().getY());
}
} else if (operator == null) {
......
......@@ -205,9 +205,9 @@ public class ColorSchemaReaderTest extends ConverterTestFunctions {
Map<String, String> params = new HashMap<>();
params.put(TextFileUtils.COLUMN_COUNT_PARAM, "3");
String input = "name\tcolor\tvalue\n" +
"s1\t#ff0000\t\n" +
"s2\t\t1.0\n";
String input = "name\tcolor\tvalue\n"
+ "s1\t#ff0000\t\n"
+ "s2\t\t1.0\n";
Collection<DataOverlayEntry> schemas = reader
.readColorSchema(new ByteArrayInputStream(input.getBytes(StandardCharsets.UTF_8)), params);
assertEquals(2, schemas.size());
......@@ -218,8 +218,8 @@ public class ColorSchemaReaderTest extends ConverterTestFunctions {
Map<String, String> params = new HashMap<>();
params.put(TextFileUtils.COLUMN_COUNT_PARAM, "3");
String input = "type\tname\tvalue\n" +
"protein\t\t1.0\n";
String input = "type\tname\tvalue\n"
+ "protein\t\t1.0\n";
Collection<DataOverlayEntry> schemas = reader
.readColorSchema(new ByteArrayInputStream(input.getBytes(StandardCharsets.UTF_8)), params);
assertEquals(1, schemas.size());
......@@ -320,8 +320,8 @@ public class ColorSchemaReaderTest extends ConverterTestFunctions {
@Test
public void testColoringWithModelName() throws Exception {
String input = "name\tcolor\tmap_name\n" +
"s1\t#ff0000\txxx\n";
String input = "name\tcolor\tmap_name\n"
+ "s1\t#ff0000\txxx\n";
Map<String, String> params = new HashMap<>();
params.put(TextFileUtils.COLUMN_COUNT_PARAM, "3");
......@@ -333,8 +333,8 @@ public class ColorSchemaReaderTest extends ConverterTestFunctions {
@Test
public void testColoringWithMapName() throws Exception {
String input = "name\tcolor\tmap_name\n" +
"s1\t#ff0000\txxx\n";
String input = "name\tcolor\tmap_name\n"
+ "s1\t#ff0000\txxx\n";
Map<String, String> params = new HashMap<>();
params.put(TextFileUtils.COLUMN_COUNT_PARAM, "3");
......
......@@ -183,8 +183,8 @@ public class OverviewParserTest extends ConverterTestFunctions {
*/
@Test(expected = InvalidOverviewFile.class)
public void testParseInvalidCoordinates() throws Exception {
String invalidCoordinates = "test.png\t10,10 100,10 100,100 10,10\tmain.xml\t10,10\t3\n" +
"test.png\t10,10 10,400 400,400 400,10\tmain.xml\t10,10\t4";
String invalidCoordinates = "test.png\t10,10 100,10 100,100 10,10\tmain.xml\t10,10\t3\n"
+ "test.png\t10,10 10,400 400,400 400,10\tmain.xml\t10,10\t4";
Set<Model> models = createValidTestMapModel();
List<OverviewImage> images = new ArrayList<OverviewImage>();
......@@ -199,9 +199,9 @@ public class OverviewParserTest extends ConverterTestFunctions {
@Test
public void testParseValidCoordinates() throws Exception {
String invalidCoordinates = "FILE\tPOLYGON\tLINK_TARGET\tMODEL_COORDINATES\tMODEL_ZOOM_LEVEL\tLINK_TYPE\n" +
"test.png\t10,10 100,10 100,100 10,10\tmain.xml\t10,10\t3\tMODEL\n" +
"test.png\t200,200 200,400 400,400 400,200\tmain.xml\t10,10\t4\tMODEL";
String invalidCoordinates = "FILE\tPOLYGON\tLINK_TARGET\tMODEL_COORDINATES\tMODEL_ZOOM_LEVEL\tLINK_TYPE\n"
+ "test.png\t10,10 100,10 100,100 10,10\tmain.xml\t10,10\t3\tMODEL\n"
+ "test.png\t200,200 200,400 400,400 400,200\tmain.xml\t10,10\t4\tMODEL";
Set<Model> models = createValidTestMapModel();
List<OverviewImage> images = new ArrayList<OverviewImage>();
......
......@@ -365,11 +365,11 @@ public class CreateHierarchyCommandTest extends CommandTestFunctions {
Layer layer = new Layer();
LayerText layerText = new LayerText();
layerText.setNotes("colors check\n" +
"SemanticZoomLevelVisibility: 3\n" +
"SemanticZoomLevelTransparency: 4\n" +
"BackgroundColor:#0000ee\n" +
"BorderColor:#00ee00");
layerText.setNotes("colors check\n"
+ "SemanticZoomLevelVisibility: 3\n"
+ "SemanticZoomLevelTransparency: 4\n"
+ "BackgroundColor:#0000ee\n"
+ "BorderColor:#00ee00");
layer.addLayerText(layerText);
model.addLayer(layer);
......
......@@ -107,26 +107,26 @@ public class CommentSerializer extends JsonSerializer<Comment> {
}
private void writeField(final JsonGenerator gen, final String field, final Object value, final PropertyFilter filter) throws IOException {
if (filter == null ||
(filter instanceof CustomExceptFilter && ((CustomExceptFilter) filter).includeField(field))) {
if (filter == null
|| (filter instanceof CustomExceptFilter && ((CustomExceptFilter) filter).includeField(field))) {
gen.writeObjectField(field, value);
}
}
public static List<String> availableColumns() {
return Arrays.asList(
"title",
"icon",
"type",
"content",
"removed",
"coord",
"modelId",
"elementId",
"id",
"pinned",
"email",
"owner",
"title",
"icon",
"type",
"content",
"removed",
"coord",
"modelId",
"elementId",
"id",
"pinned",
"email",
"owner",
"removeReason");
}
......
......@@ -232,10 +232,10 @@ public class EdgeParser extends ElementGpmlParser<Edge> {
edge.setType(pointData.getType());
}
boolean reversible = (pointDataList.get(0).getType() != GpmlInteractionType.LINE) &&
(pointDataList.get(0).getType() != null) &&
(pointDataList.get(points.size() - 1).getType() != GpmlInteractionType.LINE) &&
(pointDataList.get(points.size() - 1).getType() != null);
boolean reversible = (pointDataList.get(0).getType() != GpmlInteractionType.LINE)