From 2be67a1bd2d08eccc37d6faa3c58db2b2e5577cc Mon Sep 17 00:00:00 2001 From: hduelme Date: Mon, 14 Aug 2023 18:44:42 +0200 Subject: [PATCH] Change Integer objects to primitive ints in SNMPAgent The SNMPAgent class has been refactored to use primitive 'int' instead of 'Integer' objects to enhance memory efficacy and performance. --- .../eumw/poseidas/server/monitoring/SNMPAgent.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/poseidas/src/main/java/de/governikus/eumw/poseidas/server/monitoring/SNMPAgent.java b/poseidas/src/main/java/de/governikus/eumw/poseidas/server/monitoring/SNMPAgent.java index 15a34b1..6965906 100644 --- a/poseidas/src/main/java/de/governikus/eumw/poseidas/server/monitoring/SNMPAgent.java +++ b/poseidas/src/main/java/de/governikus/eumw/poseidas/server/monitoring/SNMPAgent.java @@ -222,9 +222,9 @@ private VariableBinding getProviderSpecificData(String oid) throws IOException if (matcher.find()) { String stringType = matcher.group(1); - Integer type = Integer.valueOf(stringType); + int type = Integer.parseInt(stringType); String stringId = matcher.group(2); - Integer id = Integer.valueOf(stringId); + int id = Integer.parseInt(stringId); EidasMiddlewareConfig configuration = configurationService.getConfiguration() .orElseThrow(() -> new ConfigurationException("No eidas middleware configuration present")); @@ -291,7 +291,7 @@ private String nextOID(String oidStr) Matcher matcher = SERVICE_PROVIDER_PREFIX_PATTERN.matcher(oidStr); if (matcher.find()) { - Integer id = Integer.valueOf(matcher.group(2)); + int id = Integer.parseInt(matcher.group(2)); EidasMiddlewareConfig configuration = configurationService.getConfiguration() .orElseThrow(() -> new ConfigurationException("No eidas middleware configuration present")); if (id + 1 < configuration.getEidConfiguration().getServiceProvider().size())