Source:
<code>private void show(final String graphUuid, final Element<? extends Definition<?>> element, final Command callback) { if (element != null) { if (lastElement != null && lastElement.getUUID().equals(element.getUUID()) && element instanceof Node) { lastPosition = GraphUtils.getComputedPosition((Node<?, ? extends Edge>) element); return; } final String uuid = element.getUUID(); final Diagram<?, ?> diagram = formSessionHandler.getDiagram(); if (Objects.isNull(diagram)) { return; } final Metadata metadata = diagram.getMetadata(); if (Objects.isNull(metadata)) { return; } final Path diagramPath = metadata.getPath(); final Definition content = element.getContent(); if (Objects.isNull(content)) { return; } final Object definition = content.getDefinition(); final RenderMode renderMode = formSessionHandler.getSession() instanceof EditorSession ? RenderMode.EDIT_MODE : RenderMode.READ_ONLY_MODE; formsContainer.render(graphUuid, uuid, definition, diagramPath, (fieldName, newValue) -> { try { formSessionHandler.executeUpdateProperty(element, fieldName, newValue); } catch (final Exception ex) { log(Level.SEVERE, "Something wrong happened refreshing the canvas for " + "field '" + fieldName + "': " + ex.getCause()); } finally { if (null != callback) { callback.execute(); } } }, renderMode); final String name = definitionUtils.getName(definition); propertiesOpenedEvent.fire(new FormPropertiesOpened(formSessionHandler.getSession(), uuid, name)); lastElement = element; <START> if (element instanceof Node) { <END> lastPosition = GraphUtils.getComputedPosition((Node<?, ? extends Edge>) element); } } }</code><technical_language>I personally prefer null != element.asNode() instead of element instanceof Node, in mind javascript inheritance is for a pure client side developer results more familiar null (undefined).. a preference. Please create a private static method class re-use it, instead of duplicating element instanceof Node, alway good re-use code :)</technical_language>

Target:
private void show(final String graphUuid, final Element<? extends Definition<?>> element, final Command callback) { if (element != null) { if (lastElement != null && lastElement.getUUID().equals(element.getUUID()) && isNode(element)) { lastPosition = GraphUtils.getComputedPosition((Node<?, ? extends Edge>) element); return; } final String uuid = element.getUUID(); final Diagram<?, ?> diagram = formSessionHandler.getDiagram(); if (Objects.isNull(diagram)) { return; } final Metadata metadata = diagram.getMetadata(); if (Objects.isNull(metadata)) { return; } final Path diagramPath = metadata.getPath(); final Definition content = element.getContent(); if (Objects.isNull(content)) { return; } final Object definition = content.getDefinition(); final RenderMode renderMode = formSessionHandler.getSession() instanceof EditorSession ? RenderMode.EDIT_MODE : RenderMode.READ_ONLY_MODE; formsContainer.render(graphUuid, uuid, definition, diagramPath, (fieldName, newValue) -> { try { formSessionHandler.executeUpdateProperty(element, fieldName, newValue); } catch (final Exception ex) { log(Level.SEVERE, "Something wrong happened refreshing the canvas for " + "field '" + fieldName + "': " + ex.getCause()); } finally { if (null != callback) { callback.execute(); } } }, renderMode); final String name = definitionUtils.getName(definition); propertiesOpenedEvent.fire(new FormPropertiesOpened(formSessionHandler.getSession(), uuid, name)); lastElement = element; if (isNode(element)) { lastPosition = GraphUtils.getComputedPosition((Node<?, ? extends Edge>) element); } } }