-
Type: Bug
-
Status: Open
-
Priority: Minor
-
Resolution: Unresolved
-
Affects Version/s: 61
-
Fix Version/s: QualifiedToSchedule
-
Component/s: Technical / Transverse
Currently, the class com.nuxeo.studio.core.VersionServiceImpl.java#innerGetSuggestedVersion has the following logic:
private SuggestedVersions innerGetSuggestedVersion(String original, String version) { ... try { Matcher matcher = Pattern.compile(VERSION_MATCHER).matcher(version); matcher.find(); versionS = matcher.group(VERSION_PART); majorS = matcher.group(MAJOR_PART); minorS = matcher.group(MINOR_PART); revisionS = matcher.group(REVISION_PART); qualifier = matcher.group(QUALIFIER_PART); } catch (Exception e) { return innerGetSuggestedVersion(original, Version.INITIAL_VERSION); } ... }
It use a try-catch block handle the regex match error. If there's any fail to match, then the method recall itself recursively with another argument. We need to investigate if it would introduces an infinite loop. And ideally, avoid using recursive call + try-catch when providing a fall back solution.