This is an automated email from the git hooks/post-receive script.

fnatter-guest pushed a commit to branch master
in repository libjsyntaxpane-java.

commit 5747a30a4467f996ddf864fe0472c9cb6a309559
Author: Felix Natter <fnat...@gmx.net>
Date:   Tue Apr 24 21:32:24 2018 +0200

    Fix java 9 problem (ported from https://github.com/nordfalk/jsyntaxpane)
---
 debian/changelog           |   7 ++++
 debian/compat              |   2 +-
 debian/control             |   2 +-
 debian/patches/disable-pom |  85 ++++++++++++++++++++++++++++++++++++++
 debian/patches/java9-fix   | 100 +++++++++++++++++++++++++++++++++++++++++++++
 debian/patches/series      |   2 +
 6 files changed, 196 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 7bd5fcc..2430a62 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+libjsyntaxpane-java (0.9.6~r156-7) UNRELEASED; urgency=medium
+
+  * Fix java 9 problem (ported from https://github.com/nordfalk/jsyntaxpane)
+  * Patch out pom.xml to avoid maven build
+
+ -- Felix Natter <fnat...@gmx.net>  Tue, 24 Apr 2018 19:43:37 +0200
+
 libjsyntaxpane-java (0.9.6~r156-6) unstable; urgency=medium
 
   * Remove myself from the uploaders.
diff --git a/debian/compat b/debian/compat
index 7f8f011..b4de394 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-7
+11
diff --git a/debian/control b/debian/control
index cdf1314..6f2a7fe 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: libjsyntaxpane-java
 Section: java
 Priority: optional
 Maintainer: Debian Java Maintainers 
<pkg-java-maintain...@lists.alioth.debian.org>
-Build-Depends: debhelper (>= 7.0.50~), javahelper (>= 0.32), jflex
+Build-Depends: debhelper (>= 11), javahelper (>= 0.32), jflex
 Build-Depends-Indep: default-jdk
 Standards-Version: 3.9.4
 Vcs-Git: git://anonscm.debian.org/pkg-java/libjsyntaxpane-java.git
diff --git a/debian/patches/disable-pom b/debian/patches/disable-pom
new file mode 100644
index 0000000..cf9c278
--- /dev/null
+++ b/debian/patches/disable-pom
@@ -0,0 +1,85 @@
+--- a/pom.xml
++++ /dev/null
+@@ -1,82 +0,0 @@
+-<?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>
+-  <groupId>jsyntaxpane</groupId>
+-  <artifactId>jsyntaxpane</artifactId>
+-  <packaging>jar</packaging>
+-  <version>0.9.6</version>
+-  <name>jsyntaxpane</name>
+-  <description>A very simple to use and extend JEditorKit that supports few 
languages. The main goal is to make it easy to have nice looking Java Swing 
Editors with support for Syntax Highlighting.</description>
+-  <url>http://jsyntaxpane.googlecode.com/</url>
+-
+-  <licenses>
+-    <license>
+-      <name>The Apache Software License, Version 2.0</name>
+-      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
+-      <distribution>repo</distribution>
+-    </license>
+-  </licenses>
+-
+-  <scm>
+-    <url>http://jsyntaxpane.googlecode.com/svn/</url>
+-  </scm>
+-
+-  <pluginRepositories>
+-    <pluginRepository>
+-      <id>jflex</id>
+-      <name>JFlex repository</name>
+-      <url>http://jflex.sourceforge.net/repo/</url>
+-    </pluginRepository>
+-  </pluginRepositories>
+-  
+-  <build>
+-    <plugins>
+-      <plugin>
+-        <artifactId>maven-compiler-plugin</artifactId>
+-        <version>2.3</version>
+-        <configuration>
+-          <source>1.6</source>
+-          <target>1.6</target>
+-        </configuration>
+-      </plugin>
+-      <plugin>
+-        <groupId>org.apache.maven.plugins</groupId>
+-        <artifactId>maven-jar-plugin</artifactId>
+-        <configuration>
+-          <excludes>
+-            <exclude>**/Thumbs.db</exclude>
+-          </excludes>        
+-          <archive>
+-            <manifest>
+-              <mainClass>jsyntaxpane.SyntaxTester</mainClass>
+-              <packageName>jsyntaxpane</packageName>
+-              <addClasspath>true</addClasspath>
+-              <classpathPrefix />
+-            </manifest>
+-            <manifestEntries>
+-              <mode>development</mode>
+-              <url>${pom.url}</url>
+-            </manifestEntries>
+-          </archive>
+-        </configuration>
+-      </plugin>
+-      <plugin>
+-        <groupId>de.jflex</groupId>
+-        <artifactId>maven-jflex-plugin</artifactId>
+-        <!--version>0.2</version-->
+-        <executions>
+-          <execution>
+-            <goals>
+-              <goal>generate</goal>
+-            </goals>
+-          </execution>
+-        </executions>
+-      </plugin>
+-    </plugins>
+-  </build>
+-
+-  <properties>
+-    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+-  </properties>
+-
+-</project>
diff --git a/debian/patches/java9-fix b/debian/patches/java9-fix
new file mode 100644
index 0000000..fff7b4d
--- /dev/null
+++ b/debian/patches/java9-fix
@@ -0,0 +1,100 @@
+Description: Fix issue with java9
+Author: Jacob Nordfalk <jacob.nordf...@gmail.com>
+Origin: 
https://github.com/nordfalk/jsyntaxpane/commit/5fc75594f8bc4df6e8f7096d4a440490b768fd46
+Forwarded: not-needed
+Reviewed-by: Felix Natter <fnat...@gmx.net>
+Last-Update: 2018-04-24
+--- a/src/main/java/jsyntaxpane/CompoundUndoMan.java
++++ b/src/main/java/jsyntaxpane/CompoundUndoMan.java
+@@ -20,6 +20,7 @@
+ import javax.swing.undo.CompoundEdit;
+ import javax.swing.undo.UndoManager;
+ import javax.swing.undo.UndoableEdit;
++import javax.swing.undo.*;
+ 
+ /**
+  * A revised UndoManager that groups undos based on positions.  If the change 
is relatively next to the
+@@ -37,6 +38,8 @@
+  */
+ public class CompoundUndoMan extends UndoManager {
+ 
++     private final SyntaxDocument doc;
++    
+       private CompoundEdit compoundEdit;
+       // This allows us to start combining operations.
+       // it will be reset after the first change.
+@@ -46,6 +49,7 @@
+       private int     lastLine = -1;
+ 
+       public CompoundUndoMan(SyntaxDocument doc) {
++                  this.doc = doc;
+               doc.addUndoableEditListener(this);
+               lastLine = doc.getStartPosition().getOffset();
+       }
+@@ -57,8 +61,8 @@
+       @Override
+       public void undoableEditHappened(UndoableEditEvent e) {
+               //  Start a new compound edit
+-
+-              AbstractDocument.DefaultDocumentEvent docEvt = 
(DefaultDocumentEvent) e.getEdit();
++          
++              //AbstractDocument.DefaultDocumentEvent docEvt = 
(DefaultDocumentEvent) e.getEdit();
+ 
+               if (compoundEdit == null) {
+                       compoundEdit = startCompoundEdit(e.getEdit());
+@@ -66,6 +70,7 @@
+                       return;
+               }
+ 
++              /*
+               int editLine = 
((SyntaxDocument)docEvt.getDocument()).getLineNumberAt(docEvt.getOffset());
+ 
+               //  Check for an incremental edit or backspace.
+@@ -79,6 +84,38 @@
+ 
+               //  Not incremental edit, end previous edit and start a new one
+               lastLine = editLine;
++              */
++
++               if (e.getEdit() instanceof DefaultDocumentEvent) {
++                   // Java 6 to 8
++                   AbstractDocument.DefaultDocumentEvent docEvt = 
(DefaultDocumentEvent) e.getEdit();
++
++                   int editLine = doc.getLineNumberAt(docEvt.getOffset());
++
++                   //  Check for an incremental edit or backspace.
++                   //  The Change in Caret position and Document length 
should both be
++                   //  either 1 or -1.
++                   if ((startCombine || Math.abs(docEvt.getLength()) == 1) && 
editLine == lastLine) {
++                       compoundEdit.addEdit(e.getEdit());
++                       startCombine = false;
++                       //updateDirty();
++                       return;
++                   }
++
++                   //  Not incremental edit, end previous edit and start a 
new one
++                   lastLine = editLine;
++
++               } else {
++                   // Java 9: It seems that all the edits are wrapped and we 
cannot get line number!
++                   // See 
https://github.com/netroby/jdk9-dev/blob/master/jdk/src/java.desktop/share/classes/javax/swing/text/AbstractDocument.java#L279
++                   // AbstractDocument.DefaultDocumentEventUndoableWrapper 
docEvt = e.getEdit();
++                   if (startCombine && !e.getEdit().isSignificant()) {
++                       compoundEdit.addEdit(e.getEdit());
++                       startCombine = false;
++                       //updateDirty();
++                       return;
++                   }
++               }
+ 
+               compoundEdit.end();
+               compoundEdit = startCompoundEdit(e.getEdit());
+@@ -90,7 +127,7 @@
+        */
+       private CompoundEdit startCompoundEdit(UndoableEdit anEdit) {
+               //  Track Caret and Document information of this compound edit
+-              AbstractDocument.DefaultDocumentEvent docEvt = 
(DefaultDocumentEvent) anEdit;
++              //AbstractDocument.DefaultDocumentEvent docEvt = 
(DefaultDocumentEvent) anEdit;
+ 
+               //  The compound edit is used to store incremental edits
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 3d794b7..1035375 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,5 @@ NPE_null_scroll_pane
 load-bundle-i18n
 scala-property-comments
 js-problem-java8
+java9-fix
+disable-pom

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-java/libjsyntaxpane-java.git

_______________________________________________
pkg-java-commits mailing list
pkg-java-comm...@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-java-commits

Reply via email to