Skip to content

Commit

Permalink
Fix dependency issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nroduit committed Aug 25, 2023
1 parent 39d3319 commit 9a88346
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 20 deletions.
2 changes: 1 addition & 1 deletion weasis-acquire/weasis-acquire-explorer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<configuration>
<bnd>
-includeresource.all: lib/=target/dependency/;lib:=true
Export-Package: !org.weasis.acquire.explorer.gui.control,org.weasis.acquire.explorer.*
Export-Package: org.weasis.acquire.explorer.*
</bnd>
</configuration>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -75,7 +76,7 @@
/**
* The event processing center for this application. This class responses for loading data sets,
* processing the events from the utility menu that includes changing the operation scope, the
* layout, window/level, rotation angle, zoom factor, starting/stoping the cining-loop etc.
* layout, window/level, rotation angle, zoom factor, starting/stopping the cining-loop etc.
*/
public class EventManager extends ImageViewerEventManager<ImageElement> implements ActionListener {

Expand Down Expand Up @@ -598,7 +599,7 @@ public JMenu getOrientationMenu(String prop) {
menu.add(menuItem);
menuItem = new JMenuItem(Messages.getString("View2dContainer.-90"));
menuItem.setIcon(ResourceUtil.getIcon(ActionIcon.ROTATE_COUNTERCLOCKWISE));
menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_L, KeyEvent.ALT_DOWN_MASK));
menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_L, InputEvent.ALT_DOWN_MASK));
menuItem.addActionListener(
e ->
rotateAction
Expand All @@ -607,7 +608,7 @@ public JMenu getOrientationMenu(String prop) {
menu.add(menuItem);
menuItem.setIcon(ResourceUtil.getIcon(ActionIcon.ROTATE_CLOCKWISE));
menuItem = new JMenuItem(Messages.getString("View2dContainer.+90"));
menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R, KeyEvent.ALT_DOWN_MASK));
menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R, InputEvent.ALT_DOWN_MASK));
menuItem.addActionListener(
e ->
rotateAction
Expand All @@ -631,7 +632,8 @@ public JMenu getOrientationMenu(String prop) {
.createUnregisteredJCCheckBoxMenuItem(
Messages.getString("View2dContainer.flip_h"),
ResourceUtil.getIcon(ActionIcon.FLIP));
menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F, KeyEvent.ALT_DOWN_MASK));
menuItem.setAccelerator(
KeyStroke.getKeyStroke(KeyEvent.VK_F, InputEvent.ALT_DOWN_MASK));
menu.add(menuItem);
}
}
Expand Down
2 changes: 1 addition & 1 deletion weasis-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
Import-Package: !org.apache.commons.codec.binary;resolution:=optional,com.madgag.gif.fmsware;resolution:=optional,de.rototor.pdfbox.graphics2d;\
resolution:=optional,org.apache.pdfbox.pdmodel.*;resolution:=optional,\
!sun.swing,*
Export-Package: !org.weasis.core.internal,org.weasis.core.*
Export-Package: !org.weasis.core.internal,!org.weasis.core.util,org.weasis.core.*
-exportcontents: com.github.scribejava.*,it.cnr.imaa.*,org.jdesktop.jxlayer.*,com.github.lgooddatepicker.*,\
com.privatejgoodies.*,org.knowm.xchart.*,de.erichseifert.*
</bnd>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public Feature(String title, String command, int keyEvent, int modifier, Cursor
this.icon = ResourceUtil.getIcon("svg/action/" + command + ".svg"); // NON-NLS
}

