1010package  org .elasticsearch .gradle .internal .transport ;
1111
1212import  com .google .common .collect .Streams ;
13+ 
1314import  org .elasticsearch .gradle .VersionProperties ;
1415import  org .gradle .api .DefaultTask ;
1516import  org .gradle .api .file .RegularFileProperty ;
@@ -77,10 +78,7 @@ public void generateTransportVersionData() throws IOException {
7778        // Create the new version 
7879        final  var  mainReleaseVersion  = VersionProperties .getElasticsearchVersion ();
7980        final  var  areWeOnMain  = forMinorVersion .equals (mainReleaseVersion );
80-         int  newVersion  = bumpVersionNumber (
81-             latestTV .ids ().getFirst (),
82-             areWeOnMain  ? PartToBump .SERVER  : PartToBump .PATCH 
83-         );
81+         int  newVersion  = bumpVersionNumber (latestTV .ids ().getFirst (), areWeOnMain  ? PartToBump .SERVER  : PartToBump .PATCH );
8482
8583        // Load the tvSetData for the specified name, if it exists 
8684        final  var  tvSetDataFromFile  = TransportVersionUtils .getDefinedFile (tvDataDir , tvName );
@@ -103,10 +101,7 @@ public enum PartToBump {
103101    }
104102
105103    // TODO Do I need to remove the patch when updating the server portion? NO, but probably need some additional checks 
106-     private  static  int  bumpVersionNumber (
107-         int  tvIDToBump ,
108-         PartToBump  partToBump 
109-     ) {
104+     private  static  int  bumpVersionNumber (int  tvIDToBump , PartToBump  partToBump ) {
110105
111106        /* The TV format: 
112107         * 
@@ -121,24 +116,27 @@ private static int bumpVersionNumber(
121116            case  SERVER  -> {
122117                var  newId  = tvIDToBump  + 1000 ;
123118                if  ((newId  / 1000 ) % 100  == 0 ) {
124-                     throw  new  IllegalStateException ("Insufficient server version section in TransportVersion: "  + tvIDToBump 
125-                         + ", Cannot bump." );
119+                     throw  new  IllegalStateException (
120+                         "Insufficient server version section in TransportVersion: "  + tvIDToBump  + ", Cannot bump." 
121+                     );
126122                }
127123                yield tvIDToBump  + 1000 ;
128124            }
129125            case  SUBSIDIARY  -> {
130126                var  newId  = tvIDToBump  + 100 ;
131127                if  ((newId  / 100 ) == 0 ) {
132-                     throw  new  IllegalStateException ("Insufficient subsidiary version section in TransportVersion: "  + tvIDToBump 
133-                         + ", Cannot bump." );
128+                     throw  new  IllegalStateException (
129+                         "Insufficient subsidiary version section in TransportVersion: "  + tvIDToBump  + ", Cannot bump." 
130+                     );
134131                }
135132                yield newId ;
136133            }
137134            case  PATCH  -> {
138135                var  newId  = tvIDToBump  + 1 ;
139136                if  (newId  % 10  == 0 ) {
140-                     throw  new  IllegalStateException ("Insufficient patch version section in TransportVersion: "  + tvIDToBump 
141-                         + ", Cannot bump." );
137+                     throw  new  IllegalStateException (
138+                         "Insufficient patch version section in TransportVersion: "  + tvIDToBump  + ", Cannot bump." 
139+                     );
142140                }
143141                yield newId ;
144142            }
0 commit comments