Updated libraries to latest versions and code compatibility fixes;

This commit is contained in:
Oleg Agafonov 2019-02-17 16:12:57 +04:00
parent 971a98061d
commit 8cf681dff2
13 changed files with 106 additions and 83 deletions

View file

@ -51,7 +51,7 @@
<dependency> <dependency>
<groupId>com.mortennobel</groupId> <groupId>com.mortennobel</groupId>
<artifactId>java-image-scaling</artifactId> <artifactId>java-image-scaling</artifactId>
<version>0.8.5</version> <version>0.8.6</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.google.collections</groupId> <groupId>com.google.collections</groupId>
@ -66,12 +66,12 @@
<dependency> <dependency>
<groupId>org.jetlang</groupId> <groupId>org.jetlang</groupId>
<artifactId>jetlang</artifactId> <artifactId>jetlang</artifactId>
<version>0.2.9</version> <version>0.2.23</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.amazonaws</groupId> <groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-s3</artifactId> <artifactId>aws-java-sdk-s3</artifactId>
<version>1.11.286</version> <version>1.11.498</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.jgoodies</groupId> <groupId>com.jgoodies</groupId>
@ -114,7 +114,7 @@
<artifactId>truevfs-profile-base</artifactId> <artifactId>truevfs-profile-base</artifactId>
<groupId>net.java.truevfs</groupId> <groupId>net.java.truevfs</groupId>
<type>jar</type> <type>jar</type>
<version>0.10.8</version> <version>0.11.1</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<artifactId>truevfs-access-swing</artifactId> <artifactId>truevfs-access-swing</artifactId>
@ -129,7 +129,7 @@
<dependency> <dependency>
<groupId>com.googlecode.soundlibs</groupId> <groupId>com.googlecode.soundlibs</groupId>
<artifactId>mp3spi</artifactId> <artifactId>mp3spi</artifactId>
<version>1.9.5-1</version> <version>1.9.5.4</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javazoom</groupId> <groupId>javazoom</groupId>
@ -154,13 +154,13 @@
<dependency> <dependency>
<groupId>org.apache.xmlgraphics</groupId> <groupId>org.apache.xmlgraphics</groupId>
<artifactId>batik-transcoder</artifactId> <artifactId>batik-transcoder</artifactId>
<version>1.7</version> <version>1.11</version>
</dependency> </dependency>
<!-- svg support end --> <!-- svg support end -->
<dependency> <dependency>
<groupId>org.ocpsoft.prettytime</groupId> <groupId>org.ocpsoft.prettytime</groupId>
<artifactId>prettytime</artifactId> <artifactId>prettytime</artifactId>
<version>3.2.7.Final</version> <version>4.0.2.Final</version>
</dependency> </dependency>
</dependencies> </dependencies>

View file