@SuppressWarnings("unchecked")
public T getValue(Map<String, Object> map) {
if (map != null) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ private CvUtil() {}

public static void runGarbageCollectorAndWait(long ms) {
System.gc();
System.runFinalization();
System.gc();
System.runFinalization();
try {
TimeUnit.MILLISECONDS.sleep(ms);
} catch (InterruptedException et) {
Expand Down
13 changes: 10 additions & 3 deletions weasis-core/src/main/java/org/weasis/core/api/util/LocalUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,22 @@ public static Locale textToLocale(String value) {
String language = val.length > 0 ? val[0] : "";
String country = val.length > 1 ? val[1] : "";
String variant = val.length > 2 ? val[2] : "";

return new Locale(language, country, variant);
return new Locale.Builder()
.setLanguage(language)
.setRegion(country)
.setVariant(variant)
.build();
}

public static Locale getSystemLocale() {
String language = System.getProperty("user.language", "en"); // NON-NLS
String country = System.getProperty("user.country", ""); // NON-NLS
String variant = System.getProperty("user.variant", ""); // NON-NLS
return new Locale(language, country, variant);
return new Locale.Builder()
.setLanguage(language)
.setRegion(country)
.setVariant(variant)
.build();
}

public static synchronized Locale getLocaleFormat() {
Expand Down
2 changes: 1 addition & 1 deletion weasis-dicom/weasis-dicom-3d/jogamp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
javafx.*;resolution:=optional,com.jogamp.plugin.ui;resolution:=optional,\
com.sun.javafx.tk;resolution:=optional,jdk.internal.module;resolution:=optional,*

-exportcontents:com.jogamp.*,gluegen.*,jogamp.*,jogl.util.*,newt.data*
-exportcontents:com.jogamp.*,gluegen.*,jogamp.*
</bnd>
</configuration>
</plugin>
Expand Down
15 changes: 9 additions & 6 deletions weasis-launcher/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
</goals>
<configuration>
<name>build.year</name>
<locale>en_US</locale>
<pattern>yyyy</pattern>
</configuration>
</execution>
Expand All @@ -85,19 +86,21 @@
<exclude>**/module-info.class</exclude>
<exclude>META-INF/LICENSE</exclude>
<exclude>META-INF/MANIFEST.MF</exclude>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
<filter>
<artifact>com.github.weisj:*</artifact>
<excludes>
<exclude>**/module-info.class</exclude>
<exclude>META-INF/LICENSE</exclude>
<exclude>META-INF/MANIFEST.MF</exclude>
</excludes>
</filter>
<filter>
<artifact>org.tukaani:*</artifact>
<excludes>
<exclude>**/module-info.class</exclude>
<exclude>META-INF/MANIFEST.MF</exclude>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1159,15 +1159,23 @@ public static Locale textToLocale(String value) {
String language = System.getProperty("user.language", "en"); // NON-NLS
String country = System.getProperty("user.country", ""); // NON-NLS
String variant = System.getProperty("user.variant", ""); // NON-NLS
return new Locale(language, country, variant);
return new Locale.Builder()
.setLanguage(language)
.setRegion(country)
.setVariant(variant)
.build();
}

String[] val = value.split("_", 3);
String language = val.length > 0 ? val[0] : "";
String country = val.length > 1 ? val[1] : "";
String variant = val.length > 2 ? val[2] : "";

return new Locale(language, country, variant);
return new Locale.Builder()
.setLanguage(language)
.setRegion(country)
.setVariant(variant)
.build();
}

private void registerAdditionalShutdownHook() {
Expand Down
35 changes: 35 additions & 0 deletions weasis-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
<assertj.version>3.24.2</assertj.version>
<mockito.version>5.2.0</mockito.version>
<byte-buddy.version>1.14.6</byte-buddy.version>
<byte-buddy-agent.version>1.14.1</byte-buddy-agent.version>
</properties>

<licenses>
Expand Down Expand Up @@ -324,6 +325,25 @@
</java>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.10</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>

<resources>
Expand Down Expand Up @@ -522,6 +542,12 @@
</dependency>

<!-- FOR TESTS -->
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy-agent</artifactId>
<version>${byte-buddy-agent.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
Expand All @@ -544,6 +570,7 @@
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>${byte-buddy.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down Expand Up @@ -628,6 +655,14 @@
</dependency>

<!-- FOR TESTS -->
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy-agent</artifactId>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
Expand Down

0 comments on commit 9a88346

Please sign in to comment.