Browse Source

Merge branch 'release/10.0' of https://cloud.finedevelop.com/scm/~hugh.c/base-third into release/10.0

release/10.0
Hugh.C 5 years ago
parent
commit
55c918e434
  1. 3
      build.third_step2-jdk11.gradle
  2. 1
      build.third_step2.gradle
  3. 2
      fine-druid/src/com/fr/third/alibaba/druid/pool/DruidAbstractDataSource.java
  4. 10
      fine-druid/src/com/fr/third/alibaba/druid/pool/DruidDataSource.java
  5. 2
      fine-hibernate/src/com/fr/third/org/hibernate/dialect/DB2Dialect.java
  6. 49
      fine-jackson/src/com/fr/third/fasterxml/jackson/databind/jsontype/impl/SubTypeValidator.java
  7. 65
      fine-log4j/src/com/fr/third/apache/log4j/DailyRollingFileAppender.java
  8. 1
      fine-xmlgraphics/xmlgraphics-commons/src/main/resources/META-INF/services/javax.xml.transform.URIResolver
  9. 4
      fine-xmlgraphics/xmlgraphics-commons/src/main/resources/META-INF/services/org.apache.xmlgraphics.image.loader.spi.ImageConverter
  10. 6
      fine-xmlgraphics/xmlgraphics-commons/src/main/resources/META-INF/services/org.apache.xmlgraphics.image.loader.spi.ImageLoaderFactory
  11. 8
      fine-xmlgraphics/xmlgraphics-commons/src/main/resources/META-INF/services/org.apache.xmlgraphics.image.loader.spi.ImagePreloader
  12. 5
      fine-xmlgraphics/xmlgraphics-commons/src/main/resources/META-INF/services/org.apache.xmlgraphics.image.writer.ImageWriter

3
build.third_step2-jdk11.gradle

@ -85,7 +85,8 @@ def resourceDirs = [
"${srcDir}/fine-redisson/src", "${srcDir}/fine-redisson/src",
"${srcDir}/fine-xmlgraphics/xmlgraphics-batik/src/main/java", "${srcDir}/fine-xmlgraphics/xmlgraphics-batik/src/main/java",
"${srcDir}/fine-xmlgraphics/xmlgraphics-batik/src/main/resources", "${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') sourceSets.main.java.outputDir = file('build/classes/2')

1
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/java")
with dataContent.call("${srcDir}/fine-xmlgraphics/xmlgraphics-batik/src/main/resources") 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/java")
with dataContent.call("${srcDir}/fine-xmlgraphics/xmlgraphics-commons/src/main/resources")
into "${classesDir}" into "${classesDir}"
} }
} }

2
fine-druid/src/com/fr/third/alibaba/druid/pool/DruidAbstractDataSource.java

@ -1361,7 +1361,7 @@ public abstract class DruidAbstractDataSource extends WrapperAdapter implements
return true; return true;
} catch (Exception ex) { } catch (Exception ex) {
// skip LOG.debug(ex.getMessage(), ex);
return false; return false;
} finally { } finally {
if (sqlFile != null) { if (sqlFile != null) {

10
fine-druid/src/com/fr/third/alibaba/druid/pool/DruidDataSource.java

@ -953,21 +953,21 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
return; return;
} }
String errorMessage = ""; String infoMessage = "";
if (isTestOnBorrow()) { if (isTestOnBorrow()) {
errorMessage += "testOnBorrow is true, "; infoMessage += "testOnBorrow is true, ";
} }
if (isTestOnReturn()) { if (isTestOnReturn()) {
errorMessage += "testOnReturn is true, "; infoMessage += "testOnReturn is true, ";
} }
if (isTestWhileIdle()) { if (isTestWhileIdle()) {
errorMessage += "testWhileIdle is true, "; infoMessage += "testWhileIdle is true, ";
} }
LOG.error(errorMessage + "validationQuery not set"); LOG.info(infoMessage + "validationQuery not set");
} }
protected void initCheck() throws SQLException { protected void initCheck() throws SQLException {

2
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.INTEGER, "integer" );
registerColumnType( Types.CHAR, "char(1)" ); registerColumnType( Types.CHAR, "char(1)" );
registerColumnType( Types.VARCHAR, "varchar($l)" ); registerColumnType( Types.VARCHAR, "varchar($l)" );
// DEC-12348 db2数据库9.7版本不会自动将nvarchar转varchar,需要在方言内处理
registerColumnType( Types.NVARCHAR, "varchar($l)" );
registerColumnType( Types.FLOAT, "float" ); registerColumnType( Types.FLOAT, "float" );
registerColumnType( Types.DOUBLE, "double" ); registerColumnType( Types.DOUBLE, "double" );
registerColumnType( Types.DATE, "date" ); registerColumnType( Types.DATE, "date" );

49
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) // [databind#2341]: jdom/jdom2 (2.9.9.1)
s.add("org.jdom.transform.XSLTransformer"); s.add("org.jdom.transform.XSLTransformer");
s.add("org.jdom2.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); DEFAULT_NO_DESER_CLASS_NAMES = Collections.unmodifiableSet(s);
} }

