1818
1919package org .apache .zookeeper .version .util ;
2020
21+ import edu .umd .cs .findbugs .annotations .SuppressFBWarnings ;
2122import java .io .File ;
2223import java .io .FileWriter ;
2324import java .io .IOException ;
2425import java .util .regex .Matcher ;
2526import java .util .regex .Pattern ;
2627import org .apache .zookeeper .server .ExitCode ;
27- import org .apache .zookeeper .util .ServiceUtils ;
2828
29+ @ SuppressFBWarnings ("DM_EXIT" )
2930public class VerGen {
3031
3132 private static final String PACKAGE_NAME = "org.apache.zookeeper.version" ;
@@ -35,7 +36,7 @@ public class VerGen {
3536 static void printUsage () {
3637 System .out .print ("Usage:\t java -cp <classpath> org.apache.zookeeper."
3738 + "version.util.VerGen maj.min.micro[-qualifier] rev buildDate outputDirectory" );
38- ServiceUtils . requestSystemExit (ExitCode .UNEXPECTED_ERROR .getValue ());
39+ System . exit (ExitCode .UNEXPECTED_ERROR .getValue ());
3940 }
4041
4142 public static void generateFile (File outputDir , Version version , String rev , String buildDate ) {
@@ -46,12 +47,12 @@ public static void generateFile(File outputDir, Version version, String rev, Str
4647 boolean ret = pkgdir .mkdirs ();
4748 if (!ret ) {
4849 System .out .println ("Cannnot create directory: " + path );
49- ServiceUtils . requestSystemExit (ExitCode .UNEXPECTED_ERROR .getValue ());
50+ System . exit (ExitCode .UNEXPECTED_ERROR .getValue ());
5051 }
5152 } else if (!pkgdir .isDirectory ()) {
5253 // not a directory
5354 System .out .println (path + " is not a directory." );
54- ServiceUtils . requestSystemExit (ExitCode .UNEXPECTED_ERROR .getValue ());
55+ System . exit (ExitCode .UNEXPECTED_ERROR .getValue ());
5556 }
5657
5758 try (FileWriter w = new FileWriter (new File (pkgdir , VERSION_INTERFACE_NAME + ".java" ))) {
@@ -88,7 +89,7 @@ public static void generateFile(File outputDir, Version version, String rev, Str
8889 w .write ("}\n " );
8990 } catch (IOException e ) {
9091 System .out .println ("Unable to generate version.Info file: " + e .getMessage ());
91- ServiceUtils . requestSystemExit (ExitCode .UNEXPECTED_ERROR .getValue ());
92+ System . exit (ExitCode .UNEXPECTED_ERROR .getValue ());
9293 }
9394
9495 // Generate a main class to display version data
@@ -124,7 +125,7 @@ public static void generateFile(File outputDir, Version version, String rev, Str
124125 w .write ("}\n " );
125126 } catch (IOException e ) {
126127 System .out .println ("Unable to generate version.VersionInfoMain file: " + e .getMessage ());
127- ServiceUtils . requestSystemExit ( 1 );
128+ System . exit ( ExitCode . UNEXPECTED_ERROR . getValue () );
128129 }
129130 }
130131
@@ -182,7 +183,7 @@ public static void main(String[] args) {
182183 Version version = parseVersionString (args [0 ]);
183184 if (version == null ) {
184185 System .err .println ("Invalid version number format, must be \" x.y.z(-.*)?\" " );
185- ServiceUtils . requestSystemExit (ExitCode .UNEXPECTED_ERROR .getValue ());
186+ System . exit (ExitCode .UNEXPECTED_ERROR .getValue ());
186187 }
187188 String rev = args [1 ];
188189 if (rev == null || rev .trim ().isEmpty ()) {
0 commit comments