From 7c257ff2b26db4c7923e3e8de9934c88a2c4c5af Mon Sep 17 00:00:00 2001 From: Alexander Fedorov Date: Tue, 6 Dec 2022 17:28:20 +0300 Subject: [PATCH 1/4] Please use latest version of com.sun.jna and com.sun.jna.platform #1084 oshi-core:6.3.2 jna-platform:5.12.1 jna:5.12.1 slf4j-api:2.0.5 Signed-off-by: Alexander Fedorov --- .../org.eclipse.passage.target.target | 37 +++++++++++++++---- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/releng/org.eclipse.passage.target/org.eclipse.passage.target.target b/releng/org.eclipse.passage.target/org.eclipse.passage.target.target index 5408f1f23..e28b286c2 100644 --- a/releng/org.eclipse.passage.target/org.eclipse.passage.target.target +++ b/releng/org.eclipse.passage.target/org.eclipse.passage.target.target @@ -12,7 +12,7 @@ Contributors: ArSysOp - initial API and implementation --> - + @@ -75,9 +75,6 @@ - - - @@ -87,8 +84,34 @@ - - + + + + + com.github.oshi + oshi-core + 6.3.2 + jar + + + net.java.dev.jna + jna-platform + 5.12.1 + jar + + + net.java.dev.jna + jna + 5.12.1 + jar + + + org.slf4j + slf4j-api + 2.0.5 + jar + + - + \ No newline at end of file From a8fa32695cfa76b2ac8a9ee059e19198b5390f4e Mon Sep 17 00:00:00 2001 From: Alexander Fedorov Date: Tue, 6 Dec 2022 17:45:24 +0300 Subject: [PATCH 2/4] Please use latest version of com.sun.jna and com.sun.jna.platform #1084 Migrated code to OSHi 6.3.2 Signed-off-by: Alexander Fedorov --- .../.settings/.api_filters | 6 ++++++ .../.settings/.api_filters | 6 ++++++ .../META-INF/MANIFEST.MF | 6 +++--- .../passage/lic/oshi/NetHardwareAddress.java | 20 +++---------------- .../org/eclipse/passage/lic/oshi/State.java | 13 ++++++------ .../org/eclipse/passage/lic/oshi/Swath.java | 14 ++++++------- 6 files changed, 32 insertions(+), 33 deletions(-) diff --git a/bundles/org.eclipse.passage.lic.equinox/.settings/.api_filters b/bundles/org.eclipse.passage.lic.equinox/.settings/.api_filters index fb31896e3..da462aee3 100644 --- a/bundles/org.eclipse.passage.lic.equinox/.settings/.api_filters +++ b/bundles/org.eclipse.passage.lic.equinox/.settings/.api_filters @@ -13,6 +13,12 @@ + + + + + + diff --git a/bundles/org.eclipse.passage.lic.jface/.settings/.api_filters b/bundles/org.eclipse.passage.lic.jface/.settings/.api_filters index b12e11863..076df48df 100644 --- a/bundles/org.eclipse.passage.lic.jface/.settings/.api_filters +++ b/bundles/org.eclipse.passage.lic.jface/.settings/.api_filters @@ -7,5 +7,11 @@ + + + + + + diff --git a/bundles/org.eclipse.passage.lic.oshi/META-INF/MANIFEST.MF b/bundles/org.eclipse.passage.lic.oshi/META-INF/MANIFEST.MF index 4d6e8283e..b4961869b 100644 --- a/bundles/org.eclipse.passage.lic.oshi/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.passage.lic.oshi/META-INF/MANIFEST.MF @@ -7,9 +7,9 @@ Bundle-Name: %Bundle-Name Bundle-Vendor: %Bundle-Vendor Bundle-Copyright: %Bundle-Copyright Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Require-Bundle: com.sun.jna;bundle-version="[4.5.1,5.0.0)", - com.sun.jna.platform;bundle-version="[4.5.1,5.0.0)", - com.github.oshi.oshi-core;bundle-version="[3.8.0,3.10.0)", +Require-Bundle: com.sun.jna;bundle-version="5.12.0", + com.sun.jna.platform;bundle-version="5.12.0", + com.github.oshi.oshi-core;bundle-version="6.3.2", org.eclipse.passage.lic.api;bundle-version="2.6.1", org.eclipse.passage.lic.base;bundle-version="2.6.1" Export-Package: org.eclipse.passage.lic.oshi diff --git a/bundles/org.eclipse.passage.lic.oshi/src/org/eclipse/passage/lic/oshi/NetHardwareAddress.java b/bundles/org.eclipse.passage.lic.oshi/src/org/eclipse/passage/lic/oshi/NetHardwareAddress.java index 2063834c2..3a89a79cb 100644 --- a/bundles/org.eclipse.passage.lic.oshi/src/org/eclipse/passage/lic/oshi/NetHardwareAddress.java +++ b/bundles/org.eclipse.passage.lic.oshi/src/org/eclipse/passage/lic/oshi/NetHardwareAddress.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2020 ArSysOp + * Copyright (c) 2020, 2022 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -9,10 +9,10 @@ * * Contributors: * ArSysOp - initial API and implementation + * ArSysOp - porting to OSHi 6.3.2 *******************************************************************************/ package org.eclipse.passage.lic.oshi; -import java.net.SocketException; import java.util.function.Supplier; import oshi.hardware.NetworkIF; @@ -27,21 +27,7 @@ final class NetHardwareAddress implements Supplier { @Override public String get() { - byte[] address; - try { - address = net.getNetworkInterface().getHardwareAddress(); - } catch (SocketException e) { - return null; // mimic null: supports OSHI reading policy - } - return enlisted(address); - } - - private String enlisted(byte[] bytes) { - StringBuilder out = new StringBuilder(); - for (int one : bytes) { - out.append(one); - } - return out.toString(); + return net.getMacaddr(); } } diff --git a/bundles/org.eclipse.passage.lic.oshi/src/org/eclipse/passage/lic/oshi/State.java b/bundles/org.eclipse.passage.lic.oshi/src/org/eclipse/passage/lic/oshi/State.java index 425438ac4..d2a2280e9 100644 --- a/bundles/org.eclipse.passage.lic.oshi/src/org/eclipse/passage/lic/oshi/State.java +++ b/bundles/org.eclipse.passage.lic.oshi/src/org/eclipse/passage/lic/oshi/State.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2020, 2021 ArSysOp + * Copyright (c) 2020, 2022 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -9,6 +9,7 @@ * * Contributors: * ArSysOp - initial API and implementation + * ArSysOp - porting to OSHi 6.3.2 *******************************************************************************/ package org.eclipse.passage.lic.oshi; @@ -30,7 +31,7 @@ import oshi.SystemInfo; import oshi.hardware.Baseboard; -import oshi.hardware.CentralProcessor; +import oshi.hardware.CentralProcessor.ProcessorIdentifier; import oshi.hardware.ComputerSystem; import oshi.hardware.HardwareAbstractionLayer; import oshi.software.os.OperatingSystem; @@ -107,13 +108,13 @@ private void read() throws LicensingException { private void readOS(OperatingSystem info) { hardware.store(info::getFamily, new OS.Family()); hardware.store(info::getManufacturer, new OS.Manufacturer()); - hardware.store(info.getVersion()::getVersion, new OS.Version()); - hardware.store(info.getVersion()::getBuildNumber, new OS.BuildNumber()); + hardware.store(info.getVersionInfo()::getVersion, new OS.Version()); + hardware.store(info.getVersionInfo()::getBuildNumber, new OS.BuildNumber()); } private void readHal(HardwareAbstractionLayer hal) { readPart(hal::getComputerSystem, this::readSystem); - readPart(hal::getProcessor, this::readProcessor); + readPart(hal.getProcessor()::getProcessorIdentifier, this::readProcessor); } private void readSystem(ComputerSystem info) { @@ -139,7 +140,7 @@ private void readFirmware(oshi.hardware.Firmware info) { hardware.store(info::getDescription, new Firmware.Description()); } - private void readProcessor(CentralProcessor info) { + private void readProcessor(ProcessorIdentifier info) { hardware.store(info::getVendor, new Cpu.Vendor()); hardware.store(info::getFamily, new Cpu.Family()); hardware.store(info::getModel, new Cpu.Model()); diff --git a/bundles/org.eclipse.passage.lic.oshi/src/org/eclipse/passage/lic/oshi/Swath.java b/bundles/org.eclipse.passage.lic.oshi/src/org/eclipse/passage/lic/oshi/Swath.java index fd042bac0..457568174 100644 --- a/bundles/org.eclipse.passage.lic.oshi/src/org/eclipse/passage/lic/oshi/Swath.java +++ b/bundles/org.eclipse.passage.lic.oshi/src/org/eclipse/passage/lic/oshi/Swath.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2020 ArSysOp + * Copyright (c) 2020, 2022 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -9,11 +9,11 @@ * * Contributors: * ArSysOp - initial API and implementation + * ArSysOp - porting to OSHi 6.3.2 *******************************************************************************/ package org.eclipse.passage.lic.oshi; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import java.util.Objects; import java.util.Set; @@ -70,11 +70,11 @@ final void read(SystemInfo system) { new FragileData<>(() -> source(system), this::readSource).supply(); } - private void readSource(T[] source) { - Arrays.stream(source).forEach(src -> properties.add(fillProperties(src, new EnvironmentProperties()))); + private void readSource(List source) { + source.stream().forEach(src -> properties.add(fillProperties(src, new EnvironmentProperties()))); } - protected abstract T[] source(SystemInfo system); + protected abstract List source(SystemInfo system); protected abstract EnvironmentProperties fillProperties(T source, EnvironmentProperties props); @@ -85,7 +85,7 @@ static final class Disks extends Swath { } @Override - protected HWDiskStore[] source(SystemInfo system) { + protected List source(SystemInfo system) { return system.getHardware().getDiskStores(); } @@ -106,7 +106,7 @@ static final class Nets extends Swath { } @Override - protected NetworkIF[] source(SystemInfo system) { + protected List source(SystemInfo system) { return system.getHardware().getNetworkIFs(); } From 055a834c2cff5fb9db188ebca9aea4eb218abc42 Mon Sep 17 00:00:00 2001 From: Alexander Fedorov Date: Tue, 6 Dec 2022 18:22:10 +0300 Subject: [PATCH 3/4] Please use latest version of com.sun.jna and com.sun.jna.platform #1084 Add org.osgi.service.serviceloader Signed-off-by: Alexander Fedorov --- .../org.eclipse.passage.target.target | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/releng/org.eclipse.passage.target/org.eclipse.passage.target.target b/releng/org.eclipse.passage.target/org.eclipse.passage.target.target index e28b286c2..3214fa39e 100644 --- a/releng/org.eclipse.passage.target/org.eclipse.passage.target.target +++ b/releng/org.eclipse.passage.target/org.eclipse.passage.target.target @@ -111,6 +111,11 @@ 2.0.5 jar + + org.osgi + org.osgi.service.serviceloader + 1.0.0 + From d04988967b2890bfa0685613f9b0c00a743d721d Mon Sep 17 00:00:00 2001 From: Alexander Fedorov Date: Tue, 6 Dec 2022 18:37:58 +0300 Subject: [PATCH 4/4] Please use latest version of com.sun.jna and com.sun.jna.platform #1084 Switch to OSHi 6.2.2 Signed-off-by: Alexander Fedorov --- .../org.eclipse.passage.lic.oshi/META-INF/MANIFEST.MF | 2 +- .../org.eclipse.passage.lic.oshi.feature/feature.xml | 4 ++-- .../org.eclipse.passage.target.target | 9 ++------- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/bundles/org.eclipse.passage.lic.oshi/META-INF/MANIFEST.MF b/bundles/org.eclipse.passage.lic.oshi/META-INF/MANIFEST.MF index b4961869b..da6d2bc54 100644 --- a/bundles/org.eclipse.passage.lic.oshi/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.passage.lic.oshi/META-INF/MANIFEST.MF @@ -9,7 +9,7 @@ Bundle-Copyright: %Bundle-Copyright Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: com.sun.jna;bundle-version="5.12.0", com.sun.jna.platform;bundle-version="5.12.0", - com.github.oshi.oshi-core;bundle-version="6.3.2", + com.github.oshi.oshi-core;bundle-version="6.2.2", org.eclipse.passage.lic.api;bundle-version="2.6.1", org.eclipse.passage.lic.base;bundle-version="2.6.1" Export-Package: org.eclipse.passage.lic.oshi diff --git a/features/org.eclipse.passage.lic.oshi.feature/feature.xml b/features/org.eclipse.passage.lic.oshi.feature/feature.xml index 70eac37e0..8faed6c58 100644 --- a/features/org.eclipse.passage.lic.oshi.feature/feature.xml +++ b/features/org.eclipse.passage.lic.oshi.feature/feature.xml @@ -40,14 +40,14 @@ id="com.sun.jna" download-size="0" install-size="0" - version="4.5.1.v20210503-0343" + version="0.0.0" unpack="false"/> com.github.oshi oshi-core - 6.3.2 + 6.2.2 jar @@ -108,14 +108,9 @@ org.slf4j slf4j-api - 2.0.5 + 1.7.36 jar - - org.osgi - org.osgi.service.serviceloader - 1.0.0 -