Skip to content

Commit c356044

Browse files
authored
Merge pull request #488 from OpenAF/t8
T8
2 parents e0039cf + 5425f3d commit c356044

10 files changed

+230
-101
lines changed

LICENSES.txt

+178-76
Large diffs are not rendered by default.

js/openaf.js

+21
Original file line numberDiff line numberDiff line change
@@ -2016,6 +2016,27 @@ const now = function() {
20162016
return Number(java.lang.System.currentTimeMillis());
20172017
}
20182018

2019+
/**
2020+
* <odoc>
2021+
* <key>nowE() : Number</key>
2022+
* Returns the current epoch time in seconds.
2023+
* </odoc>
2024+
*/
2025+
const nowE = function() {
2026+
return Number(java.time.Instant.now().getEpochSecond())
2027+
}
2028+
2029+
/**
2030+
* <odoc>
2031+
* <key>nowNanoE() : Number</key>
2032+
* Returns the current epoch time in nanoseconds.
2033+
* </odoc>
2034+
*/
2035+
const nowNanoE = function() {
2036+
var t = java.time.Instant.now()
2037+
return $f("%.0f%09.0f", t.getEpochSecond(), t.getNano())
2038+
}
2039+
20192040
/**
20202041
* <odoc>
20212042
* <key>nowUTC() : Number</key>

js/owrap.oJob.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -2393,14 +2393,19 @@ OpenWrap.oJob.prototype.addJob = function(aJobsCh, _aName, _jobDeps, _jobType, _
23932393
var ig = __
23942394
var res = []
23952395
var buf = ""
2396+
var iDot = 0
23962397

23972398
for(var i = 0; i < s.length; i++) {
23982399
if (isUnDef(ig) && (s[i] == '"' || s[i] == "'")) {
23992400
ig = s[i]
24002401
} else {
24012402
if (s[i] == ig) ig = __
24022403
}
2403-
if (isUnDef(ig) && s[i] == ".") {
2404+
2405+
if (s[i] == "(") iDot++
2406+
if (s[i] == ")") iDot--
2407+
2408+
if (iDot <= 0 && isUnDef(ig) && s[i] == ".") {
24042409
res.push(buf)
24052410
buf = ""
24062411
} else {

lib/commons-net-3.8.0.jar

-300 KB
Binary file not shown.

lib/commons-net-3.9.0.jar

309 KB
Binary file not shown.

pom.xml

+8-8
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
<dependency>
116116
<groupId>commons-net</groupId>
117117
<artifactId>commons-net</artifactId>
118-
<version>3.8.0</version>
118+
<version>3.9.0</version>
119119
</dependency>
120120
<dependency>
121121
<groupId>com.warrenstrange</groupId>
@@ -170,37 +170,37 @@
170170
<dependency>
171171
<groupId>org.eclipse.jetty</groupId>
172172
<artifactId>jetty-client</artifactId>
173-
<version>9.4.48.v20220622</version>
173+
<version>9.4.49.v20220914</version>
174174
</dependency>
175175
<dependency>
176176
<groupId>org.eclipse.jetty</groupId>
177177
<artifactId>jetty-http</artifactId>
178-
<version>9.4.48.v20220622</version>
178+
<version>9.4.49.v20220914</version>
179179
</dependency>
180180
<dependency>
181181
<groupId>org.eclipse.jetty</groupId>
182182
<artifactId>jetty-io</artifactId>
183-
<version>9.4.48.v20220622</version>
183+
<version>9.4.49.v20220914</version>
184184
</dependency>
185185
<dependency>
186186
<groupId>org.eclipse.jetty</groupId>
187187
<artifactId>jetty-util</artifactId>
188-
<version>9.4.48.v20220622</version>
188+
<version>9.4.49.v20220914</version>
189189
</dependency>
190190
<dependency>
191191
<groupId>org.eclipse.jetty.websocket</groupId>
192192
<artifactId>websocket-common</artifactId>
193-
<version>9.4.48.v20220622</version>
193+
<version>9.4.49.v20220914</version>
194194
</dependency>
195195
<dependency>
196196
<groupId>org.eclipse.jetty.websocket</groupId>
197197
<artifactId>websocket-api</artifactId>
198-
<version>9.4.48.v20220622</version>
198+
<version>9.4.49.v20220914</version>
199199
</dependency>
200200
<dependency>
201201
<groupId>org.eclipse.jetty.websocket</groupId>
202202
<artifactId>websocket-client</artifactId>
203-
<version>9.4.48.v20220622</version>
203+
<version>9.4.49.v20220914</version>
204204
</dependency>
205205
<dependency>
206206
<groupId>jline</groupId>

src/openaf/IOBase.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ public static Object randomAccessFile(String filename, String mode) throws FileN
134134
}
135135

136136
@JSFunction
137-
public static Object writeFileGzipStream(String filename) throws IOException {
138-
return openaf.core.IO.writeFileGzipStream(filename);
137+
public static Object writeFileGzipStream(String filename, boolean shouldAppend) throws IOException {
138+
return openaf.core.IO.writeFileGzipStream(filename, shouldAppend);
139139
}
140140

141141
@JSFunction

src/openaf/core/IO.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -608,8 +608,9 @@ public static Object randomAccessFile(String filename, String mode) throws FileN
608608

609609
/**
610610
* <odoc>
611-
* <key>io.writeFileGzipStream(aFilename) : JavaStream</key>
612-
* Creates and returns a JavaStream to write to a gzip aFilename. For example:\
611+
* <key>io.writeFileGzipStream(aFilename, shouldAppend) : JavaStream</key>
612+
* Creates and returns a JavaStream to write to a gzip aFilename. Optionally if shouldAppend=true
613+
* it will append to an existing file. For example:\
613614
* \
614615
* var stream = io.writeFileGzipStream("afile.txt.gz");\
615616
* ioStreamWrite(stream, "Hello "); // you can also use ioStreamWriteBytes \
@@ -619,8 +620,8 @@ public static Object randomAccessFile(String filename, String mode) throws FileN
619620
* </odoc>
620621
*/
621622
@JSFunction
622-
public static Object writeFileGzipStream(String filename) throws IOException {
623-
return new GZIPOutputStream(FileUtils.openOutputStream(new File(filename)));
623+
public static Object writeFileGzipStream(String filename, boolean shouldAppend) throws IOException {
624+
return new GZIPOutputStream(FileUtils.openOutputStream(new File(filename), shouldAppend));
624625
}
625626

626627
/**

tests/autoTestAll.DB.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
var db = createDBInMem("test2", false);
3232
db.convertDates(true);
3333

34-
var res = db.q("select 1 i, 1.5 f1, 1.0 f2, 'abc' t, sysdate d from dual").results[0];
34+
var res = db.q("select 1 i, 1.5 f1, 1.0 f2, 'abc' t, now() d from dual").results[0];
3535

3636
ow.test.assert(res.I === 1, true, "Problem with db integer conversion");
3737
ow.test.assert(res.F1 === 1.5, true, "Problem with db float conversion 1");
@@ -40,8 +40,8 @@
4040
ow.test.assert(Object.prototype.toString.call(res.D) == "[object Date]", true, "Problem with db date conversion");
4141

4242
db.u("create table teste (a varchar(10), b date)");
43-
db.u("insert into teste values ('aaa', SYSDATE)");
44-
db.u("insert into teste values ('bbb', SYSDATE)");
43+
db.u("insert into teste values ('aaa', now())");
44+
db.u("insert into teste values ('bbb', now())");
4545
db.u("insert into teste values ('ccc', null)");
4646

4747
ow.test.assert(db.q("select * from teste").results.length, 3, "Problem with null dates conversion");

versionsAndDeps.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -420,15 +420,15 @@
420420
"removable": false,
421421
"hardDeps": [
422422
"lib/commons-io-2.8.0.jar",
423-
"lib/jetty-io-9.4.48.v20220622.jar",
424-
"lib/jetty-util-9.4.48.v20220622.jar",
425-
"lib/jetty-client-9.4.48.v20220622.jar",
426-
"lib/jetty-http-9.4.48.v20220622.jar"
423+
"lib/jetty-io-9.4.49.v20220914.jar",
424+
"lib/jetty-util-9.4.49.v20220914.jar",
425+
"lib/jetty-client-9.4.49.v20220914.jar",
426+
"lib/jetty-http-9.4.49.v20220914.jar"
427427
],
428428
"deps": [
429-
"lib/websocket-api-9.4.48.v20220622.jar",
430-
"lib/websocket-client-9.4.48.v20220622.jar",
431-
"lib/websocket-common-9.4.48.v20220622.jar"
429+
"lib/websocket-api-9.4.49.v20220914.jar",
430+
"lib/websocket-client-9.4.49.v20220914.jar",
431+
"lib/websocket-common-9.4.49.v20220914.jar"
432432
]
433433
},
434434
{

0 commit comments

Comments
 (0)