File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
jmx-scraper/src/main/java/io/opentelemetry/contrib/jmxscraper Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1616import java .nio .file .Paths ;
1717import java .util .Arrays ;
1818import java .util .List ;
19+ import java .util .Objects ;
1920import java .util .Properties ;
2021import java .util .logging .Logger ;
2122import javax .management .MBeanServerConnection ;
@@ -36,7 +37,7 @@ public class JmxScraper {
3637 */
3738 @ SuppressWarnings ({"SystemOut" , "SystemExitOutsideMain" })
3839 public static void main (String [] args ) {
39- JmxScraperConfig config = null ;
40+ JmxScraperConfig config ;
4041 JmxScraper jmxScraper = null ;
4142 try {
4243 JmxScraperConfigFactory factory = new JmxScraperConfigFactory ();
@@ -54,9 +55,9 @@ public static void main(String[] args) {
5455 }
5556
5657 try {
57- jmxScraper .start ();
58+ Objects . requireNonNull ( jmxScraper ) .start ();
5859 } catch (IOException e ) {
59- System .err .println ("Unable to connect to " + config . getServiceUrl () + " " + e .getMessage ());
60+ System .err .println ("Unable to connect " + e .getMessage ());
6061 System .exit (2 );
6162 }
6263 }
You can’t perform that action at this time.
0 commit comments