aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/common/util
Commit message (Collapse)AuthorAgeFilesLines
* Bug 1474: Allow temp folder for exe-file test to contain parenthesis on WindowsSven Gothel2023-11-281-3/+5
| | | | | | | | | | | If the temp path contains parenthesis on Windows, e.g. the username or the sub-temp folder, the used exeTestFile.getCanonicalPath() can't be used by 'Runtime.getRuntime().exec( path )'. Example: C:\Users\(ABC)abc\AppData\Local\Temp Output: Exe-Tst: 'C:\Users\' is not recognized as an internal or external command, operable program or batch file. Hence the complete canonical path must be quoted, i.e. Path: "C:\Users\(ABC)abc\AppData\Local\Temp"
* Clock/Platform: Add currentMillis() analogue to currentNanos(), returning ↵Sven Gothel2023-10-061-0/+95
| | | | | | | | current monotonic milliseconds **since start of this application** Also added TSPrinter, a simple millisecond timestamp prepending `print*()` wrapper for a {@link PrintStream}. Test coverage via TestClock01.
* WorkerThread.start(paused): Merge RUNNING | ACTIVESven Gothel2023-09-221-1/+1
| | | | Last review editting I hope :)
* WorkerThread: Enhanced testing, added optional StateCallback for state ↵Sven Gothel2023-09-221-97/+217
| | | | changes, using bitfield state (earmarked to be used within GLMediaPlayerImpl etc)
* WorkerThread: Remove minDelayMS field, have it in Runnable branch onlySven Gothel2023-09-211-3/+2
|
* WorkerThread: Fix minDelayMS assignment using validated field valueSven Gothel2023-09-211-1/+1
|
* WorkerThread: Add optional minDelay to throttle excecutionSven Gothel2023-09-211-15/+36
|
* WorkerThread: Move 'streamErr' Exception to local RunnableSven Gothel2023-09-201-1/+1
|
* Add WorkerThread: A re-start'able, pause'able and interrupt'able worker ↵Sven Gothel2023-09-201-0/+315
| | | | thread with an optional minimum execution duration
* InterruptSource.Thread: Add ctor variant w/ sole Runnable argument (was missing)Sven Gothel2023-08-231-0/+7
|
* JarUtil.getRelativeOf(): Make'cutOffInclSubDir' optional, i.e. ignore if ↵Sven Gothel2023-05-201-6/+15
| | | | null in case no sub-directory is desired
* IOUtil.copyStreamChunk2ByteBuffer(..): Added new method to copy a chunk ↵Sven Gothel2023-05-041-0/+33
| | | | | | | | | | (segment) of the input stream (skipBytes, byteCount) This method is inspired by Bug 1280, <https://github.com/sgothel/joal/pull/16>, 'copy only needed bytes' for JOAL's com.jogamp.openal.util.WAVData.loadFromStream(..). This method is a revised version of the proposed IOHelpers.copyFromStream2ByteBuffer(..), see <https://github.com/OndrejSpanel/joal/commit/1616659e98904270af4faca25b770d0983609735>
* IOUtil.copyStream2Byte{Array|Buffer}(..): API Doc: Clarify that the complete ↵Sven Gothel2023-05-041-6/+4
| | | | stream is copied.
* IOUtil.copyStream2{File|Stream)(..): Drop unused and misleading ↵Sven Gothel2023-05-042-15/+11
| | | | 'totalNumBytes' argument, since we have no user-feedback callback passed.
* Clock: Use Clock.currentNanos() instead of System.nanoTime()Sven Gothel2023-03-071-2/+3
|
* Clock: Rename currentTimeNanos() -> currentNanos() as it represents the ↵Sven Gothel2023-03-061-1/+1
| | | | duration since module startup and not time.
* Fix Clock for performance counter: Add currentTimeNanos() since module ↵Sven Gothel2023-03-061-4/+10
| | | | | | | | | | | startup, retrievable via getMonotonicStartupTime(). (performance) Settings two long fields in getMonotonicTime() and creating Instant and using Duration for high-frequency counter is too expensive. currentTimeNanos() subtracts the startup time from the current monotonic time and returns the resulting duration in nanoseconds, which lasts for 292 years since module startup. This satisfies performance counter requirements.
* Add PerfCounterCtrl, a simple performance counter controllerSven Gothel2023-03-061-0/+44
|
* Formatting: BindingJNILibLoader, AWTEDTExecutorSven Gothel2023-01-231-10/+10
|
* SecurityUtil: Skip System's SecurityManager action for getSecurityManager() ↵Sven Gothel2023-01-151-7/+31
| | | | and doPrivileged() for Java17+
* Default build is JDK-17, prepare up to Java-21 (next LTS); ↵Sven Gothel2023-01-151-3/+11
| | | | | | | | PlatformPropsImpl: Remove static OSXVersion and Version* vars, add JAVA_17 and JAVA_21 flag. PlatformPropsImpl's static OSXVersion is JOGL specific and will be moved into its GLContextImpl. PlatformPropsImpl's static Version are not required and eats up memory where it can be used transitionary.
* Replace AccessController.doPrivileged() w/ SecurityUtil.doPrivileged()Sven Gothel2023-01-145-13/+29
|
* WeakIdentityHashMap: Always null check on weakRef.get(); ↵Sven Gothel2019-12-311-18/+23
| | | | IdentityWeakReference: hash is final.
* WeakIdentityHashMap: Refine capacity computation; Bitfield.Util add ↵Sven Gothel2019-12-312-2/+105
| | | | 'PowerOf2' functions
* WeakIdentityHashMap: Cleanup; Implement putAll(..); Make ↵Sven Gothel2019-12-311-30/+61
| | | | IdentityWeakReference static
* Add WeakIdentityHashMap implementation (from Apache Avro)Sven Gothel2019-12-301-0/+229
| | | | | | | | | | Origin <https://github.com/apache/avro/blob/master/lang/java/avro/src/main/java/org/apache/avro/util/WeakIdentityHashMap.java> from their commit 70260919426f89825ca148f5ee815f3b2cf4764d. Apache License Version 2.0 until. Using our JogAmp 'New BSD 2-Clause License' for changes after this initial commit. Related to Bug 1312, where we like to utilize a WeakIdentityHashMap, allowing to have cached shared GLContext to disappear .. a compromise.
* Bug 1363: Java 11: Extract and extend sun.misc.Unsafe functionality to ↵java11iosSven Gothel2019-09-041-0/+222
| | | | | | | | | | | | | | | UnsafeUtil UnsafeUtil centralizes the workarounds (hack) of certain Java>=9 modularization encapsulation pitfalls, where no exports have been defined. The last resort. 1) Buffers utilizes UnsafeUtil for Java>=9 invokeCleaner. 2) To gain access for certain methods + fields w/o 'illegal access warnings', we have to temporarily disable the IllegalAccessLogger. Hence we provide a method 'T doWithoutIllegalAccessLogger(..<T> action)' for our essential module access under Java >= 9.
* Bug 1363: Java 11: Recognize Java9+ ..; Support JEP 178 static linkage ↵Sven Gothel2019-06-171-0/+1
| | | | | | | | | | | | | | | | | | | | | libgluegen-rt[.so] -> libgluegen_rt[.so|.a] Recognize Java9+ .. - Recognize new Java9+ version string as of JEP 223 - Avoid Classpath's private findLibrary call +++ Support JEP 178 static linkage (OpenJDK 1.8) - Need to change native library basename: libgluegen-rt[.so] -> libgluegen_rt[.so|.a] since the dash '-' is not supported in a ANSI-c function name. - Added 'JNI_OnLoad_gluegen_rt' to recognize statical linked JNI code - Added JNI_VERSION_1_8 to jni/jni.h
* iOS: Initial iOS support commit: build.xml targets, java code-path etcSven Gothel2019-06-173-2/+4
| | | | | | | | | | | | Current build system for JogAmp iOS Build is: - Build Machine: OSX Mojave 10.14 - Using own (still proprietary) OpenJDK 9 iOS Build - OpenJDK 1.8 (This will be replaced by OpenJDK 11 soon) - Xcode 10.2
* Bug 1369: SCC: Hide SHA Algorithm bit size in literals of SpecificationSven Gothel2019-04-032-37/+36
| | | | | Implementation currently uses 256 bit Secure Hash (SHA) algorithm, but this may change in the future. Hence only use 'SHA' in the names, not 'SHA256'.
* Bug 1369: Source Certification Contract (SCC): Initial SHA256 fingerprint & ↵Sven Gothel2019-04-034-0/+459
| | | | | | | | | | | | | | | | | | | | | runtime validation This change implements a strong SHA256 signature over: 1) source tree inclusive make recipe (SHA256-Source) 2) all class files (SHA256-Classes) 3) all native libraries (SHA256-Natives) 4) the class files as deployed in the jar (SHA256-Classes-this) 5) the native libraries as deployed in the jar (SHA256-Natives-this) and drops all of these in the deployed Jar file. This allows SHA256 validation of (4) + (5) at runtime and further complete validation (1), (2) and (3) offline. Full SCC would now required (1) - (3) to be placed on a server for further validation. Optionally we may use GPG <https://gnupg.org/> or PGP to validate the build entity to implement the chain of trust <https://en.wikipedia.org/wiki/Chain_of_trust> The SHA256 runtime validation is tested via: com.jogamp.common.util.TestVersionInfo
* Bug 1367: Make TempFileCache & TempJarCache even if temp folder can't handle ↵Sven Gothel2019-04-033-37/+127
| | | | executables
* Bug 1366 - Use String.format((Locale)null, "..." ..) avoiding Locale output ↵Sven Gothel2019-03-303-4/+7
| | | | for System related Operations
* Bug 1219, Bug 1231: Re-add executable test by executionSven Gothel2019-03-251-10/+19
| | | | | | | | | | | | | | | | | Re-adding executable test by execution is required for 'blocker technology' like Windows's 'Software Restriction Policies (SRP)', which only gets activated by the actual execution attempt. Merely testing the file's (ACL) execution flags via NIO's isExecutable is not sufficient. Implementation first tests the file's (ACL) execution flags via NIO's isExecutable. If the NIO test was successful or not available, the actual execution test is performed. To mitigate the virus scanner's false positive, we use an executable shell script per default now, which may be overriden by the new environment 'jogamp.gluegen.UseNativeExeFile=true' Tested on GNU/Linux with one temp folder having mount options 'noexec' and on Windows using Software Restriction Policies (SRP) disallowing one temp folder. Both temp folder were first in line via environment 'java.io.tmpdir'.
* Bug 1219, Bug 1231: Avoid deflating test-exe on Windows using ↵Sven Gothel2019-03-241-51/+107
| | | | | | | | | | | | | | | | | | java.nio.file.Files.isExecutable(Path) Attempt to resolved virus scanner false positive detection on Windows while deflating the native code test-exe file in the temporary folder. As Julien Gouesse suggested, using Java 1.7's java.nio.file.Files.isExecutable(Path) _may_ resolve the issue, this has to be thorougly tested. This patch favors the nio's isExecutable file's ACL test over the more intrusive execution itself using a simple shell script file w/ set executable flag. Mind that previous tests allowed the shell script's execution, even if the temp folder did not allow execution of native code. We have to see how our testing results will be on this attempt.
* Resolve v2.3.1_winexe merge conflictsjavafxSven Gothel2019-03-201-0/+12
|\
| * Adding 'jogamp.gluegen.TestTempDirExec' property, allowing to disable ↵Sven Gothel2018-12-111-0/+12
| | | | | | | | | | | | | | testing executable of temp dir This also avoids trying to unpack the test executable on Windows, which may cause a virus scanner to halt the process or otherwise cause issues.
* | Remove deprectated classes and methodsSven Gothel2015-10-158-274/+47
| |
* | Refine new API methods: ExceptionUtils, Uri (Add @since, refine arguments ↵Sven Gothel2015-10-031-8/+8
| | | | | | | | and API doc)
* | Bug 1243 - Fix IOUtil.cleanPathString(..) special case ; Allow IOUtil and ↵Sven Gothel2015-10-033-17/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Uri to handle relative path Fix IOUtil.cleanPathString(..) special case: Special case '/a/./../b' -> '/b' requires to resolve './' before '../'. Allow IOUtil and Uri to handle relative path: - IOUtil.getParentOf(..) - IOUtil.cleanPathString(..) Handle cases: 'a/./../b' -> 'b' '.././b' -> '../b' - Uri: Handle null scheme
* | Bug 1237: Minor Cleanup: AssetURLContext and IOUtil.getResource(..) DEBUG ↵Sven Gothel2015-10-031-4/+2
| | | | | | | | Messages
* | Bug 1237 - Clarify IOUtil.getResource(..) for better efficiency, i.e. allow ↵Sven Gothel2015-10-031-23/+63
| | | | | | | | | | | | | | | | | | | | | | | | caller to skip relative futile lookup IOUtil.getResource(..) and IOUtil.ClassResources, needs more clarity. ClassLoader shall be passed explicitly next to the optional relative context Class instance. This allows better efficiency, i.e. caller can pass ClassLoader but skip a possible relative lookup, if not existing.
* | Bug 1231: Usability of CustomCompress API incl zip-level; Replace test-exe ↵Sven Gothel2015-09-243-25/+71
| | | | | | | | deflated files w/ zip-level 9
* | Bug 1231: Add Windows x86_64 test executable ; Use 'WinMain' for Windows ↵Sven Gothel2015-09-245-33/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | test-executable ; Use CustomInflate for Performance - Use 'WinMain' for Windows test-executable This may have little difference than using std 'main' entry - Add Windows x86_64 test executable Since the reporter claims the test executable works well on Windows i386, maybe utilizing a x86_64 test executable on same VM fixes the issue - Use CustomInflate for Performance - Skips GZIP header - Adds own custom header [magic, deflate-size, inflate-size] - Own header allows simplified I/O read and deflation
* | Bug 1219: IOUtil.testDirExe: Issue Process.destroy() in finalize block to ↵Sven Gothel2015-09-231-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | ensure launched native exe process terminates. See Bug 1219 comment 58: It seems that on some Windows platforms the launched native process using our test-exe keeps running even though we issued Process.waitFor(). Hence we issue Process.destroy() in the finalize block to at least attempt to terminate it. Note: The Process implementation is platform specific and may vary.
* | Bug 1219: IOUtil.testDirExe: Disable 'existingExe' DEBUG_EXE feature by ↵Sven Gothel2015-09-221-1/+4
| | | | | | | | | | | | | | | | | | hardcoded 'DEBUG_EXE_EXISTING_FILE = false' This is required for security, i.e. not allowing to execute any pre-existing files! In case we need to manually debug this issue, we can re-enable it manually and locally, but not in public builds!
* | Bug 1219: Fix IOUtil.StreamMonitor EOS handlingSven Gothel2015-09-211-17/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Make StreamMonitor a daemon thread, i.e. not hindering VM from exit - Earmark each InputStream's EOS state and only attempt to readByte if !eos - End loop and hence the thread if all InputStream have reached EOS. - Don't close the InputStream. Closing the InputStream is expected to be done by the owner, otherwise no EOS could even be reached! - Flush the output PrintStream at thread exit
* | Bug 1219: IOUtil.testDirExe: Satisfactory when executed, more debug optionsSven Gothel2015-09-211-11/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IOUtil.testDirExe(): - Satisfactory when executed Failure to execute produce an IOException right at ProcessBuilder.start(). Hence we can allow an unexpected process exit value, since we only want to learn whether executable files are allowed. - More debug options DEBUG_EXE: 'jogamp.debug.IOUtil.Exe' DEBUG_EXE_NOSTREAM: 'jogamp.debug.IOUtil.Exe.NoStream' - if DEBUG_EXE - a pre-existing 'jogamp_exe_tst'+<SUFFIX> will be used as-is. - the test-exe will not be deleted - StreamMonitor is being used to dump stdout/stderr if !DEBUG_EXE_NOSTREAM.
* | Bug 1219: Use Win32 API for test PE exe, not consoleSven Gothel2015-09-193-2/+2
| | | | | | | | | | | | | | | | | | Previous test PE exe, commit 0ebc5398fa20d23214a37dc4930a1fa1617293c7, was a console exe. A console exe opens a new console window if not being launched from one. New test PE exe is produced w/ '-mwindows', i.e. for Win32 API w/o a console.
* | Bug 1219: Sporadic failure to determine 'executable temp base directory' on ↵Sven Gothel2015-09-193-25/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Windows using 'exe-windows-i586-268b.bin' (Fix attempt #1) Replacing the tiny 268 byte sized 'exe-windows-i586-268b.bin' PE file w/ a regular 2048 byte sized PE file 'exe-windows-i386-2048b.bin'. File is produced via: c:\mingw\bin\gcc -nodefaultlibs -nostdlib -s -Os -o tiny.exe tiny.c Adding the 305 byte sized gzipped version 'exe-windows-i386-2048b.bin.305b.gz' to the gluegen-rt jar file to reduce the payload for non Windows platforms. Adding special property 'jogamp.debug.IOUtil.Exe' to debug testing the exe file, enable via '-Djogamp.debug.IOUtil.Exe'. Passes here on all Windows machines, however, the prev. one worked here as well.