You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/03/04 14:42:11 UTC

[commons-jelly] branch master updated (2fb5fc15 -> 76985325)

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-jelly.git


    from 2fb5fc15 codecov-commenter => notifications
     new 1b94d1ee Fix compiling on Java 7 and up
     new afaf66cd Bump Java from 7 to 8
     new 76985325 Use StringBuilder instead of StringBuffer for internal processing

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../jelly/expression/CompositeExpression.java      |  8 ++--
 .../apache/commons/jelly/servlet/JellyServlet.java |  2 +-
 .../jelly/tags/jetty/JellyResourceHttpHandler.java | 23 +++++-----
 .../commons/jelly/tags/sql/DataSourceWrapper.java  |  7 +++
 .../apache/commons/jelly/tags/swing/ActionTag.java |  2 +-
 .../commons/jelly/tags/util/LoadTextTag.java       |  2 +-
 .../jelly/tags/velocity/VelocityTagSupport.java    |  2 +-
 .../org/apache/commons/jelly/tags/xml/SetTag.java  |  4 +-
 pom.xml                                            |  9 ++--
 src/changes/changes.xml                            | 51 ++++++++++++++++++++++
 10 files changed, 83 insertions(+), 27 deletions(-)
 create mode 100644 src/changes/changes.xml


[commons-jelly] 03/03: Use StringBuilder instead of StringBuffer for internal processing

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-jelly.git

commit 7698532588ae3f73207b9600e4c63fb40a2850a7
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Mar 4 09:42:06 2023 -0500

    Use StringBuilder instead of StringBuffer for internal processing
---
 .../jelly/expression/CompositeExpression.java      |  8 ++++----
 .../apache/commons/jelly/servlet/JellyServlet.java |  2 +-
 .../jelly/tags/jetty/JellyResourceHttpHandler.java | 23 ++++++++++------------
 .../apache/commons/jelly/tags/swing/ActionTag.java |  2 +-
 .../commons/jelly/tags/util/LoadTextTag.java       |  2 +-
 .../jelly/tags/velocity/VelocityTagSupport.java    |  2 +-
 .../org/apache/commons/jelly/tags/xml/SetTag.java  |  4 ++--
 7 files changed, 20 insertions(+), 23 deletions(-)

