Permalink
Browse files

Upgrade to JDK 1.7

  • Loading branch information...
gquerret committed Mar 13, 2017
1 parent 1c752c3 commit e157ef1b7f3db8f3f13fc0c04c846b63f3269a8c
Showing with 271 additions and 409 deletions.
  1. +65 −0 .settings/org.eclipse.jdt.core.prefs
  2. +1 −2 .settings/org.eclipse.jdt.ui.prefs
  3. +1 −1 Jenkinsfile
  4. +2 −17 build.xml
  5. +16 −29 src/java/com/phenix/pct/ABLUnit.java
  6. +21 −26 src/java/com/phenix/pct/BackgroundWorker.java
  7. +4 −3 src/java/com/phenix/pct/CRCDifferent.java
  8. +1 −1 src/java/com/phenix/pct/CompilationAttributes.java
  9. +2 −2 src/java/com/phenix/pct/CompilationWrapper.java
  10. +0 −1 src/java/com/phenix/pct/DBAlias.java
  11. +2 −2 src/java/com/phenix/pct/DBConnectionSet.java
  12. +2 −11 src/java/com/phenix/pct/DLCVersion.java
  13. +1 −1 src/java/com/phenix/pct/DebugListingFilterReader.java
  14. +2 −1 src/java/com/phenix/pct/FileEntry.java
  15. +1 −1 src/java/com/phenix/pct/GenericCoverage.java
  16. +9 −9 src/java/com/phenix/pct/GenericExecuteOptions.java
  17. +2 −2 src/java/com/phenix/pct/MSSHolder.java
  18. +1 −1 src/java/com/phenix/pct/ODBCHolder.java
  19. +11 −23 src/java/com/phenix/pct/OEUnit.java
  20. +4 −4 src/java/com/phenix/pct/OpenEdgeFileSet.java
  21. +1 −1 src/java/com/phenix/pct/OracleHolder.java
  22. +2 −7 src/java/com/phenix/pct/OutputParameter.java
  23. +12 −44 src/java/com/phenix/pct/PCT.java
  24. +0 −3 src/java/com/phenix/pct/PCTAlias.java
  25. +2 −10 src/java/com/phenix/pct/PCTBgCRC.java
  26. +1 −8 src/java/com/phenix/pct/PCTBgCompile.java
  27. +10 −17 src/java/com/phenix/pct/PCTBgRun.java
  28. +10 −22 src/java/com/phenix/pct/PCTBinaryDump.java
  29. +3 −5 src/java/com/phenix/pct/PCTBinaryLoad.java
  30. +8 −21 src/java/com/phenix/pct/PCTCompile.java
  31. +5 −5 src/java/com/phenix/pct/PCTConnection.java
  32. +8 −8 src/java/com/phenix/pct/PCTCreateBase.java
  33. +2 −3 src/java/com/phenix/pct/PCTDumpData.java
  34. +2 −1 src/java/com/phenix/pct/PCTDumpIncremental.java
  35. +2 −2 src/java/com/phenix/pct/PCTDumpSchema.java
  36. +18 −20 src/java/com/phenix/pct/PCTLibrary.java
  37. +1 −1 src/java/com/phenix/pct/PCTLoadSchema.java
  38. +1 −1 src/java/com/phenix/pct/PCTProxygen.java
  39. +2 −8 src/java/com/phenix/pct/PCTRun.java
  40. +8 −14 src/java/com/phenix/pct/PCTWSComp.java
  41. +1 −2 src/java/com/phenix/pct/PCTXCode.java
  42. +3 −2 src/java/com/phenix/pct/PFReader.java
  43. +0 −1 src/java/com/phenix/pct/PLResource.java
  44. +3 −3 src/java/com/phenix/pct/RCodeInfo.java
  45. +2 −2 src/java/com/phenix/pct/RCodeSelector.java
  46. +1 −1 src/java/com/phenix/pct/RestGen.java
  47. +1 −3 src/java/com/phenix/pct/RunParameter.java
  48. +2 −2 src/java/eu/rssw/pct/oedoc/ClassDocumentationVisitor.java
  49. +3 −16 src/java/eu/rssw/pct/oedoc/OpenEdgeDocumentation.java
  50. +3 −14 src/java/eu/rssw/pct/oedoc/OpenEdgeDocumentation115.java
  51. +2 −2 src/java/eu/rssw/pct/oedoc/OpenEdgeHTMLDocumentation.java
  52. +1 −17 src/java/eu/rssw/pct/oedoc/ProcedureDocumentationVisitor.java
  53. +2 −1 src/java/eu/rssw/pct/standalone/Prolib.java
  54. +1 −5 src/java/net/cordova/prounit/ProUnit.java

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1,3 +1,2 @@
#Tue Jul 05 10:12:58 CEST 2005
eclipse.preferences.version=1
formatter_settings_version=8
formatter_settings_version=12
View
@@ -4,7 +4,7 @@ stage('Class documentation build') {
checkout scm
def antHome = tool name: 'Ant 1.9', type: 'hudson.tasks.Ant$AntInstallation'
def dlc11 = tool name: 'OE-11.6', type: 'jenkinsci.plugin.openedge.OpenEdgeInstallation'
def jdk = tool name: 'JDK 7 64b', type: 'hudson.model.JDK'
def jdk = tool name: 'JDK 1.8 64b', type: 'hudson.model.JDK'
withEnv(["JAVA_HOME=${jdk}"]) {
bat "${antHome}\\bin\\ant -DDLC=${dlc11} classDoc"
View
@@ -33,8 +33,8 @@
<property name="debug" value="true" />
<property name="deprecation" value="true" />
<property name="optimize" value="false" />
<property name="javac.source" value="1.6" />
<property name="javac.target" value="1.6" />
<property name="javac.source" value="1.7" />
<property name="javac.target" value="1.7" />
<!-- Different filesets depending on version -->
<fileset id="fs.v10" dir="${src.progress}">
@@ -121,9 +121,6 @@
<javac srcdir="${src.java}" destdir="${build-java}" debug="${debug}" source="${javac.source}" target="${javac.target}" deprecation="${deprecation}" optimize="${optimize}" encoding="utf-8" includeAntRuntime="false">
<include name="com/phenix/pct/*.java" />
<include name="net/cordova/prounit/*.java" />
<classpath refid="pct.compil" />
</javac>
<javac srcdir="${src.java}" destdir="${build-java}" debug="${debug}" source="1.7" target="1.7" deprecation="${deprecation}" optimize="${optimize}" encoding="utf-8" includeAntRuntime="false">
<include name="eu/rssw/pct/**/*.java" />
<classpath refid="pct.compil" />
</javac>
@@ -319,18 +316,6 @@
<fileset dir="${src.progress}" includes="Consultingwerk/**/*" />
</copy>
</target>
<target name="javadoc" depends="build" description="API documentation creation">
<mkdir dir="${doc}" />
<javadoc destdir="${doc}" useexternalfile="yes" charset="utf-8" encoding="utf-8">
<packageset dir="${src.java}" />
<group title="PCT Core" packages="com.phenix.pct.*" />
<bottom>Copyright © 2003-${year} Gilles QUERRET. All Rights Reserved.</bottom>
<link href="http://java.sun.com/j2se/1.5.0/docs/api/" />
<!-- Seems down -->
<!--<link href="http://nagoya.apache.org/gump/javadoc/ant/build/javadocs/"/>-->
</javadoc>
</target>
<target name="srcdist" description="Generates source zip/tarball archive">
<zip destfile="${dist}/pct-src-${env.BUILD_TAG}.zip">
@@ -33,7 +33,6 @@
import org.xml.sax.InputSource;
import com.google.gson.stream.JsonWriter;
import com.phenix.pct.PCTRun;
/**
* Ant task for ABLUnit tests
@@ -43,21 +42,23 @@
public class ABLUnit extends PCTRun {
private final XPath xpath = XPathFactory.newInstance().newXPath();
private Collection<FileSet> testFilesets = null;
private Collection<FileSet> testFilesets;
private File destDir;
private String format = "xml";
private String[] testCase;
private boolean writeLog = false;
private boolean haltOnFailure = false;
private boolean writeLog;
private boolean haltOnFailure;
// Internal use
private File json = null;
public ABLUnit() {
super();
json = new File(System.getProperty("java.io.tmpdir"), "ablunit" + PCT.nextRandomInt()
+ ".json");
try {
json = File.createTempFile("ablunit", ".json");
} catch (IOException caught) {
throw new BuildException(caught);
}
}
/**
@@ -103,15 +104,13 @@ public void setTestCase(String testCase) {
*/
public void addConfiguredFileset(FileSet set) {
if (this.testFilesets == null) {
testFilesets = new ArrayList<FileSet>();
testFilesets = new ArrayList<>();
}
testFilesets.add(set);
}
private void writeJsonConfigFile() throws IOException {
JsonWriter writer = null;
try {
writer = new JsonWriter(new FileWriter(json));
try (JsonWriter writer = new JsonWriter(new FileWriter(json))) {
log("JSON file created : " + json, Project.MSG_VERBOSE);
writer.beginObject();
@@ -140,9 +139,7 @@ private void writeJsonConfigFile() throws IOException {
log("Adding '" + f + "' to JSon.", Project.MSG_VERBOSE);
writer.beginObject().name("test").value(f.toString());
// If we want to execute a specific test
// XXX Support only one case for now, but keep possibility to have multiple
// cases
// XXX Why ?
// XXX Support only one case for now, but keep possibility to have multiple cases. Why ?
if (testCase != null) {
writer.name("cases").beginArray();
for (String cs : testCase) {
@@ -157,18 +154,10 @@ private void writeJsonConfigFile() throws IOException {
// Root object
writer.endObject();
} finally {
if (writer != null) {
try {
writer.close();
} catch (IOException uncaught) {
}
}
}
}
}
public void execute() throws BuildException {
public void execute() {
// Validation
if (destDir != null && !destDir.isDirectory())
throw new BuildException("Invalid destDir (" + destDir + ")");
@@ -225,11 +214,9 @@ protected void cleanup() {
super.cleanup();
// Clean JSON File
if (!getDebugPCT()) {
if (json.exists() && !json.delete()) {
log(MessageFormat.format(Messages.getString("PCTRun.5"),
json.getAbsolutePath()), Project.MSG_INFO);
}
if (!getDebugPCT() && json.exists() && !json.delete()) {
log(MessageFormat.format(Messages.getString("PCTRun.5"), json.getAbsolutePath()),
Project.MSG_INFO);
}
}
}
@@ -45,10 +45,11 @@
private Iterator<String> propath;
// Dernière commande envoyée
private String lastCommand, lastCommandParameter;
private String lastCommand;
private String lastCommandParameter;
// Faut-il quitter la boucle infinie du thread ?
public boolean quit = false; // FIXME
public boolean quit = false;
private final PCTBgRun parent;
@@ -61,7 +62,7 @@ public final void initialize(Socket socket) throws IOException {
this.reader = new BufferedReader(new InputStreamReader(this.socket.getInputStream(), parent.getCharset()));
this.writer = new BufferedWriter(new OutputStreamWriter(this.socket.getOutputStream(), parent.getCharset()));
// FIXME Should be HELLO or something like that...
// TODO Should be HELLO or something like that...
reader.readLine();
// Assign a unique thread number to this worker
@@ -82,7 +83,7 @@ public final int getThreadNumber() {
public final void sendCommand(String command, String param) throws IOException {
// Check validity
if ((command == null) || (command.trim().equals(""))) //$NON-NLS-1$
if ((command == null) || "".equals(command.trim())) //$NON-NLS-1$
throw new IllegalArgumentException("Invalid command");
lastCommand = command;
@@ -94,8 +95,9 @@ public final void sendCommand(String command, String param) throws IOException {
}
public final void listen() {
boolean end = false, err = false;
List<Message> retVals = new ArrayList<Message>();
boolean end = false;
boolean err = false;
List<Message> retVals = new ArrayList<>();
String customResponse = "";
while (!end) {
@@ -104,21 +106,21 @@ public final void listen() {
int idx = str.indexOf(':');
String result = (idx == -1 ? str : str.substring(0, idx));
if (result.equalsIgnoreCase("OK")) {
if (lastCommand.equalsIgnoreCase("quit")) {
if ("OK".equalsIgnoreCase(result)) {
if ("quit".equalsIgnoreCase(result)) {
status = 5;
}
if ((idx != -1) && (idx < (str.length() - 1)))
customResponse = str.substring(idx + 1);
} else if (result.equalsIgnoreCase("ERR")) {
} else if ("ERR".equalsIgnoreCase(result)) {
err = true;
if ((idx != -1) && (idx < (str.length() - 1)))
customResponse = str.substring(idx + 1);
} else if (result.equalsIgnoreCase("MSG")) {
} else if ("MSG".equalsIgnoreCase(result)) {
// Everything after MSG: is logged
if ((idx != -1) && (idx < (str.length() - 1)))
retVals.add(new Message(str.substring(idx + 1)));
} else if (result.equalsIgnoreCase("END")) {
} else if ("END".equalsIgnoreCase(result)) {
end = true;
// Standard commands (i.e. sent by this class) cannnot be handled and overridden
if (!isStandardCommand(lastCommand)) {
@@ -150,7 +152,7 @@ public final void performAction() throws IOException {
}
} else if (status == 2) {
if (propath.hasNext()) {
String s = (String) propath.next();
String s = propath.next();
sendCommand("propath", s + File.pathSeparatorChar);
} else {
status = 3;
@@ -173,13 +175,8 @@ public final void performAction() throws IOException {
}
public final boolean isStandardCommand(String command) {
if ("setThreadNumber".equalsIgnoreCase(command)) {
return true;
} else if ("connect".equalsIgnoreCase(command)) {
return true;
} else if ("propath".equalsIgnoreCase(command)) {
return true;
} else if ("quit".equalsIgnoreCase(command)) {
if ("setThreadNumber".equalsIgnoreCase(command) || "connect".equalsIgnoreCase(command)
|| "propath".equalsIgnoreCase(command) || "quit".equalsIgnoreCase(command)) {
return true;
}
@@ -215,16 +212,14 @@ public abstract void handleResponse(String command, String parameter, boolean er
public final void handleStandardEventResponse(String command, String parameter, boolean err,
String customResponse, List<Message> returnValues) {
if ("connect".equalsIgnoreCase(command)) {
if (err) {
parent.logMessages(returnValues);
parent.setBuildException(new BuildException(command + "(" + parameter + ") : " + customResponse));
quit();
}
if ("connect".equalsIgnoreCase(command) && err) {
parent.logMessages(returnValues);
parent.setBuildException(new BuildException(command + "(" + parameter + ") : " + customResponse));
quit();
}
}
public final static class Message {
public static final class Message {
private final String msg;
private final int level;
@@ -34,7 +34,7 @@
private void setTargetDir() {
Parameter[] params = this.getParameters();
for (int i = 0; i < params.length; i++) {
if (params[i].getName().equalsIgnoreCase("targetDir")) {
if ("targetDir".equalsIgnoreCase(params[i].getName())) {
this.targetDir = new File(params[i].getValue());
}
}
@@ -50,8 +50,9 @@ private void setTargetDir() {
*
* @return whether the file should be selected or not
*/
public boolean isSelected(File basedir, String filename, File file) throws BuildException {
RCodeInfo file1, file2;
public boolean isSelected(File basedir, String filename, File file) {
RCodeInfo file1;
RCodeInfo file2;
if (this.targetDir == null)
setTargetDir();
if (this.targetDir == null) {
@@ -25,7 +25,7 @@
import org.apache.tools.ant.types.ResourceCollection;
public class CompilationAttributes implements ICompilationAttributes {
private List<ResourceCollection> resources = new ArrayList<ResourceCollection>();
private List<ResourceCollection> resources = new ArrayList<>();
private File destDir = null;
private File xRefDir = null;
private File preprocessDir = null;
@@ -36,7 +36,7 @@ public CompilationWrapper() {
}
@Override
public void execute() throws BuildException {
public void execute() {
PCT pctTask;
// Handle pct:compile_ext
if ("pctcompileext".equalsIgnoreCase(getRuntimeConfigurableWrapper().getElementTag())
@@ -86,7 +86,7 @@ public void add(FileNameMapper fileNameMapper) {
* @return a mapper to be configured.
* @exception BuildException if more than one mapper is defined.
*/
public Mapper createMapper() throws BuildException {
public Mapper createMapper() {
if (mapperElement != null) {
throw new BuildException("Cannot define more than one mapper", getLocation());
}
@@ -16,7 +16,6 @@
*/
package com.phenix.pct;
/**
* Alias object on PCTRun
* @author <a href="mailto:g.querret+PCT@gmail.com">Gilles QUERRET</a>
@@ -27,7 +27,7 @@
* @author <a href="mailto:g.querret+PCT@gmail.com">Gilles QUERRET </a>
*/
public class DBConnectionSet extends DataType {
private Collection<PCTConnection> connections = new ArrayList<PCTConnection>();
private Collection<PCTConnection> connections = new ArrayList<>();
// Variation pour antlib
public void addDb_Connection(PCTConnection conn) {
@@ -48,7 +48,7 @@ public DBConnectionSet getRef() {
* @return A non-null collection of PCTConnection
*/
public Collection<PCTConnection> getDBConnections() {
Collection<PCTConnection> coll = new ArrayList<PCTConnection>();
Collection<PCTConnection> coll = new ArrayList<>();
coll.addAll(connections);
if (isReference())
@@ -130,19 +130,9 @@ private static void extractOldVersion(Builder builder, String str) {
private static String extractVersionInfo(File dir) throws IOException {
File version = new File(dir, "version");
BufferedReader reader = null;
try {
reader = new BufferedReader(new FileReader(version));
try (BufferedReader reader = new BufferedReader(new FileReader(version))) {
return reader.readLine();
} finally {
if (reader != null) {
try {
reader.close();
} catch (IOException ioe) {
}
}
}
}
public String getFullVersion() {
@@ -199,6 +189,7 @@ public String toString() {
boolean arch;
}
@Override
public boolean equals(Object obj) {
if (obj instanceof DLCVersion) {
DLCVersion other = (DLCVersion) obj;
@@ -60,7 +60,7 @@ public int read() throws IOException {
setInitialized(true);
}
int ch = -1;
int ch;
if (queuedData != null && queuedData.length() == 0) {
queuedData = null;
Oops, something went wrong.

0 comments on commit e157ef1

Please sign in to comment.