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 16
16
import java .nio .file .Paths ;
17
17
import java .util .Arrays ;
18
18
import java .util .List ;
19
+ import java .util .Objects ;
19
20
import java .util .Properties ;
20
21
import java .util .logging .Logger ;
21
22
import javax .management .MBeanServerConnection ;
@@ -36,7 +37,7 @@ public class JmxScraper {
36
37
*/
37
38
@ SuppressWarnings ({"SystemOut" , "SystemExitOutsideMain" })
38
39
public static void main (String [] args ) {
39
- JmxScraperConfig config = null ;
40
+ JmxScraperConfig config ;
40
41
JmxScraper jmxScraper = null ;
41
42
try {
42
43
JmxScraperConfigFactory factory = new JmxScraperConfigFactory ();
@@ -54,9 +55,9 @@ public static void main(String[] args) {
54
55
}
55
56
56
57
try {
57
- jmxScraper .start ();
58
+ Objects . requireNonNull ( jmxScraper ) .start ();
58
59
} catch (IOException e ) {
59
- System .err .println ("Unable to connect to " + config . getServiceUrl () + " " + e .getMessage ());
60
+ System .err .println ("Unable to connect " + e .getMessage ());
60
61
System .exit (2 );
61
62
}
62
63
}
You can’t perform that action at this time.
0 commit comments