Skip to content

The Unified and Autonomous Development Platform

midwork

robin shinecb714b5d917c
diff --git a/commons.lang/pom.xml b/commons.lang/pom.xml
index 3750b4936e..1d3d40362f 100644
--- a/commons.lang/pom.xml
+++ b/commons.lang/pom.xml
@@ -1,91 +1,95 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <artifactId>commons.lang</artifactId>
- <version>1.0.0</version>
- <parent>
- <groupId>com.pmease</groupId>
- <artifactId>parent.general</artifactId>
- <version>1.0.31</version>
- </parent>
-
- <build>
- <plugins>
- <plugin>
- <groupId>com.pmease</groupId>
- <artifactId>plugin.maven</artifactId>
- </plugin>
- <!-- Uncomment below if you'd like to publish an archetype based on your
- plugin -->
- <!--plugin> <artifactId>maven-archetype-plugin</artifactId> </plugin -->
- <plugin>
- <artifactId>maven-source-plugin</artifactId>
- </plugin>
- <plugin>
- <artifactId>maven-javadoc-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.antlr</groupId>
- <artifactId>antlr4-maven-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>com.pmease</groupId>
- <artifactId>commons.loader</artifactId>
- <version>1.0.31</version>
- </dependency>
- <dependency>
- <groupId>org.webjars</groupId>
- <artifactId>codemirror</artifactId>
- <version>5.1</version>
- </dependency>
- <dependency>
- <groupId>com.pmease</groupId>
- <artifactId>commons.loader</artifactId>
- <version>1.0.31</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.pmease</groupId>
- <artifactId>commons.util</artifactId>
- <version>1.0.31</version>
- </dependency>
- <dependency>
- <groupId>com.pmease</groupId>
- <artifactId>commons.wicket</artifactId>
- <version>1.0.29</version>
- </dependency>
- <dependency>
- <groupId>com.pmease</groupId>
- <artifactId>commons.antlr</artifactId>
- <version>1.0.0</version>
- </dependency>
- </dependencies>
-
- <repositories>
- <repository>
- <id>pmeaseRepo</id>
- <name>PMEase Repository</name>
- <releases>
- <enabled>true</enabled>
- <updatePolicy>never</updatePolicy>
- <checksumPolicy>fail</checksumPolicy>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- <updatePolicy>always</updatePolicy>
- <checksumPolicy>fail</checksumPolicy>
- </snapshots>
- <url>http://artifact.pmease.com/</url>
- </repository>
- </repositories>
-
- <properties>
- <moduleClass>com.pmease.commons.lang.LangModule</moduleClass>
- </properties>
-
-</project>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>commons.lang</artifactId>
+ <version>1.0.0</version>
+ <parent>
+ <groupId>com.pmease</groupId>
+ <artifactId>parent.general</artifactId>
+ <version>1.0.31</version>
+ </parent>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.pmease</groupId>
+ <artifactId>plugin.maven</artifactId>
+ </plugin>
+ <!-- Uncomment below if you'd like to publish an archetype based on your
+ plugin -->
+ <!--plugin> <artifactId>maven-archetype-plugin</artifactId> </plugin -->
+ <plugin>
+ <artifactId>maven-source-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.antlr</groupId>
+ <artifactId>antlr4-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.pmease</groupId>
+ <artifactId>commons.loader</artifactId>
+ <version>1.0.31</version>
+ </dependency>
+ <dependency>
+ <groupId>org.webjars</groupId>
+ <artifactId>codemirror</artifactId>
+ <version>5.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.unbescape</groupId>
+ <artifactId>unbescape</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.pmease</groupId>
+ <artifactId>commons.loader</artifactId>
+ <version>1.0.31</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.pmease</groupId>
+ <artifactId>commons.util</artifactId>
+ <version>1.0.31</version>
+ </dependency>
+ <dependency>
+ <groupId>com.pmease</groupId>
+ <artifactId>commons.wicket</artifactId>
+ <version>1.0.29</version>
+ </dependency>
+ <dependency>
+ <groupId>com.pmease</groupId>
+ <artifactId>commons.antlr</artifactId>
+ <version>1.0.0</version>
+ </dependency>
+ </dependencies>
+
+ <repositories>
+ <repository>
+ <id>pmeaseRepo</id>
+ <name>PMEase Repository</name>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ <checksumPolicy>fail</checksumPolicy>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ <updatePolicy>always</updatePolicy>
+ <checksumPolicy>fail</checksumPolicy>
+ </snapshots>
+ <url>http://artifact.pmease.com/</url>
+ </repository>
+ </repositories>
+
+ <properties>
+ <moduleClass>com.pmease.commons.lang.LangModule</moduleClass>
+ </properties>
+
+</project>
diff --git a/commons.lang/src/main/java/com/pmease/commons/lang/tokenizers/CmToken.java b/commons.lang/src/main/java/com/pmease/commons/lang/tokenizers/CmToken.java
index 99df7c22ca..3b755f8d32 100644
--- a/commons.lang/src/main/java/com/pmease/commons/lang/tokenizers/CmToken.java
+++ b/commons.lang/src/main/java/com/pmease/commons/lang/tokenizers/CmToken.java
@@ -2,8 +2,8 @@ package com.pmease.commons.lang.tokenizers;
import java.io.Serializable;
-import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.lang3.StringUtils;
+import org.unbescape.html.HtmlEscape;
import com.google.common.base.Objects;
import com.google.common.base.Splitter;
@@ -140,11 +140,15 @@ public class CmToken implements Serializable {
}
public String toHtml(Operation operation) {
- String escapedText;
- if (text.equals("\f"))
- escapedText = "";
- else
- escapedText = StringEscapeUtils.escapeHtml4(text);
+ String escapedText = "";
+ for (int i=0; i<text.length(); i++) {
+ char ch = text.charAt(i);
+ if (Character.isWhitespace(ch))
+ escapedText += " ";
+ else
+ escapedText += ch;
+ }
+ escapedText = HtmlEscape.escapeHtml5(escapedText);
if (operation == Operation.EQUAL && StringUtils.isBlank(type)) {
return escapedText;
diff --git a/gitplex.product/src/test/java/gitplex/product/Test.java b/gitplex.product/src/test/java/gitplex/product/Test.java
index 987a09f8d3..fe1b77434c 100644
--- a/gitplex.product/src/test/java/gitplex/product/Test.java
+++ b/gitplex.product/src/test/java/gitplex/product/Test.java
@@ -1,16 +1,12 @@
package gitplex.product;
-import java.io.File;
import java.io.IOException;
-import com.pmease.commons.util.FileUtils;
-
public class Test {
@org.junit.Test
public void test() throws IOException {
- System.out.println("hello\fworld");
- FileUtils.writeFile(new File("w:\\temp\\formfeed"), "hello\fworld");
+ System.out.println(Character.isWhitespace('\f'));
}
}
\ No newline at end of file
diff --git a/gitplex.web/pom.xml b/gitplex.web/pom.xml
index d087fb327d..646f40b49b 100644
--- a/gitplex.web/pom.xml
+++ b/gitplex.web/pom.xml
@@ -1,123 +1,119 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <artifactId>gitplex.web</artifactId>
- <version>1.0.0</version>
- <parent>
- <groupId>com.pmease</groupId>
- <artifactId>parent.general</artifactId>
- <version>1.0.31</version>
- </parent>
- <build>
- <plugins>
- <plugin>
- <groupId>com.pmease</groupId>
- <artifactId>plugin.maven</artifactId>
- </plugin>
- <plugin>
- <artifactId>maven-source-plugin</artifactId>
- </plugin>
- <plugin>
- <artifactId>maven-javadoc-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.antlr</groupId>
- <artifactId>antlr4-maven-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>com.pmease</groupId>
- <artifactId>gitplex.core</artifactId>
- <version>1.0.31</version>
- </dependency>
- <dependency>
- <groupId>com.pmease</groupId>
- <artifactId>commons.wicket</artifactId>
- <version>1.0.29</version>
- </dependency>
- <dependency>
- <groupId>com.pmease</groupId>
- <artifactId>commons.jetty</artifactId>
- <version>1.0.31</version>
- </dependency>
- <dependency>
- <groupId>com.pmease</groupId>
- <artifactId>gitplex.rest</artifactId>
- <version>1.0.0</version>
- </dependency>
- <dependency>
- <groupId>org.unbescape</groupId>
- <artifactId>unbescape</artifactId>
- </dependency>
-
- <!-- JERSEY CLIENT -->
- <dependency>
- <groupId>org.glassfish.jersey.core</groupId>
- <artifactId>jersey-client</artifactId>
- <version>${jerseyVersion}</version>
- </dependency>
- <dependency>
- <groupId>commons-fileupload</groupId>
- <artifactId>commons-fileupload</artifactId>
- <version>1.3</version>
- </dependency>
- <dependency>
- <groupId>commons-validator</groupId>
- <artifactId>commons-validator</artifactId>
- <version>1.4.0</version>
- </dependency>
-
- <dependency>
- <groupId>org.ocpsoft.prettytime</groupId>
- <artifactId>prettytime</artifactId>
- <version>3.2.4.Final</version>
- </dependency>
- <dependency>
- <groupId>com.pmease</groupId>
- <artifactId>gitplex.search</artifactId>
- <version>1.0.0</version>
- </dependency>
- </dependencies>
-
- <repositories>
- <repository>
- <id>pmeaseRepo</id>
- <name>PMEase Repository</name>
- <releases>
- <enabled>true</enabled>
- <updatePolicy>never</updatePolicy>
- <checksumPolicy>fail</checksumPolicy>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- <updatePolicy>always</updatePolicy>
- <checksumPolicy>fail</checksumPolicy>
- </snapshots>
- <url>http://artifact.pmease.com/</url>
- </repository>
-
- <repository>
- <id>local-repo</id>
- <name>Local Closure Repo</name>
- <releases>
- <enabled>true</enabled>
- <checksumPolicy>ignore</checksumPolicy>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <url>file://${project.basedir}/repo</url>
- </repository>
- </repositories>
-
- <properties>
- <moduleClass>com.pmease.gitplex.web.WebModule</moduleClass>
- <owsi-core.version>0.8.6-SNAPSHOT</owsi-core.version>
- <tika.version>1.4</tika.version>
- <wikitext.version>2.0.0</wikitext.version>
- </properties>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>gitplex.web</artifactId>
+ <version>1.0.0</version>
+ <parent>
+ <groupId>com.pmease</groupId>
+ <artifactId>parent.general</artifactId>
+ <version>1.0.31</version>
+ </parent>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.pmease</groupId>
+ <artifactId>plugin.maven</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-source-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.antlr</groupId>
+ <artifactId>antlr4-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>com.pmease</groupId>
+ <artifactId>gitplex.core</artifactId>
+ <version>1.0.31</version>
+ </dependency>
+ <dependency>
+ <groupId>com.pmease</groupId>
+ <artifactId>commons.wicket</artifactId>
+ <version>1.0.29</version>
+ </dependency>
+ <dependency>
+ <groupId>com.pmease</groupId>
+ <artifactId>commons.jetty</artifactId>
+ <version>1.0.31</version>
+ </dependency>
+ <dependency>
+ <groupId>com.pmease</groupId>
+ <artifactId>gitplex.rest</artifactId>
+ <version>1.0.0</version>
+ </dependency>
+
+ <!-- JERSEY CLIENT -->
+ <dependency>
+ <groupId>org.glassfish.jersey.core</groupId>
+ <artifactId>jersey-client</artifactId>
+ <version>${jerseyVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-fileupload</groupId>
+ <artifactId>commons-fileupload</artifactId>
+ <version>1.3</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-validator</groupId>
+ <artifactId>commons-validator</artifactId>
+ <version>1.4.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.ocpsoft.prettytime</groupId>
+ <artifactId>prettytime</artifactId>
+ <version>3.2.4.Final</version>
+ </dependency>
+ <dependency>
+ <groupId>com.pmease</groupId>
+ <artifactId>gitplex.search</artifactId>
+ <version>1.0.0</version>
+ </dependency>
+ </dependencies>
+
+ <repositories>
+ <repository>
+ <id>pmeaseRepo</id>
+ <name>PMEase Repository</name>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ <checksumPolicy>fail</checksumPolicy>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ <updatePolicy>always</updatePolicy>
+ <checksumPolicy>fail</checksumPolicy>
+ </snapshots>
+ <url>http://artifact.pmease.com/</url>
+ </repository>
+
+ <repository>
+ <id>local-repo</id>
+ <name>Local Closure Repo</name>
+ <releases>
+ <enabled>true</enabled>
+ <checksumPolicy>ignore</checksumPolicy>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ <url>file://${project.basedir}/repo</url>
+ </repository>
+ </repositories>
+
+ <properties>
+ <moduleClass>com.pmease.gitplex.web.WebModule</moduleClass>
+ <owsi-core.version>0.8.6-SNAPSHOT</owsi-core.version>
+ <tika.version>1.4</tika.version>
+ <wikitext.version>2.0.0</wikitext.version>
+ </properties>
+</project>
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/blob/text/TextDiffPanel.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/blob/text/TextDiffPanel.java
index 6965f654a0..c5829a23b0 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/blob/text/TextDiffPanel.java
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/component/diff/blob/text/TextDiffPanel.java
@@ -525,8 +525,9 @@ public class TextDiffPanel extends Panel {
if (lastContextSize == 0)
appendAddComment(contentBuilder, oldLineNo, newLineNo);
contentBuilder.append("<span class='operation'>&nbsp;</span>");
- for (CmToken token: block.getUnits().get(lineIndex))
+ for (CmToken token: block.getUnits().get(lineIndex)) {
contentBuilder.append(token.toHtml(Operation.EQUAL));
+ }
contentBuilder.append("</td>");
if (diffMode == DiffMode.UNIFIED) {