@ -24,6 +24,7 @@ import org.apache.log4j.Logger;
import org.mage.card.arcane.CardRendererUtils; import org.mage.card.arcane.CardRendererUtils;
import org.ocpsoft.prettytime.Duration; import org.ocpsoft.prettytime.Duration;
import org.ocpsoft.prettytime.PrettyTime; import org.ocpsoft.prettytime.PrettyTime;
import org.ocpsoft.prettytime.TimeFormat;
import org.ocpsoft.prettytime.units.JustNow; import org.ocpsoft.prettytime.units.JustNow;
import javax.swing.*; import javax.swing.*;
@ -82,7 +83,7 @@ public class TablesPanel extends javax.swing.JPanel {
final JToggleButton[] filterButtons; final JToggleButton[] filterButtons;
// time formater // time formater
private PrettyTime timeFormater = new PrettyTime(); private PrettyTime timeFormater = new PrettyTime(Locale.ENGLISH);
// time ago renderer // time ago renderer
TableCellRenderer timeAgoCellRenderer = new DefaultTableCellRenderer() { TableCellRenderer timeAgoCellRenderer = new DefaultTableCellRenderer() {
@ -219,9 +220,12 @@ public class TablesPanel extends javax.swing.JPanel {
// tableModel.setSession(session); // tableModel.setSession(session);
// formater // formater
timeFormater.setLocale(Locale.ENGLISH); // change default just now from 60 to 30 secs
JustNow jn = timeFormater.getUnit(JustNow.class); // see workaround for 4.0 versions: https://github.com/ocpsoft/prettytime/issues/152
jn.setMaxQuantity(1000L * 30L); // 30 seconds gap (show "just now" from 0 to 30 secs) TimeFormat timeFormat = timeFormater.removeUnit(JustNow.class);
JustNow newJustNow = new JustNow();
newJustNow.setMaxQuantity(1000L * 30L); // 30 seconds gap (show "just now" from 0 to 30 secs)
timeFormater.registerUnit(newJustNow, timeFormat);
// 1. TABLE CURRENT // 1. TABLE CURRENT
tableTables.createDefaultColumnsFromModel(); tableTables.createDefaultColumnsFromModel();

View file

@ -12,7 +12,7 @@ import mage.client.util.gui.BufferedImageBuilder;
import mage.client.util.gui.GuiDisplayUtil; import mage.client.util.gui.GuiDisplayUtil;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.utils.StreamUtils; import mage.utils.StreamUtils;
import org.apache.batik.dom.svg.SVGDOMImplementation; import org.apache.batik.anim.dom.SVGDOMImplementation;
import org.apache.batik.transcoder.TranscoderException; import org.apache.batik.transcoder.TranscoderException;
import org.apache.batik.transcoder.TranscoderInput; import org.apache.batik.transcoder.TranscoderInput;
import org.apache.batik.transcoder.TranscoderOutput; import org.apache.batik.transcoder.TranscoderOutput;

View file

@ -34,12 +34,12 @@
<dependency> <dependency>
<groupId>org.jboss</groupId> <groupId>org.jboss</groupId>
<artifactId>jboss-common-core</artifactId> <artifactId>jboss-common-core</artifactId>
<version>2.2.22.GA</version> <version>2.5.0.Final</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>jboss</groupId> <groupId>jboss</groupId>
<artifactId>jboss-serialization</artifactId> <artifactId>jboss-serialization</artifactId>
<version>1.0.3.GA</version> <version>4.2.2.GA</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>concurrent</groupId> <groupId>concurrent</groupId>
@ -54,7 +54,7 @@
<dependency> <dependency>
<groupId>com.google.code.gson</groupId> <groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId> <artifactId>gson</artifactId>
<version>2.8.2</version> <version>2.8.5</version>
</dependency> </dependency>
</dependencies> </dependencies>
<!-- to get the reference to local repository with com\googlecode\jspf\jspf-core\0.9.1\ --> <!-- to get the reference to local repository with com\googlecode\jspf\jspf-core\0.9.1\ -->

View file

@ -42,7 +42,13 @@
<dependency> <dependency>
<groupId>com.sun.xml.bind</groupId> <groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId> <artifactId>jaxb-impl</artifactId>
<version>2.1.17</version> <version>2.3.2</version>
</dependency>
<dependency>
<!-- server xml config needs optional dependency for jaxb-impl -->
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>log4j</groupId>
@ -200,31 +206,31 @@
<dependency> <dependency>
<groupId>com.google.api-client</groupId> <groupId>com.google.api-client</groupId>
<artifactId>google-api-client</artifactId> <artifactId>google-api-client</artifactId>
<version>1.25.0</version> <version>1.28.0</version>
<type>jar</type> <type>jar</type>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.google.apis</groupId> <groupId>com.google.apis</groupId>
<artifactId>google-api-services-gmail</artifactId> <artifactId>google-api-services-gmail</artifactId>
<version>v1-rev82-1.23.0</version> <version>v1-rev20190120-1.28.0</version>
<type>jar</type> <type>jar</type>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.google.oauth-client</groupId> <groupId>com.google.oauth-client</groupId>
<artifactId>google-oauth-client-java6</artifactId> <artifactId>google-oauth-client-java6</artifactId>
<version>1.25.0</version> <version>1.28.0</version>
<type>jar</type> <type>jar</type>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.google.oauth-client</groupId> <groupId>com.google.oauth-client</groupId>
<artifactId>google-oauth-client-jetty</artifactId> <artifactId>google-oauth-client-jetty</artifactId>
<version>1.25.0</version> <version>1.28.0</version>
<type>jar</type> <type>jar</type>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.mail</groupId> <groupId>javax.mail</groupId>
<artifactId>mail</artifactId> <artifactId>mail</artifactId>
<version>1.4.7</version> <version>1.5.0-b01</version>
<type>jar</type> <type>jar</type>
</dependency> </dependency>
<dependency> <dependency>

View file

@ -9,9 +9,6 @@ import com.j256.ormlite.stmt.SelectArg;
import com.j256.ormlite.support.ConnectionSource; import com.j256.ormlite.support.ConnectionSource;
import com.j256.ormlite.support.DatabaseConnection; import com.j256.ormlite.support.DatabaseConnection;
import com.j256.ormlite.table.TableUtils; import com.j256.ormlite.table.TableUtils;
import java.io.File;
import java.sql.SQLException;
import java.util.List;
import mage.cards.repository.CardRepository; import mage.cards.repository.CardRepository;
import mage.cards.repository.RepositoryUtil; import mage.cards.repository.RepositoryUtil;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
@ -21,6 +18,10 @@ import org.apache.shiro.crypto.hash.Hash;
import org.apache.shiro.crypto.hash.Sha256Hash; import org.apache.shiro.crypto.hash.Sha256Hash;
import org.apache.shiro.crypto.hash.SimpleHash; import org.apache.shiro.crypto.hash.SimpleHash;
import java.io.File;
import java.sql.SQLException;
import java.util.List;
public enum AuthorizedUserRepository { public enum AuthorizedUserRepository {
instance; instance;
@ -108,7 +109,7 @@ public enum AuthorizedUserRepository {
public void closeDB() { public void closeDB() {
try { try {
if (dao != null && dao.getConnectionSource() != null) { if (dao != null && dao.getConnectionSource() != null) {
DatabaseConnection conn = dao.getConnectionSource().getReadWriteConnection(); DatabaseConnection conn = dao.getConnectionSource().getReadWriteConnection(dao.getTableName());
conn.executeStatement("shutdown compact", 0); conn.executeStatement("shutdown compact", 0);
} }
} catch (SQLException ex) { } catch (SQLException ex) {

View file

@ -8,11 +8,12 @@ import com.j256.ormlite.stmt.SelectArg;
import com.j256.ormlite.support.ConnectionSource; import com.j256.ormlite.support.ConnectionSource;
import com.j256.ormlite.support.DatabaseConnection; import com.j256.ormlite.support.DatabaseConnection;
import com.j256.ormlite.table.TableUtils; import com.j256.ormlite.table.TableUtils;
import mage.cards.repository.RepositoryUtil;
import org.apache.log4j.Logger;
import java.io.File; import java.io.File;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.List; import java.util.List;
import mage.cards.repository.RepositoryUtil;
import org.apache.log4j.Logger;
public enum TableRecordRepository { public enum TableRecordRepository {
@ -68,7 +69,7 @@ public enum TableRecordRepository {
public void closeDB() { public void closeDB() {
try { try {
if (dao != null && dao.getConnectionSource() != null) { if (dao != null && dao.getConnectionSource() != null) {
DatabaseConnection conn = dao.getConnectionSource().getReadWriteConnection(); DatabaseConnection conn = dao.getConnectionSource().getReadWriteConnection(dao.getTableName());
conn.executeStatement("shutdown compact", 0); conn.executeStatement("shutdown compact", 0);
} }
} catch (SQLException ex) { } catch (SQLException ex) {

View file

@ -111,7 +111,7 @@ public enum UserStatsRepository {
public List<String> updateUserStats() { public List<String> updateUserStats() {
Set<String> updatedUsers = new HashSet<>(); Set<String> updatedUsers = new HashSet<>();
// Lock the DB so that no other updateUserStats runs at the same time. // Lock the DB so that no other updateUserStats runs at the same time.
synchronized(this) { synchronized (this) {
long latestEndTimeMs = this.getLatestEndTimeMs(); long latestEndTimeMs = this.getLatestEndTimeMs();
List<TableRecord> records = TableRecordRepository.instance.getAfter(latestEndTimeMs); List<TableRecord> records = TableRecordRepository.instance.getAfter(latestEndTimeMs);
for (TableRecord record : records) { for (TableRecord record : records) {
@ -370,7 +370,7 @@ public enum UserStatsRepository {
public void closeDB() { public void closeDB() {
try { try {
if (dao != null && dao.getConnectionSource() != null) { if (dao != null && dao.getConnectionSource() != null) {
DatabaseConnection conn = dao.getConnectionSource().getReadWriteConnection(); DatabaseConnection conn = dao.getConnectionSource().getReadWriteConnection(dao.getTableName());
conn.executeStatement("shutdown compact", 0); conn.executeStatement("shutdown compact", 0);
} }
} catch (SQLException ex) { } catch (SQLException ex) {

View file

@ -43,13 +43,13 @@
<dependency> <dependency>
<groupId>net.minidev</groupId> <groupId>net.minidev</groupId>
<artifactId>json-smart</artifactId> <artifactId>json-smart</artifactId>
<version>2.1.1</version> <version>2.3</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.aspectj</groupId> <groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId> <artifactId>aspectjrt</artifactId>
<version>1.8.2</version> <version>1.9.2</version>
</dependency> </dependency>
<dependency> <dependency>
@ -62,26 +62,26 @@
<dependency> <dependency>
<groupId>org.jboss.resteasy</groupId> <groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId> <artifactId>resteasy-jaxrs</artifactId>
<version>2.3.7.Final</version> <version>4.0.0.Beta5</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>ch.qos.logback</groupId> <groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId> <artifactId>logback-classic</artifactId>
<version>1.2.3</version> <version>1.3.0-alpha4</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.sling</groupId> <groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.commons.json</artifactId> <artifactId>org.apache.sling.commons.json</artifactId>
<version>2.0.10</version> <version>2.0.20</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.jboss.resteasy</groupId> <groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-multipart-provider</artifactId> <artifactId>resteasy-multipart-provider</artifactId>
<version>2.3.1.GA</version> <version>4.0.0.Beta8</version>
</dependency> </dependency>
<dependency> <dependency>
@ -93,19 +93,19 @@
<dependency> <dependency>
<groupId>commons-httpclient</groupId> <groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId> <artifactId>commons-httpclient</artifactId>
<version>3.1</version> <version>3.1-jbossorg-1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId> <artifactId>servlet-api</artifactId>
<version>2.5</version> <version>3.0-alpha-1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>joda-time</groupId> <groupId>joda-time</groupId>
<artifactId>joda-time</artifactId> <artifactId>joda-time</artifactId>
<version>2.7</version> <version>2.10.1</version>
</dependency> </dependency>
</dependencies> </dependencies>

View file

@ -64,6 +64,17 @@
<artifactId>mage-game-freeforall</artifactId> <artifactId>mage-game-freeforall</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.2</version>
</dependency>
<dependency>
<!-- server xml config needs optional dependency for jaxb-impl -->
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.2</version>
</dependency>
</dependencies> </dependencies>
<build> <build>

View file

@ -23,13 +23,13 @@
<dependency> <dependency>
<groupId>com.h2database</groupId> <groupId>com.h2database</groupId>
<artifactId>h2</artifactId> <artifactId>h2</artifactId>
<version>1.4.187</version> <version>1.4.197</version>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.j256.ormlite</groupId> <groupId>com.j256.ormlite</groupId>
<artifactId>ormlite-jdbc</artifactId> <artifactId>ormlite-jdbc</artifactId>
<version>4.48</version> <version>5.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
@ -38,7 +38,7 @@
<dependency> <dependency>
<groupId>com.google.protobuf</groupId> <groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId> <artifactId>protobuf-java</artifactId>
<version>3.6.0</version> <version>3.7.0-rc1</version>
</dependency> </dependency>
</dependencies> </dependencies>

View file

@ -506,7 +506,7 @@ public enum CardRepository {
public void closeDB() { public void closeDB() {
try { try {
if (cardDao != null && cardDao.getConnectionSource() != null) { if (cardDao != null && cardDao.getConnectionSource() != null) {
DatabaseConnection conn = cardDao.getConnectionSource().getReadWriteConnection(); DatabaseConnection conn = cardDao.getConnectionSource().getReadWriteConnection(cardDao.getTableName());
conn.executeStatement("shutdown compact", 0); conn.executeStatement("shutdown compact", 0);
} }
} catch (SQLException ex) { } catch (SQLException ex) {

View file

@ -98,7 +98,7 @@
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.12</version> <version>4.13-beta-2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>log4j</groupId>
@ -108,7 +108,7 @@
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId> <artifactId>slf4j-log4j12</artifactId>
<version>1.7.25</version> <version>1.8.0-beta2</version>
</dependency> </dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>