From 1abf23c0131a36cdebb6e668ee01fbc9cba4eb96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20Veres-Szentkir=C3=A1lyi?= Date: Thu, 16 Dec 2021 16:43:45 +0100 Subject: [PATCH] made startup announcement more Kotlinic - reuse NAME - use "use { ... }" instead of explicit close() - use property instead of explicit getter --- src/main/kotlin/burp/BurpExtender.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/burp/BurpExtender.kt b/src/main/kotlin/burp/BurpExtender.kt index 23cece7..0947d0e 100644 --- a/src/main/kotlin/burp/BurpExtender.kt +++ b/src/main/kotlin/burp/BurpExtender.kt @@ -19,6 +19,7 @@ package burp import java.io.PrintWriter + import java.net.URL import java.util.* import java.util.concurrent.ConcurrentHashMap @@ -61,9 +62,9 @@ class BurpExtender : IBurpExtender, IScannerCheck, IExtensionStateListener { callbacks.registerScannerCheck(this) callbacks.registerExtensionStateListener(this) - val stdout = PrintWriter(callbacks.getStdout(), true) - stdout.println("log4shell scanner loaded") - stdout.close() + PrintWriter(callbacks.stdout, true).use { stdout -> + stdout.println("$NAME loaded") + } } override fun doPassiveScan(baseRequestResponse: IHttpRequestResponse?): MutableList =