diff --git a/core/src/main/java/org/apache/commons/jelly/expression/CompositeExpression.java b/core/src/main/java/org/apache/commons/jelly/expression/CompositeExpression.java
index f91a469a..a5be69dd 100644
--- a/core/src/main/java/org/apache/commons/jelly/expression/CompositeExpression.java
+++ b/core/src/main/java/org/apache/commons/jelly/expression/CompositeExpression.java
@@ -89,8 +89,8 @@ public class CompositeExpression extends ExpressionSupport {
         int cur = 0;
         char c = 0;
 
-        StringBuffer chars = new StringBuffer();
-        StringBuffer expr  = new StringBuffer();
+        StringBuilder chars = new StringBuilder();
+        StringBuilder expr  = new StringBuilder();
 
       MAIN:
         while ( cur < len ) {
@@ -244,7 +244,7 @@ public class CompositeExpression extends ExpressionSupport {
     //-------------------------------------------------------------------------
 
     public String getExpressionText() {
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder buffer = new StringBuilder();
         for (Iterator iter = expressions.iterator(); iter.hasNext(); ) {
             Expression expression = (Expression) iter.next();
             buffer.append( expression.getExpressionText() );
@@ -260,7 +260,7 @@ public class CompositeExpression extends ExpressionSupport {
 
     // inherit javadoc from interface
     public String evaluateAsString(JellyContext context) {
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder buffer = new StringBuilder();
         for (Iterator iter = expressions.iterator(); iter.hasNext(); ) {
             Expression expression = (Expression) iter.next();
             String value = expression.evaluateAsString(context);
diff --git a/core/src/main/java/org/apache/commons/jelly/servlet/JellyServlet.java b/core/src/main/java/org/apache/commons/jelly/servlet/JellyServlet.java
index 05686f36..f5cda0b1 100644
--- a/core/src/main/java/org/apache/commons/jelly/servlet/JellyServlet.java
+++ b/core/src/main/java/org/apache/commons/jelly/servlet/JellyServlet.java
@@ -173,7 +173,7 @@ public class JellyServlet extends HttpServlet {
         Exception cause)
         throws ServletException, IOException {
 
-        StringBuffer html = new StringBuffer();
+        StringBuilder html = new StringBuilder();
         html.append("<html>");
         html.append("<title>Error</title>");
         html.append("<body bgcolor=\"#ffffff\">");
diff --git a/jelly-tags/jetty/src/main/java/org/apache/commons/jelly/tags/jetty/JellyResourceHttpHandler.java b/jelly-tags/jetty/src/main/java/org/apache/commons/jelly/tags/jetty/JellyResourceHttpHandler.java
index 6d2e3dbf..f65e8778 100644
--- a/jelly-tags/jetty/src/main/java/org/apache/commons/jelly/tags/jetty/JellyResourceHttpHandler.java
+++ b/jelly-tags/jetty/src/main/java/org/apache/commons/jelly/tags/jetty/JellyResourceHttpHandler.java
@@ -17,26 +17,23 @@
 
 package org.apache.commons.jelly.tags.jetty;
 
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.HashMap;
+import java.util.Map;
+
 import org.apache.commons.jelly.JellyContext;
 import org.apache.commons.jelly.Tag;
 import org.apache.commons.jelly.XMLOutput;
-
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.mortbay.http.HttpException;
 import org.mortbay.http.HttpRequest;
 import org.mortbay.http.HttpResponse;
 import org.mortbay.http.handler.AbstractHttpHandler;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.lang.StringBuffer;
-import java.util.HashMap;
-import java.util.Map;
-
 /**
  * The actual http handler implementation for an http context in an http server
  *
@@ -130,7 +127,7 @@ class JellyResourceHttpHandler extends AbstractHttpHandler {
         InputStream is = request.getInputStream();
         InputStreamReader isr = new InputStreamReader(is);
         BufferedReader br = new BufferedReader(isr);
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         char[] buffer = new char[1024];
         int len;
 
diff --git a/jelly-tags/swing/src/main/java/org/apache/commons/jelly/tags/swing/ActionTag.java b/jelly-tags/swing/src/main/java/org/apache/commons/jelly/tags/swing/ActionTag.java
index 8b3cd19f..f40abe1d 100644
--- a/jelly-tags/swing/src/main/java/org/apache/commons/jelly/tags/swing/ActionTag.java
+++ b/jelly-tags/swing/src/main/java/org/apache/commons/jelly/tags/swing/ActionTag.java
@@ -173,7 +173,7 @@ public class ActionTag extends UseBeanTag {
         if ( Character.isUpperCase( ch ) ) {
             return text;
         }
-        StringBuffer buffer = new StringBuffer(text.length());
+        StringBuilder buffer = new StringBuilder(text.length());
         buffer.append( Character.toUpperCase( ch ) );
         buffer.append( text.substring(1) );
         return buffer.toString();
diff --git a/jelly-tags/util/src/main/java/org/apache/commons/jelly/tags/util/LoadTextTag.java b/jelly-tags/util/src/main/java/org/apache/commons/jelly/tags/util/LoadTextTag.java
index 20758c4f..303882de 100644
--- a/jelly-tags/util/src/main/java/org/apache/commons/jelly/tags/util/LoadTextTag.java
+++ b/jelly-tags/util/src/main/java/org/apache/commons/jelly/tags/util/LoadTextTag.java
@@ -176,7 +176,7 @@ public class LoadTextTag extends TagSupport {
      * Loads all the text from the given Reader
      */
     protected String loadText(Reader reader) throws IOException {
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder buffer = new StringBuilder();
 
         try {
             char[] charBuffer = new char[ 4096 ];
diff --git a/jelly-tags/velocity/src/main/java/org/apache/commons/jelly/tags/velocity/VelocityTagSupport.java b/jelly-tags/velocity/src/main/java/org/apache/commons/jelly/tags/velocity/VelocityTagSupport.java
index 08bbb560..72a86a63 100644
--- a/jelly-tags/velocity/src/main/java/org/apache/commons/jelly/tags/velocity/VelocityTagSupport.java
+++ b/jelly-tags/velocity/src/main/java/org/apache/commons/jelly/tags/velocity/VelocityTagSupport.java
@@ -78,7 +78,7 @@ public abstract class VelocityTagSupport extends TagSupport
      */
     private String keyName( String basedir )
     {
-        return new StringBuffer()
+        return new StringBuilder()
             .append( VELOCITY_ENGINE_VAR_NAME )
             .append( '.' )
             .append( basedir )
diff --git a/jelly-tags/xml/src/main/java/org/apache/commons/jelly/tags/xml/SetTag.java b/jelly-tags/xml/src/main/java/org/apache/commons/jelly/tags/xml/SetTag.java
index ba391c34..eccb2c96 100644
--- a/jelly-tags/xml/src/main/java/org/apache/commons/jelly/tags/xml/SetTag.java
+++ b/jelly-tags/xml/src/main/java/org/apache/commons/jelly/tags/xml/SetTag.java
@@ -153,7 +153,7 @@ public class SetTag extends XPathTagSupport {
         
         // finally convert the result to a concatenated string if delimiter is defined
         if(delimiter != null && value instanceof List) {
-            StringBuffer buff = new StringBuffer();
+            StringBuilder buff = new StringBuilder();
             for(Iterator it = ((List) value).iterator(); it.hasNext(); ) {
                 Object v = it.next();
                 if (v instanceof Node) {
@@ -220,7 +220,7 @@ public class SetTag extends XPathTagSupport {
     }
 
     private String joinDelimitedElements( final List values ) {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         int sz = values.size();
         for (int i = 0; i < sz; i++) {
             String s = (String)values.get(i); 


[commons-jelly] 02/03: Bump Java from 7 to 8

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-jelly.git

commit afaf66cd1a4ac3798daefcb9e739a8fc56d2254a
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Mar 4 09:42:01 2023 -0500

    Bump Java from 7 to 8
---
 pom.xml                 |  9 +++++----
 src/changes/changes.xml | 51 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 56 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 12577a54..a542e957 100644
--- a/pom.xml
+++ b/pom.xml
@@ -59,8 +59,8 @@
   <properties>
     <project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>
     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
+    <maven.compiler.source>1.8</maven.compiler.source>
+    <maven.compiler.target>1.8</maven.compiler.target>
     <!--
        This is also  used to generate download_xxx file name.
        To override this when generating the download page:
@@ -71,7 +71,7 @@
     <commons.componentid>jelly</commons.componentid>
     <!-- Current 3.x release series -->
     <commons.release.version>1.1</commons.release.version>
-    <commons.release.desc>(Java 7.0+)</commons.release.desc>
+    <commons.release.desc>(Java 8)</commons.release.desc>
     <commons.jira.id>JELLY</commons.jira.id>
     <commons.jira.pid>10012</commons.jira.pid>
 
@@ -335,7 +335,8 @@
     </notifiers>
   </ciManagement>
   <build>
-    <pluginManagement>
+	<defaultGoal>clean verify</defaultGoal>
+	<pluginManagement>
       <plugins>
         <plugin>
           <artifactId>maven-compiler-plugin</artifactId>
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
new file mode 100644
index 00000000..48586c64
--- /dev/null
+++ b/src/changes/changes.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ 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.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!--
+This file is used by the maven-changes-plugin to generate the release notes.
+Useful ways of finding items to add to this file are:
+
+1.  Add items when you fix a bug or add a feature (this makes the
+release process easy :-).
+
+2.  Do a Jira search for tickets closed since the previous release.
+
+3.  Use the report generated by the maven-changelog-plugin to see all
+CVS commits.  Set the project.properties' maven.changelog.range
+property to the number of days since the last release.
+
+
+To generate the release notes from this file:
+
+mvn changes:announcement-generate -Prelease-notes [-Dchanges.version=nnn]
+
+then tweak the source formatting if necessary and regenerate, then commit
+
+The <action> type attribute can be add,update,fix,remove.
+-->
+<document>
+  <properties>
+    <title>Apache Commons IO Release Notes</title>
+  </properties>
+
+  <body>
+    <release version="1.1.0" date="YYYY-MM-DD" description="Java 8 required.">
+      <action type="update]" due-to="ggregory">Bump Java from 7 to 8.</action>
+    </release>
+  </body>
+</document>


[commons-jelly] 01/03: Fix compiling on Java 7 and up

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-jelly.git

commit 1b94d1eeeedb87476ace86d28c4bb83d3ed17953
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Mar 4 09:38:58 2023 -0500

    Fix compiling on Java 7 and up
    
    Implement Java 7 abstract method
    javax.sql.CommonDataSource.getParentLogger()
---
 .../java/org/apache/commons/jelly/tags/sql/DataSourceWrapper.java  | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/jelly-tags/sql/src/main/java/org/apache/commons/jelly/tags/sql/DataSourceWrapper.java b/jelly-tags/sql/src/main/java/org/apache/commons/jelly/tags/sql/DataSourceWrapper.java
index 1e8d5bef..1f1f946f 100644
--- a/jelly-tags/sql/src/main/java/org/apache/commons/jelly/tags/sql/DataSourceWrapper.java
+++ b/jelly-tags/sql/src/main/java/org/apache/commons/jelly/tags/sql/DataSourceWrapper.java
@@ -21,6 +21,8 @@ import java.io.PrintWriter;
 import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
+import java.util.logging.Logger;
 
 import javax.sql.DataSource;
 
@@ -141,4 +143,9 @@ public class DataSourceWrapper implements DataSource {
         throw new SQLException(Resources.getMessage("NOT_SUPPORTED"));
     }
 
+    @Override
+    public Logger getParentLogger() throws SQLFeatureNotSupportedException {
+        throw new SQLFeatureNotSupportedException();
+    }
+
 }