aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/common/util
Commit message (Collapse)AuthorAgeFilesLines
* Bug 1063 - Utilize own Uri and Uri.Encoded class w/ proper encoding and ↵Sven Gothel2014-09-073-209/+18
| | | | | | | | | | | | differentiating encoded/decoded variants by type [Part 1] - Add immutable com.jogamp.common.net.Uri class impl. RFC 2396 w/ encoding of RFC 3986 - Class Uri.Encoded is used to represent encoded parts - IOUtil: Remove unused methods (residing in Uri) and mark others deprecated (will move to Uri) - Adopt usage of Uri: This must be completet in follow-up commits!
* Bug 908: Fix URI/URL double encoding, ensuring encoded/decoded variants are ↵Sven Gothel2014-09-072-177/+78
| | | | | | | | | | | | | | | | | | | | used properly (Added unit test) Bug 908 was caused by confusing URI encoded parts (e.g. scheme-specific-part) and it's decoded variant. This especially happened due to: - the fact, that the encoded and unencoded variant uses the same String type, - the URI/URL decoding differs, is not complete (e.g. %20 .. SPACE remains in decoded part), - and does not comply w/ RFC 2396 and RFC 3986 (encoding), e.g. not all RESERVED chars are encoded. In branch 'v2.3.0_branch', we will introduce our own Uri and Uri.Encoded class to solve above issue by replacing all URI usage w/ Uri. - Backporting results of own Uri class introduction in branch 'v2.3.0_branch' - Ensure the encoded URI parts are used where required, i.e. IOUtil.compose(..) etc - TestNetIOURIReservedCharsBug908: Automated test, launching GlueGen jar file from an <i>odd pathname</i>.
* Bug 1015: Test executable permission on Windows via bat file (temp dir, like ↵Sven Gothel2014-08-281-36/+136
| | | | | | | | | | | | | | | | | | | | | | | | on unix and osx) Tested on Window 7 and Windows 8.1 using 'Using Software Restriction Policies', i.e. disabled sw-execution in TEMP dir. On Windows we need to add min. shell code, here 'echo off', allowing the bat file to be executed if policy allows it. Reminder: We test the following temp folder 1) java.io.tmpdir/jogamp 2) $XDG_CACHE_HOME/jogamp 3) $TMPDIR/jogamp or $TEMP/jogamp 4) $HOME/.jogamp +++ Misc: Proper 'duplicate' validation via 'file1.equals(file2)' test using the abstract pathname.
* IntIntHashMap: Reduce temp. ArrayList<Entry> instances in cloneSven Gothel2014-08-161-3/+4
|
* Remove @deprecated methodsSven Gothel2014-07-094-24/+0
|
* gluegen: relax private variable access to package-private for members ↵Harvey Harrison2014-07-071-1/+1
| | | | | | | accessed from inner class Otherwise the compiler has to fill in a wrapping access function for the inner class to call, which is less efficient.
* gluegen: remove unused imports, unneeded semicolons, add missing @Override ↵Harvey Harrison2014-07-074-4/+5
| | | | annotations
* Code Clean-Up based on our Recommended Settings (jogamp-scripting ↵Sven Gothel2014-07-0327-403/+405
| | | | | | | | | | | | | | | c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74) Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74) - Change non static accesses to static members using declaring type - Change indirect accesses to static members to direct accesses (accesses through subtypes) - Add final modifier to private fields - Add final modifier to method parameters - Add final modifier to local variables - Remove unnecessary casts - Remove unnecessary '$NON-NLS$' tags - Remove trailing white spaces on all lines
* Fix 'typo' in messages: 'Catched' -> 'Caught'Sven Gothel2014-06-283-12/+12
|
* ReflectionUtil.getConstructor: Add 'initializeClazz' argument, allowing to ↵Sven Gothel2014-06-172-10/+11
| | | | defer static class initialization
* gluegen: use parseInt, parseLong to avoid boxing unboxing an Integer/LongHarvey Harrison2014-05-171-2/+2
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* RunnableTask: Add static method 'invokeOnNewThread(..)' for convenience ↵Sven Gothel2014-05-111-1/+39
| | | | (Used in JOGL to mitigate Bug 1004)
* gluegen: avoid bugs with sign-extension in readUInt16Harvey Harrison2014-04-111-2/+3
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* Bitstream: Add 'throwIOExceptionOnEOF' mode; fix certain EOS situations ↵Sven Gothel2014-02-211-9/+85
| | | | (flush, skip)
* Bug 980: Refine Bitstream API 'signed' and 'unsigned' semantics - ↵Sven Gothel2014-02-211-39/+43
| | | | readUInt32(..) must return long due to EOF
* Bitstream: Another CamelCase fix: uint32LongtoInt -> uint32LongToIntSven Gothel2014-02-211-2/+2
|
* Bitstream: Refine c70c730b22c847668cf475dc6f841b85297ac3ab: 'toUint32Long' ↵Sven Gothel2014-02-211-10/+18
| | | | -> 'toUInt32Long', add 'uint32LongtoInt'
* Bitstream: Add static 'long toUint32Long(int)' and 'int toUint32Int(int)' ↵Sven Gothel2014-02-211-10/+32
| | | | conversion functions
* Bug 890: Adding versatile Bitstream implementationSven Gothel2014-02-201-0/+1341
| | | | | | | | | | | | | | | | We already have several locations where bitstream operations are required and partially implemented (JPEG decoder, media parsing, ..) as well as endian related conversion (elf parser, ..). Create a versatile Bitstream class allowing: - Utilize I/O operations on I/O streams, buffers and arrays - Consider MSBfirst / LSBfirst mode - Linear bit R/W operations - Bulk R/W operations w/ endian related type conversion - Allow mark/reset and switching streams and input/output mode - Optimized operations Complete set of unit tests included, covering hopefully all cases.
* Bug 972 - Reduce ClassLoader Lookup, i.e. Class.forName(..) / Instrument ↵Sven Gothel2014-02-121-8/+99
| | | | ReflectionUtil's forName(..) usage
* Bug 945 - GlueGen's IOUtil does not consider file URI's authority when ↵Sven Gothel2014-01-221-11/+32
| | | | | | | | | | | | | | | | | | | | | | | converting to file-path or URI (Windows UNC / share host) Note: Authority for 'file-scheme' URI's is used on Windows to denote the host of the shared resource -> UNC Following methods of IOUtil didn't consider the authority for file-scheme URI: 'URL toURL(final URI uri)' 'String decodeURIToFilePath(final String uriPath)' 'String decodeURIIfFilePath(final URI uri)' Further more, the patterns 'patternSingleFS' and 'patternSingleBS' converted multiple '\' '/' to one replacement. However, we should not change the separator count and replace them one-by-one. TestIOUtilURIHandling: - Added shared-file-host 'filehost' test cases to file URIs and plain file path tests. - Passed on Unix and Windows. Added 'make/scripts/test-win32-smb_share.bat' - Testing actual windows share usage - Passed on Windows
* Add TaskBase.flush(Throwsable): To propagate optional reason for flush ; ↵Sven Gothel2014-01-111-1/+10
| | | | Deprecate flush()
* IntBitfield: Fix ctor: min 1 unit; Fix getBitCount(): Use unsigned ↵Sven Gothel2014-01-091-9/+14
| | | | right-shift '>>>'
* IOUtil: Add convenience compound class 'ClassResources'Sven Gothel2013-12-301-0/+37
|
* IOUtil.encodeToURI(): Only use method if requiredSven Gothel2013-11-281-3/+3
| | | | | | | Only use IOUtil.encodeToURI() if required, i.e. 'new URI(String)' but not 'new URI(scheme, ...)' since the latter already encodes the path. TestIOUtilURIHandling.test00BasicCoding() validates above findings.
* IOUtil.toURL(..) Apply decodeFromURI(uri.getPath()) if file-scheme; Add ↵Sven Gothel2013-11-282-13/+75
| | | | | | | | | | | | | | | | | | | IOUtil.decodeURIToFilePath(..) for native usage. Refine comments, API doc. toURL(..): Apply space conversion, decodeFromURI(..), on file-scheme path, ensuring decoded space. ++ Add decodeURIToFilePath(String uriPath) and decodeURIToFilePath(URI uri) Both methods shall simplify decoding a file-URI for native platform usage. Tested in TestIOUtilURIHandling +++
* JARUtil/IOUtil: Reuse IOUtil.JAR_SCHEME_SEPARATOR (now a char); Add DEBUG to ↵Sven Gothel2013-11-272-7/+12
| | | | JarUtil.getJarEntry(..)
* IOUtil: Add comments to slashify args @ caller; Use validated File @ ↵Sven Gothel2013-11-271-7/+7
| | | | | | | | | | | | | | | | | | | IOUtil.toURISimple ; DEBUG: stdout -> stderr Add comments to slashify(..) arguments for better documentation. +++ Use validated File @ IOUtil.toURISimple(..): slashify(file, true, isDirectory) to slashify(new File(path).getAbsolutePath(), true, isDirectory) i.e. same w/ above variant and determine absolute path via File instance. +++ DEBUG: stdout -> stderr
* IOUtil/JarUtil: DEBUG output on stderr not stdoutSven Gothel2013-11-272-26/+30
|
* JarUtil: Use common strings for exceptions (same as used in IOUtil)Sven Gothel2013-11-271-2/+2
|
* Bug 754 - JarUtil: Add method to generate resource URI from class's Jar URI ↵Sven Gothel2013-10-312-0/+68
| | | | and resource name (Remove Ubuntu fonts from jogl-all.jar, provide it separately to reduce footprint for the masses.)
* TempJarCache: Make 'initialization' query/flag thread safe, i.e. synchronize ↵Sven Gothel2013-10-241-4/+21
| | | | | | | if !isInit (dbl-check locking) - isInit must be set to 'true' _after_ actual initialization, so caller can be blocked until done - staticInitError must be volatile as well
* Fix Bug 865: Safari >= 6.1 [OSX]: May employ xattr on 'com.apple.quarantine' ↵Sven Gothel2013-10-233-29/+98
| | | | | | | | | on 'PluginProcess.app' - IOUtil.getTempDir(..): Don't test executable caps on OSX for java_io_tmpdir - JarUtil.extract(..): Issue native fixNativeLibAttribs(..) on OSX for native library files, i.e. remove xattr 'com.apple.quarantine'
* Fix Bug 857: GlueGen produces erroneous file URI on Windows, which breaks ↵Sven Gothel2013-10-182-20/+115
| | | | | | | | | | | | | | | | | | | | | | | | | Netbeans's JarURLStreamHandler - 'URL IOUtil.toURL(URI)' - Needs to encode the file-path portion on Windows(*) if exists. The file-path here shall only be encoded as follows: - backslash -> slash - ensure starting with slash (*) We perform above action for all OS, if 'false == File.separator.equals("/")' - Added high verbosity in DEBUG mode to easy debugging for future cases .. - Cleanup URI/URL unit tests, i.e. split URLCompositionTest into: - TestIOUtilURICompose - TestIOUtilURIHandling (Now covers Bug 857 as well) - TestUrisWithAssetHandler - TestURIQueryProps Tested all unit tests manually on GNU/Linux and Windows w/ JRE 7u45
* gluegen: add all missing @Override annotationsHarvey Harrison2013-10-177-0/+12
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* gluegen: remove trailing whitespaceHarvey Harrison2013-10-1733-912/+912
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* ArrayHashSet: Use final local vars if applicableSven Gothel2013-10-171-7/+7
|
* ArrayHashSet: Add @OverrideSven Gothel2013-10-171-0/+27
|
* Bug 820: Escape SPACE in filenames for URI ctor, use decoded URI components ↵Sven Gothel2013-10-072-13/+36
| | | | | | | | | | when compiling new URI. Add IOUtil: - String encodeToURI(String) - String decodeFromURI(String) Both only handle escaping of SPACE only. Determine whether other chars need to be treated.
* VersionUtil.getPlatformInfo: include 'getOSVersionNumber()' beside it's ↵Sven Gothel2013-10-031-1/+1
| | | | string representation.
* PropertyAccess: Add trusted properties sun.java2d.opengl, ↵Sven Gothel2013-10-021-1/+8
| | | | sun.java2d.noddraw, sun.java2d.d3d, sun.awt.noerasebackground
* IOUtil/JarUtil: Add more detail debug information for URI transformation; ↵Sven Gothel2013-10-012-18/+41
| | | | IOUtil.toURL(..) handle exception at 'new File(uri)'
* Bug 845: Fix JNILibLoaderBase.addNativeJarLibsImpl(..) fat-jar case.Sven Gothel2013-10-011-1/+4
| | | | | | | | | | | Always use the jar-basename when calling TempJarCache.addNativeLibs(..), otherwise it is mapped and loaded multiple times leading to different native libraries. Simplify addNativeJarLibsImpl(..) argument semantics by passing complete jarBasename and nativeJarBasename (w/ suffix). Added manual test scripts validating [gluegen + jogl] usage with multi (Bug 843) and fat (Bug 845) jar configurations.
* Bug 845: Add support for one big-fat jar file [java classes plus all native ↵Sven Gothel2013-10-012-17/+40
| | | | | | | | | | | | | | | | 'os.and.arch' libraries] JNILibLoaderBase.addNativeJarLibsImpl(..): If the modules's jar file contains the folder 'natives/<os.and.arch>/' we assume a big-fat jar and attempt to load all native libraries from the same. The test for above folder is performed via the class ClassLoader's getResource(..) and is considered inexpensive. If the folder exists and native libraries could be loaded, the method returns successfull. Otherwise, the 'slim' jar file is attempted to be loaded, even if such folder exist.
* Fix Bug 844: Cannot ctor URI w/ scheme alone, use string-based concatenation ↵Sven Gothel2013-10-012-3/+35
| | | | native URI root and jar file.
* Fix Bug 843: Remove Platform's requirement and use of ↵Sven Gothel2013-10-013-81/+22
| | | | | | | | | TempJarCache.bootstrapNativeLib(), allowing versatile use of 1st native jar file (big-java-jar w/ big-native-jar) The remaining Platform dependency existed in IOUtil.copyStream2Stream(..), used by JarUtil.extract(..), i.e. the MachineDescription's PAGE_SIZE. Solved by using a const buffer size of 4096 bytes.
* Bug 816: Add Platform.JAVA_VERSION_UPDATE - Allowing to determin whether JVM ↵Sven Gothel2013-09-221-1/+1
| | | | is >= 1.7.0u40
* *Ringbuffer: Remove Ringbuffer<T>.AllocEmptyArray interface to favor a more ↵Sven Gothel2013-08-243-144/+189
| | | | | | | | | | | | | | | simple approach; Split 'grow' into 'growEmpty' and 'growFull' - java.lang.reflect.Array can instantiate an array w/ a given array-type and length - array-type is Class<? extends T[]> - We either deduct the array-type via array.getClass(), or pass it (ctor for empty Ringbuffer). - Split 'growBuffer(T[] newElements, int amount, ..)' into: - 'growEmptyBuffer(T[] newElements)' - 'growFullBuffer(int amount)' Allowing a more clean API w/ simpler semantics.
* Add Ringbuffer interface an 2 implementations, synchronized (locking) ↵Sven Gothel2013-08-223-0/+996
| | | | | | | | | | | | | | | | | | | | | | | | SyncedRingbuffer and lock-free LFRingbuffer. SyncedRingbuffer is moved from JOGL to GlueGen, and generalized w/ common interface Ringbuffer to allow testing diff. implementations. - Added Ringbuffer.AllocEmptyArray factory interface, allowing to pass a constructor to construct the generic array. - Added functionality is growBuffer(..), allowing to either grow a full or empty buffer, using Ringbuffer.AllocEmptyArray. - Removed explicit 'clearRef' at get*(..), always clear the taken reference for better interface generalization. - Added LFRingbuffer, exposing lock-free get*(..) and put*(..) methods using the 'Always Keep One Slot Open' pattern using the read/write index as barriers only. - Ctor's copy an optional passed user array into the internal array, utilizing Ringbuffer.AllocEmptyArray. - Added unit tests.
* Remedy for Bug 782: Issue Debug.initSingleton() or Debug.debug(..) before ↵Sven Gothel2013-07-172-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | calling 'PropertyAccess.isPropertyDefined(propName, default)' through Debug class. Calling 'Debug.isPropertyDefined(propName, default)' may be 'optimized' to 'PropertyAccess.isPropertyDefined(propName, default)', which would skip the modules Debug's class initialization. Iff that happens, an AccessControlException may happen, due to requesting an insecure property, since modules own Debug class has not been added it's trusted prefixes from within it's init block yet. This seems to be a bug of the JVM .. to me, however .. the above description is the only able to explain the issue at hand. +++ Fix calls Debug class own static methods, either Debug.initSingleton() or Debug.debug(), before calling 'isPropertyDefined(propName, default)'. +++ Also mark Debug class static methods final! +++