Skip to content

Commit

Permalink
Removed needRedirector() method which was only used in v8
Browse files Browse the repository at this point in the history
  • Loading branch information
gquerret committed Apr 18, 2018
1 parent dd16162 commit 372b589
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 39 deletions.
26 changes: 2 additions & 24 deletions src/java/com/phenix/pct/PCTRun.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,12 @@ public class PCTRun extends PCT implements IRunAttributes {
protected int statusID = -1; // Unique ID when creating temp files
protected int initID = -1; // Unique ID when creating temp files
protected int plID = -1; // Unique ID when creating temp files
protected int outputStreamID = -1; // Unique ID when creating temp files
private int xcodeID = -1; // Unique ID when creating temp files
private int profilerID = -1; // Unique ID when creating temp files
private int profilerOutID = -1; // Unique ID when creating temp files
protected File initProc = null;
protected File status = null;
protected File pctLib = null;
protected File outputStream = null;
private File xcodeDir = null;
private File profilerParamFile = null;
private boolean prepared = false;
Expand Down Expand Up @@ -424,17 +422,6 @@ public void execute() {
throw new BuildException(caught);
}

if (getProgressProcedures().needRedirector()) {
String s = null;
try (Reader r = new FileReader(outputStream); BufferedReader br2 = new BufferedReader(r)) {
while ((s = br2.readLine()) != null) {
log(s, Project.MSG_INFO);
}
} catch (IOException e) {
System.out.println(e);
}
}

// Reads output parameter
if (runAttributes.getOutputParameters() != null) {
for (OutputParameter param : runAttributes.getOutputParameters()) {
Expand Down Expand Up @@ -659,16 +646,8 @@ private void createInitProcedure() {
try (OutputStream os = new FileOutputStream(initProc);
Writer w = new OutputStreamWriter(os, getCharset());
BufferedWriter bw = new BufferedWriter(w)) {
// Progress v8 is unable to write to standard output, so output is redirected in a file,
// which is parsed in a later stage
if (this.getProgressProcedures().needRedirector()) {
outputStreamID = PCT.nextRandomInt();
outputStream = new File(
System.getProperty(PCT.TMPDIR), "pctOut" + outputStreamID + ".txt"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
bw.write(MessageFormat.format(this.getProgressProcedures().getInitString(),
(this.outputStream == null ? null : this.outputStream.getAbsolutePath()),
isVerbose(), runAttributes.useNoErrorOnQuit()));
bw.write(MessageFormat.format(this.getProgressProcedures().getInitString(), isVerbose(),
runAttributes.useNoErrorOnQuit()));

// XCode session key
if (runAttributes.getXCodeSessionKey() != null) {
Expand Down Expand Up @@ -886,7 +865,6 @@ protected void cleanup() {

deleteFile(initProc);
deleteFile(status);
deleteFile(outputStream);
deleteFile(profilerParamFile);
for (OutputParameter param : runAttributes.getOutputParameters()) {
deleteFile(param.getTempFileName());
Expand Down
1 change: 0 additions & 1 deletion src/java/com/phenix/pct/ProgressProcedures.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public abstract interface ProgressProcedures {
String getLoadSchemaProcedure();
String getLoadSingleTableDataProcedure();
String getLoadMultipleTablesDataProcedure();
boolean needRedirector();
String getInitString();
String getCallbackString();
String getConnectString();
Expand Down
5 changes: 0 additions & 5 deletions src/java/com/phenix/pct/ProgressV10.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ public String getLoadSingleTableDataProcedure() {
return "pct/v10/loadData2.p";
}

@Override
public boolean needRedirector() {
return false;
}

@Override
public String getInitString() {
return getString("ProgressV10.0"); //$NON-NLS-1$
Expand Down
4 changes: 2 additions & 2 deletions src/java/com/phenix/pct/ProgressV10.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ProgressV10.0=DEFINE VARIABLE i AS INTEGER NO-UNDO INITIAL ?.\n\
DEFINE NEW SHARED VARIABLE pctVerbose AS LOGICAL NO-UNDO INITIAL {1}.\n\
DEFINE VARIABLE noErrorOnQuit AS LOGICAL NO-UNDO INITIAL {2}.\n\
DEFINE NEW SHARED VARIABLE pctVerbose AS LOGICAL NO-UNDO INITIAL {0}.\n\
DEFINE VARIABLE noErrorOnQuit AS LOGICAL NO-UNDO INITIAL {1}.\n\
DEFINE TEMP-TABLE ttParams NO-UNDO FIELD key AS CHARACTER FIELD val AS CHARACTER.\n\
FUNCTION getParameter RETURNS CHARACTER (k AS CHARACTER).\n\
FIND ttParams WHERE ttParams.key EQ k NO-LOCK NO-ERROR.\n\
Expand Down
5 changes: 0 additions & 5 deletions src/java/com/phenix/pct/ProgressV11.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ public String getLoadSingleTableDataProcedure() {
return "pct/v11/loadData2.p";
}

@Override
public boolean needRedirector() {
return false;
}

@Override
public String getInitString() {
return getString("ProgressV11.0"); //$NON-NLS-1$
Expand Down
4 changes: 2 additions & 2 deletions src/java/com/phenix/pct/ProgressV11.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ProgressV11.0=DEFINE VARIABLE i AS INTEGER NO-UNDO INITIAL ?.\n\
DEFINE VARIABLE zz AS INTEGER NO-UNDO INITIAL ?.\n\
DEFINE NEW SHARED VARIABLE pctVerbose AS LOGICAL NO-UNDO INITIAL {1}.\n\
DEFINE VARIABLE noErrorOnQuit AS LOGICAL NO-UNDO INITIAL {2}.\n\
DEFINE NEW SHARED VARIABLE pctVerbose AS LOGICAL NO-UNDO INITIAL {0}.\n\
DEFINE VARIABLE noErrorOnQuit AS LOGICAL NO-UNDO INITIAL {1}.\n\
DEFINE NEW SHARED VARIABLE mainCallback AS Progress.Lang.Object NO-UNDO.\n\
DEFINE TEMP-TABLE ttParams NO-UNDO FIELD key AS CHARACTER FIELD val AS CHARACTER.\n\
FUNCTION getParameter RETURNS CHARACTER (k AS CHARACTER).\n\
Expand Down

0 comments on commit 372b589

Please sign in to comment.