Commit 38739f60 authored by Simon Barner's avatar Simon Barner
Browse files

Basic code cleanup (no change in logic)

Issue-Ref: 3816
Issue-Url: https://af3-developer.fortiss.org/issues/3816

Signed-off-by: Simon Barner's avatarSimon Barner <barner@fortiss.org>
parent a195f817
AuthorConstraint.java 388bf883f2d3c1d0d2b062a5c698914d0570b8b7 GREEN
ComponentExistsConstraint.java 9e0048c7452adcea6d8424722b4a2622289bcec7 GREEN
ComponentNameMeaningfulConstraint.java 8a023a0360f3d4e062da5b20b1ca3d91972e871d GREEN
ComponentNameMeaningfulConstraint.java e8c9633a676881b4840de472b675185e4116a54f RED
ComponentPackageExistsConstraint.java a9046afa399d1064f00daf5c374deaf5967d271b GREEN
ComponentToRequirementTraceExistsConstraint.java 0d48c8ca5a223df9710a483f2d6d1a814011bd71 GREEN
DescriptionAndOrConstraint.java 8e55d44b4f447bdc1e181e5100a03095db707526 GREEN
......@@ -28,5 +28,4 @@ ReviewUnambiguousConstraint.java 6f8933d64bf57a2c0e3bd61de3baed2eed80c983 GREEN
ReviewVerifiableConstraint.java ed9ad8e1f635615989afe31da3afa6e684220457 GREEN
SignalConstraints.java c725bf91ebb910d962b55a0eabb75c90c60b46fc GREEN
SourceConstraint.java 497707ee5694c8eff896a527fd40a7f3bb1bf1a0 GREEN
TraceConstraint.java 9609f4a218174048004052020bba9adeb71907eb GREEN
TraceNotEmptyConstraint.java abce9f5f72f8359405e1538293c232251c1b147a GREEN
......@@ -33,26 +33,25 @@ public class ComponentNameMeaningfulConstraint extends ComponentConstraintGroup
@Override
public IConstraintInstanceStatus verify(IConstrained constrained) {
boolean meaningfulName = true;
Component comp = (Component)constrained;
if(comp.getName().equalsIgnoreCase("Component Architecture Root")) {
// if top component node is available. don't do anything but make the traceAvailable
// to true
meaningfulName = true;
return successIfTrue(meaningfulName == true);
String name = comp.getName();
if(name.equalsIgnoreCase("Component Architecture Root")) {
// If top component node is available, set traceAvailable to true
return successIfTrue(true);
}
// check for default pattern
if((comp.getName().trim().isEmpty() || comp.getName().length() == 1 ||
comp.getName().equalsIgnoreCase("component") ||
comp.getName().equalsIgnoreCase("componen") ||
comp.getName().equalsIgnoreCase("compone") ||
comp.getName().equalsIgnoreCase("compon") ||
comp.getName().equalsIgnoreCase("compo") ||
comp.getName().equalsIgnoreCase("comp") || comp.getName().equalsIgnoreCase("com") ||
comp.getName().equalsIgnoreCase("co") || comp.getName().matches(".*\\d+.*"))) {
meaningfulName = false;
if((name.trim().isEmpty() || name.length() == 1 ||
name.equalsIgnoreCase("component") ||
name.equalsIgnoreCase("componen") ||
name.equalsIgnoreCase("compone") ||
name.equalsIgnoreCase("compon") ||
name.equalsIgnoreCase("compo") ||
name.equalsIgnoreCase("comp") || name.equalsIgnoreCase("com") ||
name.equalsIgnoreCase("co") || name.matches(".*\\d+.*"))) {
return successIfTrue(false);
}
return successIfTrue(meaningfulName == true);
return successIfTrue(true);
}
/** {@inheritDoc} */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment