Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
af3
AF3
Commits
da8e9a4a
Commit
da8e9a4a
authored
Nov 10, 2017
by
Simon Barner
Browse files
Fix NPE
refs 2663
parent
ad7636a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
org.fortiss.af3.platform.hierarchic/trunk/src/org/fortiss/af3/platform/hierarchic/compose/elements/MemoryCompositor.java
View file @
da8e9a4a
...
...
@@ -50,16 +50,22 @@ public final class MemoryCompositor extends MemoryUnitCompositorBase<Memory> {
/** Returns whether the given contained element is of an acceptable class. */
@Override
protected
boolean
isCorrectElementClass
(
Memory
container
,
IArchitectureDomain
contained
)
{
// Determine if element can be added, i.e. whether current drag&drop operation
// can be finished.
return
// Elements from the next (more fine-grained) level, that can be dropped into
// the model element under the regime of this compositor
(
getPlatformCompositionRules
().
isValidContainer
(
container
.
getClass
(),
contained
.
getClass
())
&&
(
canBeDroppedInto
(
contained
)
||
canBeAddedAtCurrentLevel
(
contained
)))
||
if
(
container
!=
null
)
{
// Determine if element can be added, i.e. whether current drag&drop operation
// can be finished.
return
// Elements from the next (more fine-grained) level, that can be dropped into
// the model element under the regime of this compositor
(
getPlatformCompositionRules
().
isValidContainer
(
container
.
getClass
(),
contained
.
getClass
())
&&
(
canBeDroppedInto
(
contained
)
||
canBeAddedAtCurrentLevel
(
contained
)))
||
// Elements from the same level as the model element
// under the regime of this compositor that can be added
(
getPlatformCompositionRules
().
hasEqualLevel
(
container
.
getClass
(),
contained
.
getClass
())
&&
canBeAddedAtCurrentLevel
(
contained
));
// Elements from the same level as the model element
// under the regime of this compositor that can be added
(
getPlatformCompositionRules
().
hasEqualLevel
(
container
.
getClass
(),
contained
.
getClass
())
&&
canBeAddedAtCurrentLevel
(
contained
));
}
// Determine if element is contributed to current library.
return
isAvailableInLibrary
(
contained
);
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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