65
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 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 not use this file except in compliance with
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 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.helpers.LogLog;
import com.fr.third.apache.log4j.spi.LoggingEvent; import com.fr.third.apache.log4j.spi.LoggingEvent;
import java.io.IOException;
import java.io.File; import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InterruptedIOException; import java.io.InterruptedIOException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.GregorianCalendar; import java.util.GregorianCalendar;
import java.util.Calendar;
import java.util.TimeZone;
import java.util.Locale; import java.util.Locale;
import java.util.TimeZone;
import java.util.zip.GZIPOutputStream;
/** /**
DailyRollingFileAppender extends {@link FileAppender} so that the DailyRollingFileAppender extends {@link FileAppender} so that the
underlying file is rolled over at a user chosen frequency. 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 synchronization issues and data loss. The log4j extras
companion includes alternatives which should be considered companion includes alternatives which should be considered
for new deployments and which are discussed in the documentation 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 String datePattern = "'.'yyyy-MM-dd";
private static final String COMPRESS_SUFFIX = ".gz";
/** /**
The log file will be renamed to the value of the The log file will be renamed to the value of the
scheduledFilename variable when the next interval is entered. For scheduledFilename variable when the next interval is entered. For
example, if the rollover period is one hour, the log file will be example, if the rollover period is one hour, the log file will be
renamed to the value of "scheduledFilename" at the beginning of 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 The precise time when a rollover occurs depends on logging
activity. activity.
*/ */
private String scheduledFilename; private String scheduledFilename;
@ -227,7 +232,7 @@ public class DailyRollingFileAppender extends FileAppender {
printPeriodicity(type); printPeriodicity(type);
rc.setType(type); rc.setType(type);
File file = new File(fileName); File file = new File(fileName);
scheduledFilename = fileName+sdf.format(new Date(file.lastModified())); scheduledFilename = fileName+sdf.format(new Date(file.lastModified()))+COMPRESS_SUFFIX;
} else { } else {
LogLog.error("Either File or DatePattern options are not set for appender [" LogLog.error("Either File or DatePattern options are not set for appender ["
@ -307,7 +312,7 @@ public class DailyRollingFileAppender extends FileAppender {
return; 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 // It is too early to roll over because we are still within the
// bounds of the current interval. Rollover will occur once the // bounds of the current interval. Rollover will occur once the
// next interval is reached. // next interval is reached.
@ -315,7 +320,7 @@ public class DailyRollingFileAppender extends FileAppender {
return; return;
} }
// close current file, and rename it to datedFilename // close current file, and compress it to datedFilename
this.closeFile(); this.closeFile();
File target = new File(scheduledFilename); File target = new File(scheduledFilename);
@ -324,8 +329,36 @@ public class DailyRollingFileAppender extends FileAppender {
} }
File file = new File(fileName); 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) { if(result) {
file.delete();
LogLog.debug(fileName +" -> "+ scheduledFilename); LogLog.debug(fileName +" -> "+ scheduledFilename);
} else { } else {
LogLog.error("Failed to rename ["+fileName+"] to ["+scheduledFilename+"]."); LogLog.error("Failed to rename ["+fileName+"] to ["+scheduledFilename+"].");
@ -372,7 +405,7 @@ public class DailyRollingFileAppender extends FileAppender {
/** /**
* RollingCalendar is a helper class to DailyRollingFileAppender. * RollingCalendar is a helper class to DailyRollingFileAppender.
* Given a periodicity type and the current time, it computes the * 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 { class RollingCalendar extends GregorianCalendar {
private static final long serialVersionUID = -3560331770601814177L; private static final long serialVersionUID = -3560331770601814177L;
@ -381,11 +414,11 @@ class RollingCalendar extends GregorianCalendar {
RollingCalendar() { RollingCalendar() {
super(); super();
} }
RollingCalendar(TimeZone tz, Locale locale) { RollingCalendar(TimeZone tz, Locale locale) {
super(tz, locale); super(tz, locale);
} }
void setType(int type) { void setType(int type) {
this.type = type; this.type = type;

1
fine-xmlgraphics/xmlgraphics-commons/src/main/resources/META-INF/services/javax.xml.transform.URIResolver

@ -0,0 +1 @@
org.apache.xmlgraphics.util.uri.DataURIResolver

4
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

6
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

8
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

5
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
Loading…
Cancel
Save