MCPcopy Index your code
hub / github.com/apache/groovy / getShortVersion

Method getShortVersion

src/main/java/groovy/lang/GroovySystem.java:135–143  ·  view source on GitHub ↗

Returns the major and minor part of the groovy version excluding the point/patch part of the version. E.g. 3.0.0, 3.0.0-SNAPSHOT, 3.0.0-rc-1 all have 3.0 as the short version. @since 3.0.1

()

Source from the content-addressed store, hash-verified

133 * @since 3.0.1
134 */
135 public static String getShortVersion() {
136 String full = getVersion();
137 int firstDot = full.indexOf('.');
138 int secondDot = full.indexOf('.', firstDot + 1);
139 if (secondDot < 0) {
140 throw new GroovyBugError("Unexpected version found: " + full);
141 }
142 return full.substring(0, secondDot);
143 }
144}

Callers

nothing calls this directly

Calls 3

getVersionMethod · 0.95
substringMethod · 0.80
indexOfMethod · 0.45

Tested by

no test coverage detected