Skip to content
Permalink
Browse files

fix: validSystemNameFormat rejects empty suffix

  • Loading branch information...
rhwood committed May 22, 2019
1 parent aa7d6e1 commit 26f70b836c053ad9dbf4ebc72024e0c3cc5c6d80
Showing with 7 additions and 3 deletions.
  1. +7 −3 java/src/jmri/managers/AbstractManager.java
@@ -586,12 +586,16 @@ public String normalizeSystemName(@Nonnull String inputName) throws NamedBean.Ba
/**
* {@inheritDoc}
*
* @return always 'VALID' to let undocumented connection system
* managers pass entry validation.
* @return {@link jmri.Manager.NameValidity#INVALID} if system name suffix
* is empty or all white space; otherwise returns
* {@link jmri.Manager.NameValidity#VALID} to let undocumented
* connection system managers pass entry validation.
*/
@Override
public NameValidity validSystemNameFormat(String systemName) {
return NameValidity.VALID;
return !getSystemNamePrefix().equals(systemName.trim())
? NameValidity.VALID
: NameValidity.INVALID;
}

/** {@inheritDoc} */

0 comments on commit 26f70b8

Please sign in to comment.
You can’t perform that action at this time.