From 17fe45e9f24ac315b61ef2e5e15aedd938a39aec Mon Sep 17 00:00:00 2001 From: Zed Date: Mon, 2 Mar 2020 11:10:41 +0800 Subject: [PATCH 1/6] =?UTF-8?q?DEC-12256=20=E3=80=90=E5=86=92=E7=83=9F?= =?UTF-8?q?=E3=80=91=E5=85=A8=E6=96=B0=E5=B7=A5=E7=A8=8B=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/third/alibaba/druid/pool/DruidDataSource.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fine-druid/src/com/fr/third/alibaba/druid/pool/DruidDataSource.java b/fine-druid/src/com/fr/third/alibaba/druid/pool/DruidDataSource.java index ef1481c9d..301f2391f 100644 --- a/fine-druid/src/com/fr/third/alibaba/druid/pool/DruidDataSource.java +++ b/fine-druid/src/com/fr/third/alibaba/druid/pool/DruidDataSource.java @@ -953,21 +953,21 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat return; } - String errorMessage = ""; + String infoMessage = ""; if (isTestOnBorrow()) { - errorMessage += "testOnBorrow is true, "; + infoMessage += "testOnBorrow is true, "; } if (isTestOnReturn()) { - errorMessage += "testOnReturn is true, "; + infoMessage += "testOnReturn is true, "; } if (isTestWhileIdle()) { - errorMessage += "testWhileIdle is true, "; + infoMessage += "testWhileIdle is true, "; } - LOG.error(errorMessage + "validationQuery not set"); + LOG.error(infoMessage + "validationQuery not set"); } protected void initCheck() throws SQLException { From 1b0f322d29a4d9e6071d13759ff0526b0e3734c2 Mon Sep 17 00:00:00 2001 From: Zed Date: Mon, 2 Mar 2020 11:12:32 +0800 Subject: [PATCH 2/6] fix --- .../src/com/fr/third/alibaba/druid/pool/DruidDataSource.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fine-druid/src/com/fr/third/alibaba/druid/pool/DruidDataSource.java b/fine-druid/src/com/fr/third/alibaba/druid/pool/DruidDataSource.java index 301f2391f..26793c544 100644 --- a/fine-druid/src/com/fr/third/alibaba/druid/pool/DruidDataSource.java +++ b/fine-druid/src/com/fr/third/alibaba/druid/pool/DruidDataSource.java @@ -967,7 +967,7 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat infoMessage += "testWhileIdle is true, "; } - LOG.error(infoMessage + "validationQuery not set"); + LOG.info(infoMessage + "validationQuery not set"); } protected void initCheck() throws SQLException { From b7a8919a6c5705d15d82d56ed4ced0112eff163c Mon Sep 17 00:00:00 2001 From: Zed Date: Wed, 4 Mar 2020 14:43:11 +0800 Subject: [PATCH 3/6] =?UTF-8?q?REPORT-27588=20jackson-databind=E5=AE=89?= =?UTF-8?q?=E5=85=A8=E6=BC=8F=E6=B4=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jsontype/impl/SubTypeValidator.java | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/fine-jackson/src/com/fr/third/fasterxml/jackson/databind/jsontype/impl/SubTypeValidator.java b/fine-jackson/src/com/fr/third/fasterxml/jackson/databind/jsontype/impl/SubTypeValidator.java index 970c29171..e2e52655b 100644 --- a/fine-jackson/src/com/fr/third/fasterxml/jackson/databind/jsontype/impl/SubTypeValidator.java +++ b/fine-jackson/src/com/fr/third/fasterxml/jackson/databind/jsontype/impl/SubTypeValidator.java @@ -88,6 +88,55 @@ public class SubTypeValidator // [databind#2341]: jdom/jdom2 (2.9.9.1) s.add("org.jdom.transform.XSLTransformer"); s.add("org.jdom2.transform.XSLTransformer"); + + // [databind#2387], [databind#2460]: EHCache + s.add("net.sf.ehcache.transaction.manager.DefaultTransactionManagerLookup"); + s.add("net.sf.ehcache.hibernate.EhcacheJtaTransactionManagerLookup"); + + // [databind#2389]: logback/jndi + s.add("ch.qos.logback.core.db.JNDIConnectionSource"); + + // [databind#2410]: HikariCP/metricRegistry config + s.add("com.zaxxer.hikari.HikariConfig"); + // [databind#2449]: and sub-class thereof + s.add("com.zaxxer.hikari.HikariDataSource"); + + // [databind#2420]: CXF/JAX-RS provider/XSLT + s.add("org.apache.cxf.jaxrs.provider.XSLTJaxbProvider"); + + // [databind#2462]: commons-configuration / -2 + s.add("org.apache.commons.configuration.JNDIConfiguration"); + s.add("org.apache.commons.configuration2.JNDIConfiguration"); + + // [databind#2469]: xalan2 + s.add("org.apache.xalan.lib.sql.JNDIConnectionPool"); + + // [databind#2478]: comons-dbcp, p6spy + s.add("org.apache.commons.dbcp.datasources.PerUserPoolDataSource"); + s.add("org.apache.commons.dbcp.datasources.SharedPoolDataSource"); + s.add("com.p6spy.engine.spy.P6DataSource"); + + // [databind#2498]: log4j-extras (1.2) + s.add("org.apache.log4j.receivers.db.DriverManagerConnectionSource"); + s.add("org.apache.log4j.receivers.db.JNDIConnectionSource"); + + // [databind#2526]: some more ehcache + s.add("net.sf.ehcache.transaction.manager.selector.GenericJndiSelector"); + s.add("net.sf.ehcache.transaction.manager.selector.GlassfishSelector"); + + // [databind#2620]: xbean-reflect + s.add("org.apache.xbean.propertyeditor.JndiConverter"); + + // [databind#2631]: shaded hikari-config + s.add("org.apache.hadoop.shaded.com.zaxxer.hikari.HikariConfig"); + + // [databind#2634]: ibatis-sqlmap, anteros-core + s.add("com.ibatis.sqlmap.engine.transaction.jta.JtaTransactionConfig"); + s.add("br.com.anteros.dbcp.AnterosDBCPConfig"); + + // [databind#2642]: javax.swing (jdk) + s.add("javax.swing.JEditorPane"); + DEFAULT_NO_DESER_CLASS_NAMES = Collections.unmodifiableSet(s); } From 4e831051b9b005a3bc94069b22f678d371ba6843 Mon Sep 17 00:00:00 2001 From: Zed Date: Mon, 9 Mar 2020 15:50:58 +0800 Subject: [PATCH 4/6] =?UTF-8?q?DEC-12348=20=E5=A4=96=E7=BD=AE=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E5=AF=BC=E5=85=A5=E6=95=B0=E6=8D=AE=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/third/org/hibernate/dialect/DB2Dialect.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fine-hibernate/src/com/fr/third/org/hibernate/dialect/DB2Dialect.java b/fine-hibernate/src/com/fr/third/org/hibernate/dialect/DB2Dialect.java index 5f5fc4476..7c3433709 100644 --- a/fine-hibernate/src/com/fr/third/org/hibernate/dialect/DB2Dialect.java +++ b/fine-hibernate/src/com/fr/third/org/hibernate/dialect/DB2Dialect.java @@ -93,6 +93,8 @@ public class DB2Dialect extends Dialect { registerColumnType( Types.INTEGER, "integer" ); registerColumnType( Types.CHAR, "char(1)" ); registerColumnType( Types.VARCHAR, "varchar($l)" ); + // DEC-12348 db2数据库9.7版本不会自动将nvarchar转varchar,需要在方言内处理 + registerColumnType( Types.NVARCHAR, "varchar($l)" ); registerColumnType( Types.FLOAT, "float" ); registerColumnType( Types.DOUBLE, "double" ); registerColumnType( Types.DATE, "date" ); From f068030caf86c87e4b6a4c359c9a347920562ab0 Mon Sep 17 00:00:00 2001 From: zhouping Date: Tue, 10 Mar 2020 18:14:40 +0800 Subject: [PATCH 5/6] =?UTF-8?q?REPORT-27578=20=E3=80=9010.0=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E3=80=91=E6=A8=A1=E7=89=88=E5=AF=BC=E5=87=BAsvg=200kb?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.third_step2-jdk11.gradle | 3 ++- build.third_step2.gradle | 1 + .../third/alibaba/druid/pool/DruidAbstractDataSource.java | 2 +- .../META-INF/services/javax.xml.transform.URIResolver | 1 + ...org.apache.xmlgraphics.image.loader.spi.ImageConverter | 4 ++++ ...apache.xmlgraphics.image.loader.spi.ImageLoaderFactory | 6 ++++++ ...org.apache.xmlgraphics.image.loader.spi.ImagePreloader | 8 ++++++++ .../org.apache.xmlgraphics.image.writer.ImageWriter | 5 +++++ 8 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 fine-xmlgraphics/xmlgraphics-commons/src/main/resources/META-INF/services/javax.xml.transform.URIResolver create mode 100644 fine-xmlgraphics/xmlgraphics-commons/src/main/resources/META-INF/services/org.apache.xmlgraphics.image.loader.spi.ImageConverter create mode 100644 fine-xmlgraphics/xmlgraphics-commons/src/main/resources/META-INF/services/org.apache.xmlgraphics.image.loader.spi.ImageLoaderFactory create mode 100644 fine-xmlgraphics/xmlgraphics-commons/src/main/resources/META-INF/services/org.apache.xmlgraphics.image.loader.spi.ImagePreloader create mode 100644 fine-xmlgraphics/xmlgraphics-commons/src/main/resources/META-INF/services/org.apache.xmlgraphics.image.writer.ImageWriter diff --git a/build.third_step2-jdk11.gradle b/build.third_step2-jdk11.gradle index b7e7c1092..d0eadb737 100644 --- a/build.third_step2-jdk11.gradle +++ b/build.third_step2-jdk11.gradle @@ -85,7 +85,8 @@ def resourceDirs = [ "${srcDir}/fine-redisson/src", "${srcDir}/fine-xmlgraphics/xmlgraphics-batik/src/main/java", "${srcDir}/fine-xmlgraphics/xmlgraphics-batik/src/main/resources", - "${srcDir}/fine-xmlgraphics/xmlgraphics-commons/src/main/java" + "${srcDir}/fine-xmlgraphics/xmlgraphics-commons/src/main/java", + "${srcDir}/fine-xmlgraphics/xmlgraphics-commons/src/main/resources" ] sourceSets.main.java.outputDir = file('build/classes/2') diff --git a/build.third_step2.gradle b/build.third_step2.gradle index 2bd6311c5..bb1206816 100644 --- a/build.third_step2.gradle +++ b/build.third_step2.gradle @@ -123,6 +123,7 @@ task copyFiles(type:Copy,dependsOn:'compileJava'){ with dataContent.call("${srcDir}/fine-xmlgraphics/xmlgraphics-batik/src/main/java") with dataContent.call("${srcDir}/fine-xmlgraphics/xmlgraphics-batik/src/main/resources") with dataContent.call("${srcDir}/fine-xmlgraphics/xmlgraphics-commons/src/main/java") + with dataContent.call("${srcDir}/fine-xmlgraphics/xmlgraphics-commons/src/main/resources") into "${classesDir}" } } diff --git a/fine-druid/src/com/fr/third/alibaba/druid/pool/DruidAbstractDataSource.java b/fine-druid/src/com/fr/third/alibaba/druid/pool/DruidAbstractDataSource.java index b905427db..d1e669618 100644 --- a/fine-druid/src/com/fr/third/alibaba/druid/pool/DruidAbstractDataSource.java +++ b/fine-druid/src/com/fr/third/alibaba/druid/pool/DruidAbstractDataSource.java @@ -1361,7 +1361,7 @@ public abstract class DruidAbstractDataSource extends WrapperAdapter implements return true; } catch (Exception ex) { - // skip + LOG.debug(ex.getMessage(), ex); return false; } finally { if (sqlFile != null) { diff --git a/fine-xmlgraphics/xmlgraphics-commons/src/main/resources/META-INF/services/javax.xml.transform.URIResolver b/fine-xmlgraphics/xmlgraphics-commons/src/main/resources/META-INF/services/javax.xml.transform.URIResolver new file mode 100644 index 000000000..9202f619a --- /dev/null +++ b/fine-xmlgraphics/xmlgraphics-commons/src/main/resources/META-INF/services/javax.xml.transform.URIResolver @@ -0,0 +1 @@ +org.apache.xmlgraphics.util.uri.DataURIResolver diff --git a/fine-xmlgraphics/xmlgraphics-commons/src/main/resources/META-INF/services/org.apache.xmlgraphics.image.loader.spi.ImageConverter b/fine-xmlgraphics/xmlgraphics-commons/src/main/resources/META-INF/services/org.apache.xmlgraphics.image.loader.spi.ImageConverter new file mode 100644 index 000000000..24b0d8b04 --- /dev/null +++ b/fine-xmlgraphics/xmlgraphics-commons/src/main/resources/META-INF/services/org.apache.xmlgraphics.image.loader.spi.ImageConverter @@ -0,0 +1,4 @@ +org.apache.xmlgraphics.image.loader.impl.ImageConverterBuffered2Rendered +org.apache.xmlgraphics.image.loader.impl.ImageConverterG2D2Bitmap +org.apache.xmlgraphics.image.loader.impl.ImageConverterBitmap2G2D +org.apache.xmlgraphics.image.loader.impl.ImageConverterRendered2PNG diff --git a/fine-xmlgraphics/xmlgraphics-commons/src/main/resources/META-INF/services/org.apache.xmlgraphics.image.loader.spi.ImageLoaderFactory b/fine-xmlgraphics/xmlgraphics-commons/src/main/resources/META-INF/services/org.apache.xmlgraphics.image.loader.spi.ImageLoaderFactory new file mode 100644 index 000000000..e1efed257 --- /dev/null +++ b/fine-xmlgraphics/xmlgraphics-commons/src/main/resources/META-INF/services/org.apache.xmlgraphics.image.loader.spi.ImageLoaderFactory @@ -0,0 +1,6 @@ +org.apache.xmlgraphics.image.loader.impl.imageio.ImageLoaderFactoryImageIO +org.apache.xmlgraphics.image.loader.impl.ImageLoaderFactoryRaw +org.apache.xmlgraphics.image.loader.impl.ImageLoaderFactoryRawCCITTFax +org.apache.xmlgraphics.image.loader.impl.ImageLoaderFactoryEPS +org.apache.xmlgraphics.image.loader.impl.ImageLoaderFactoryInternalTIFF +org.apache.xmlgraphics.image.loader.impl.ImageLoaderFactoryPNG diff --git a/fine-xmlgraphics/xmlgraphics-commons/src/main/resources/META-INF/services/org.apache.xmlgraphics.image.loader.spi.ImagePreloader b/fine-xmlgraphics/xmlgraphics-commons/src/main/resources/META-INF/services/org.apache.xmlgraphics.image.loader.spi.ImagePreloader new file mode 100644 index 000000000..e2c8c004b --- /dev/null +++ b/fine-xmlgraphics/xmlgraphics-commons/src/main/resources/META-INF/services/org.apache.xmlgraphics.image.loader.spi.ImagePreloader @@ -0,0 +1,8 @@ +org.apache.xmlgraphics.image.loader.impl.PreloaderTIFF +org.apache.xmlgraphics.image.loader.impl.PreloaderGIF +org.apache.xmlgraphics.image.loader.impl.PreloaderJPEG +org.apache.xmlgraphics.image.loader.impl.PreloaderBMP +org.apache.xmlgraphics.image.loader.impl.PreloaderEMF +org.apache.xmlgraphics.image.loader.impl.PreloaderEPS +org.apache.xmlgraphics.image.loader.impl.imageio.PreloaderImageIO +org.apache.xmlgraphics.image.loader.impl.PreloaderRawPNG \ No newline at end of file diff --git a/fine-xmlgraphics/xmlgraphics-commons/src/main/resources/META-INF/services/org.apache.xmlgraphics.image.writer.ImageWriter b/fine-xmlgraphics/xmlgraphics-commons/src/main/resources/META-INF/services/org.apache.xmlgraphics.image.writer.ImageWriter new file mode 100644 index 000000000..9f67d4a6c --- /dev/null +++ b/fine-xmlgraphics/xmlgraphics-commons/src/main/resources/META-INF/services/org.apache.xmlgraphics.image.writer.ImageWriter @@ -0,0 +1,5 @@ +org.apache.xmlgraphics.image.writer.internal.PNGImageWriter +org.apache.xmlgraphics.image.writer.internal.TIFFImageWriter +org.apache.xmlgraphics.image.writer.imageio.ImageIOPNGImageWriter +org.apache.xmlgraphics.image.writer.imageio.ImageIOTIFFImageWriter +org.apache.xmlgraphics.image.writer.imageio.ImageIOJPEGImageWriter From 109c9a7862ad0465aa934172311cc61d1a87f1ad Mon Sep 17 00:00:00 2001 From: bokai Date: Thu, 12 Mar 2020 14:19:21 +0800 Subject: [PATCH 6/6] =?UTF-8?q?REPORT-27582=20=E8=AE=BE=E8=AE=A1=E5=99=A8-?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=B2=A1=E6=9C=89=E7=94=9F=E6=88=90=E5=8E=8B?= =?UTF-8?q?=E7=BC=A9=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../log4j/DailyRollingFileAppender.java | 65 ++++++++++++++----- 1 file changed, 49 insertions(+), 16 deletions(-) diff --git a/fine-log4j/src/com/fr/third/apache/log4j/DailyRollingFileAppender.java b/fine-log4j/src/com/fr/third/apache/log4j/DailyRollingFileAppender.java index 669ce9a0a..e23b4bb85 100644 --- a/fine-log4j/src/com/fr/third/apache/log4j/DailyRollingFileAppender.java +++ b/fine-log4j/src/com/fr/third/apache/log4j/DailyRollingFileAppender.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -21,21 +21,24 @@ package com.fr.third.apache.log4j; import com.fr.third.apache.log4j.helpers.LogLog; import com.fr.third.apache.log4j.spi.LoggingEvent; -import java.io.IOException; import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; import java.io.InterruptedIOException; import java.text.SimpleDateFormat; +import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; -import java.util.Calendar; -import java.util.TimeZone; import java.util.Locale; +import java.util.TimeZone; +import java.util.zip.GZIPOutputStream; /** DailyRollingFileAppender extends {@link FileAppender} so that the underlying file is rolled over at a user chosen frequency. - - DailyRollingFileAppender has been observed to exhibit + + DailyRollingFileAppender has been observed to exhibit synchronization issues and data loss. The log4j extras companion includes alternatives which should be considered for new deployments and which are discussed in the documentation @@ -158,15 +161,17 @@ public class DailyRollingFileAppender extends FileAppender { */ private String datePattern = "'.'yyyy-MM-dd"; + private static final String COMPRESS_SUFFIX = ".gz"; + /** The log file will be renamed to the value of the scheduledFilename variable when the next interval is entered. For example, if the rollover period is one hour, the log file will be renamed to the value of "scheduledFilename" at the beginning of - the next hour. + the next hour. The precise time when a rollover occurs depends on logging - activity. + activity. */ private String scheduledFilename; @@ -227,7 +232,7 @@ public class DailyRollingFileAppender extends FileAppender { printPeriodicity(type); rc.setType(type); File file = new File(fileName); - scheduledFilename = fileName+sdf.format(new Date(file.lastModified())); + scheduledFilename = fileName+sdf.format(new Date(file.lastModified()))+COMPRESS_SUFFIX; } else { LogLog.error("Either File or DatePattern options are not set for appender [" @@ -307,7 +312,7 @@ public class DailyRollingFileAppender extends FileAppender { return; } - String datedFilename = fileName+sdf.format(now); + String datedFilename = fileName+sdf.format(now)+COMPRESS_SUFFIX; // It is too early to roll over because we are still within the // bounds of the current interval. Rollover will occur once the // next interval is reached. @@ -315,7 +320,7 @@ public class DailyRollingFileAppender extends FileAppender { return; } - // close current file, and rename it to datedFilename + // close current file, and compress it to datedFilename this.closeFile(); File target = new File(scheduledFilename); @@ -324,8 +329,36 @@ public class DailyRollingFileAppender extends FileAppender { } File file = new File(fileName); - boolean result = file.renameTo(target); + boolean result = false; + + FileInputStream fis = null; + FileOutputStream fos = null; + GZIPOutputStream gzos = null; + try { + fis = new FileInputStream(file); + fos = new FileOutputStream(target); + gzos = new GZIPOutputStream(fos); + byte[] inbuf = new byte[8102]; + int n; + + while ((n = fis.read(inbuf)) != -1) { + gzos.write(inbuf, 0, n); + } + result = true; + } catch (Exception e){ + LogLog.error("Compress " + fileName + " to " + scheduledFilename + " failed."); + LogLog.error(e.getMessage(), e); + } finally { + if(gzos!=null) { + gzos.close(); + } + if (fis != null) { + fis.close(); + } + } + if(result) { + file.delete(); LogLog.debug(fileName +" -> "+ scheduledFilename); } else { LogLog.error("Failed to rename ["+fileName+"] to ["+scheduledFilename+"]."); @@ -372,7 +405,7 @@ public class DailyRollingFileAppender extends FileAppender { /** * RollingCalendar is a helper class to DailyRollingFileAppender. * Given a periodicity type and the current time, it computes the - * start of the next interval. + * start of the next interval. * */ class RollingCalendar extends GregorianCalendar { private static final long serialVersionUID = -3560331770601814177L; @@ -381,11 +414,11 @@ class RollingCalendar extends GregorianCalendar { RollingCalendar() { super(); - } + } RollingCalendar(TimeZone tz, Locale locale) { super(tz, locale); - } + } void setType(int type) { this.type = type;