summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Bug 908: Fix URI/URL double encoding, ensuring encoded/decoded variants are ↵Sven Gothel2014-09-077-376/+523
| | | | | | | | | | | | | | | | | | | | 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>.
* TestVersionSemantics: BACKWARD_COMPATIBLE_USER current vs 2.2.0Sven Gothel2014-08-281-2/+3
|
* 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-164-6/+13
|
* Bug 1024: Add fallback for native-jar-file location via classpathSven Gothel2014-07-112-6/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In situations, where the native-jar file is not located within the same parent URI as it's java-jar file, our location mechanism fails. This patch adds a classloader based native-jar file location mechanism as a fallback, requiring the native jar file to be included in the users CLASSPATH. Classloader based location algorithm in JNILibLoaderBase.addNativeJarLibsImpl(..): - Extract the 'module-name' from the given classFromJavaJar's package name, i.e. the last package-part: 'jogamp.common.Debug' -> 'common' Hence it is important to pass a 'classFromJavaJar', which last package segment reflects the module-name! - <os.and.arch> -> <os_and_arch_dot>, e.g. linux-amd64 -> linux.amd64 (linux/amd64) - Locate class 'jogamp.nativetag.<module-name>.<os_and_arch_dot>.TAG', e.g. 'jogamp.nativetag.common.linux.amd64.TAG' - Use located class's JarFile URI .. continue as usual Injection of above mentioned TAG class via gluegen-cpptasks-base.xml macro 'native.tag.jar': - Creates dummy TAG.java code - Compiles TAG.java - Creates the native-jar file Example: <native.tag.jar objdir="${build}/obj" nativejarfile="${build}/gluegen-rt-natives-${os.and.arch}.jar" manifestfile="${build}/Manifest-rt-natives.temp" module="common" includelibs="*gluegen-rt.${native.library.suffix}" /> Note that the manifest file uses a matching Extension-Name: Extension-Name: jogamp.nativetag.common
* Cleanup JNILibLoaderBase: Use Platform NEWLINE, remove obsolete notice of ↵Sven Gothel2014-07-111-21/+26
| | | | | | | '[-noawt,-mobile,-core,-android]?' in API-doc, ... - rename addNativeJarLibsWhenInitialized(..) -> addNativeJarLibsWithTempJarCache(..) to fix grammar and expose proper semantics.
* Debug: Use JogAmp license, since we re-modelled it using PropertyAccess, ↵Sven Gothel2014-07-111-33/+21
| | | | commit GlueGen f4ac27e177f6deb444280d3b375e7d343e38bd08
* PlatformPropsImpl.getOSAndArch(..): Cleanup, use final String instances to ↵Sven Gothel2014-07-111-22/+33
| | | | ease review
* Remove @deprecated methodsSven Gothel2014-07-094-24/+0
|
* gluegen: relax private variable access to package-private for members ↵Harvey Harrison2014-07-072-2/+2
| | | | | | | 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 the unused reverse map from TypeDictionaryHarvey Harrison2014-07-071-9/+0
|
* gluegen: remove unused imports, unneeded semicolons, add missing @Override ↵Harvey Harrison2014-07-076-6/+7
| | | | annotations
* Merge remote-tracking branch 'github-mark/master' (Bug 1023, Bug 1024)Sven Gothel2014-07-053-154/+130
|\ | | | | | | | | | | | | | | | | Conflicts: src/java/com/jogamp/common/jvm/JNILibLoaderBase.java src/java/com/jogamp/common/os/Platform.java src/junit/com/jogamp/common/util/TestTempJarCache.java (re-injected that api-doc of addNativeJarLibsImpl)
| * Do not keep re-indexing into the same array.Mark Raynsford2014-06-301-4/+4
| |
| * StringBuilder message parameter was unused.Mark Raynsford2014-06-301-4/+3
| |
| * Clean up native library loading and remove the ability to strip prefixes.Mark Raynsford2014-06-302-110/+132
| | | | | | | | | | Bug: 1023 Bug: 1024
| * Remove unused addNativeJarLibs() method; the only consumer was a unit testMark Raynsford2014-06-262-54/+0
| | | | | | | | of the method.
* | Code Clean-Up based on our Recommended Settings (jogamp-scripting ↵Sven Gothel2014-07-03197-3796/+3790
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-289-19/+19
| |
* | Buffers: Split slice2Float(..) into dedicated methods for FloatBuffer and ↵Sven Gothel2014-06-271-32/+53
|/ | | | float[] backing-array - refine API doc w/ backing-array semantics
* CMethodBindingEmitter: Suppress compiler warning in NewDirectByteBuffer ↵Sven Gothel2014-06-251-2/+2
| | | | usage (cast to void*)
* Bug 1025 - GlueGen: Fix regression of single non-native sized compound fieldsSven Gothel2014-06-251-5/+21
| | | | | Single non-native sized compound fields, if an opaque array/pointer, must utilized the native size StructAccessor get/set method.
* Bug 1025 - GlueGen: Fix test case (gcc compiler regression due to redefined ↵Sven Gothel2014-06-252-10/+0
| | | | types / removed them)
* Bug 1025 - GlueGen: Add accessor for compound fields of type array, pointer ↵Sven Gothel2014-06-2518-427/+1872
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and string (code generation) Enhance compound access as delivered by Bug 1022, to also generate accessors (getter and setter) for array, pointer and string types. Allow configuration of array length either via their internal size (c-header) or config 'ReturnedArrayLength'. 'ReturnedArrayLength' allows specifying a java expression. Canonical field names of compounds are _now_ specified as follows for configuration entries: COMPOUND.FIELD e.g. StructA.fieldB Also allow configuration of pointer fields to be treated as referenced arrays via 'ReturnedArrayLength'. Further, allow specifying 'pointer fields' as String values via 'ReturnsString' configuration. ++++ Implementation details: - handle above described accessor features - enhance JavaDoc for generated accessors - generate native JNI compound and string accessor on demand - encapsule accessor code generation in their own methods - enhance exception messages - enhance type verbosity in debug mode - verbose debug output via GlueGen.debug() Tests: - Features covered by test1.[ch] and Test1p1JavaEmitter and Test1p2ProcAddressEmitter - Validated compilation and unit tests for modules: - joal - jogl (minor config changes req.) - jocl (minor config changes req.)
* GlueGen: Add support for compound-array in structs (accessors) ; Allow using ↵Sven Gothel2014-06-197-61/+212
| | | | | | | | | | | | | | | C-Enum values for array length - Parser (HeaderParser.g): Support using C-Enum values for array length specification - Will throw an exception if enum identifier is unknown or exceeds int-size - Add StructEmitter supports for compound-arrays - Add Debug stderr verbose info: - Struct Emitter prefix 'SE.' - to analyze emitting struct fields (offset+size and accessors) - Struct Layout prefix 'SL.' - to analyze memory layout (based on MachineDescription.StaticConfig.X86_64_UNIX) Tested via test1.[ch] BaseClass ..
* GlueGen: Refine compound [array] call-by-value native code injection and ↵Sven Gothel2014-06-182-7/+46
| | | | | | | | | | | initialization Follow-up of commit 1eadaf928f4f61aae4de1c8bf33c5b77bdfa882f - Refine MethodBinding detection for 'requiresStaticInitialization', i.e. return type is a "compound type" and not a pointer - JVMUtil_NewDirectByteBufferCopy: Throw FatalError if initializeImpl() has not been called
* GlueGen: Refine compound [array] call-by-value native code injection and ↵Sven Gothel2014-06-182-175/+237
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | initialization Follow-up of commit 9843e983a4fc71a64eb3de9cb364a1f4ffa56b3a Only add static initialization code (java, native) and hence native code 'JVMUtil_NewDirectByteBufferCopy(..)' if either required _or_ forced via configuration. This shall reduce possible sideffects and dead code. Add JavaConfiguration: /** * Returns true if the static initialization java code calling <code>initializeImpl()</code> * for the given class will be manually implemented by the end user * as requested via configuration directive <code>ManualStaticInitCall 'class-name'</code>. */ public boolean manualStaticInitCall(String clazzName); /** * Returns true if the static initialization java code implementing <code>initializeImpl()</code> * and the native code implementing: * <pre> * static jobject JVMUtil_NewDirectByteBufferCopy(JNIEnv *env, void * source_address, jlong capacity); * </pre> * for the given class will be included in the generated code, always, * as requested via configuration directive <code>ForceStaticInitCode 'class-name'</code>. * <p> * If case above code has been generated, static class initialization is generated * to call <code>initializeImpl()</code>, see {@link #manualStaticInitCall(String)}. * </p> */ public boolean forceStaticInitCode(String clazzName);
* Fix commit f4e753ff1f39be381307ffdb0fb6bb7a2d323eff: 'compound array ↵Sven Gothel2014-06-174-97/+176
| | | | call-by-value' JavaMethodBindingEmitter, array may still require NIO handling, also consider NIO array length.
* GlueGen: Add support for 'compound array call-by-value'Sven Gothel2014-06-1712-110/+201
| | | | | | | | | | | | | | | | | | | | | | | | | Completing commit c3054a01990e55ab35756ea23ab7d7c05f24dd37 by allowing passing compound arrays via 'call-by-value. - Creating linear temp heap, copying NIO values into it and passing to C function. Copy-back if not 'const', see below. - Respect 'const' qualifier to skip write-back of temp heap passed to C function - See tag: // FIXME: Compound and Compound-Arrays for code changes and validation of completeness - triggers for compound arrays are: - javaType.isArrayOfCompoundTypeWrappers() - type.isArray() - simplified const query by c-type: FunctionEmitter.isBaseTypeConst(ctype) +++ Tests: Added call-by-value to test1.[ch] binding test!
* TestVersionSemantics: No more expecting BACKWARD_COMPATIBLE* (Due to bumping ↵Sven Gothel2014-06-171-1/+1
| | | | to 2.2.0)
* gluegen: move all antlr grammars to a top-level directory (refine commit ↵Sven Gothel2014-06-176-0/+0
| | | | | | e8bc9edd3c39170af038ab23b8cdca9ffd6f2d56): src/antlr (IMHO no need for 'main') /src/main/antlr/ -> /src/antlr/
* Merge remote-tracking branch 'hharrison/antlr-move'Sven Gothel2014-06-1714-39/+29
|\
| * gluegen: update HeaderParser grammar to annotation EnumType map and ↵Harvey Harrison2014-05-312-12/+11
| | | | | | | | | | | | functions list Signed-off-by: Harvey Harrison <[email protected]>
| * gluegen: remove some unused importsHarvey Harrison2014-05-315-6/+0
| | | | | | | | Signed-off-by: Harvey Harrison <[email protected]>
| * gluegen: move all antlr grammars to a top-level directoryHarvey Harrison2014-05-316-0/+0
| | | | | | | | | | | | | | | | /src/main/antlr/.. This gets the .g files unmixed from the non-generated java files for the cgram/jgram packages. Signed-off-by: Harvey Harrison <[email protected]>
| * gluegen: update antlr grammer to produce annotated enum and functionName setsHarvey Harrison2014-05-182-17/+15
| | | | | | | | | | | | | | The annotations are all commented out, uncomment them and reduce the type warnings during the build. Signed-off-by: Harvey Harrison <[email protected]>
| * gluegen: remove an unreferenced writer variableHarvey Harrison2014-05-181-1/+0
| | | | | | | | Signed-off-by: Harvey Harrison <[email protected]>
| * gluegen: avoid a suppressed warning annotation by using the ArrayList copy ↵Harvey Harrison2014-05-181-3/+3
| | | | | | | | | | | | | | | | | | | | constructor clone() can't be used without warnigns and is no more efficient that the copy constructor, replace the call and kill the suppressed warning annotation. While here, mark the modifier list as private final. Signed-off-by: Harvey Harrison <[email protected]>
* | GlueGen: Add support for 'compound call-by-value', i.e. passing and ↵Sven Gothel2014-06-1710-174/+455
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | returning struct instance 'compound call-by-value' is not efficient. However, to allow mapping APIs utilizing passing small structs as arguments and return values - this feature has been added. +++ To return the struct value, native code needs to allocate a NIO ByteBuffer and copy the data. The stack return value can be dismissed afterwards and the NIO buffer is returned. We include this functionality for all generated [impl] classes, native method: 'static jobject JVMUtil_NewDirectByteBufferCopy(JNIEnv *env, void * source_address, jlong capacity)' (See: 'JavaEmitter.initClassAccessCode') Since this code requires knowledge of java classes and methods, for which a reference needs to be acquired, a static initialization method has been introduced for all generated [impl] classes: 'private static native boolean initializeImpl();' Per default the this method will be called in the new static initializer block of the class, which can be supressed via the configuration element: 'ManualStaticInit <class-name>' 'ManualStaticInit' can be used to issue the 'initializeImpl()' call in a custom static initializer written by the user. However, at the time 'initializeImpl()' gets called the JNI native library must have been loaded, of course! +++ - See tag: // FIXME: Compound call-by-value for code changes and validation of completeness Trigger for compond call-by-value in CMethodBindingEmitter is: !cArgType.isPointer() && javaArgType.isCompoundTypeWrapper() Trigger for compond call-by-value in JavaEmitter is: t.isCompound() +++ Further more we do tolerate 'javaType.isCPrimitivePointerType()', i.e. adding comments for offset/size and field entries, which are all NOP. This allows to utilize the remaining fields of the native structure. +++ Tests: Added call-by-value to test1.[ch] binding test!
* | ReflectionUtil.getConstructor: Add 'initializeClazz' argument, allowing to ↵Sven Gothel2014-06-172-10/+11
| | | | | | | | defer static class initialization
* | Minor edits: space, final qualifier; setenv-build-*: Add generic JDK locationSven Gothel2014-06-172-2/+3
| |
* | JavaEmitter.typeToJavaType: Simplify if-else block ; ↵Sven Gothel2014-06-162-5/+5
|/ | | | JavaType.getDumpString(): Add more info ..
* gluegen: avoid appending Strings in a loop, pull out a Stringbuilder we can ↵Harvey Harrison2014-05-171-11/+17
| | | | | | | | reuse Reuse a single stringbuilder to build all the comment strings and emit them if required. Signed-off-by: Harvey Harrison <[email protected]>
* gluegen: use parseInt, parseLong to avoid boxing unboxing an Integer/LongHarvey Harrison2014-05-171-2/+2
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* Bump semver to 9ec2e5329780214d317b026f7c0b086972a94a5c - Using ↵Sven Gothel2014-05-141-94/+5
| | | | Dumper.dumpFullStats(..)
* VersionSemanticsUtil: Produce diff stat per-class w/ diff-type-count and ↵Sven Gothel2014-05-141-5/+90
| | | | dump diffs per diff-type
* Bump semver.jar to 731db3566b4096ecf6a08a9d33991400e66c5021 (sgothel/jogamp ↵Sven Gothel2014-05-132-9/+8
| | | | branch): Using direct regexp for excludes
* Unit Test: Modularize Semantic Version Test / Fix 'excludes'Sven Gothel2014-05-132-73/+152
| | | | | | | Refactor base semjar unit test class into com.jogamp.junit.util.VersionSemanticsUtil, part of new gluegen-test-util.jar. The new gluegen-test-util.jar shall be used by all other modules to test versioning.
* Unit Test: Added Semantic Version Test (Current version agains v2.1.5)Sven Gothel2014-05-131-0/+149
| | | | | | | | | | | | | TestVersionSemantics adds testing of semantic versioning of 2.1.5 gluegen-rt.jar against the current version within a unit test. Currently we expect BACKWARD_COMPATIBLE_USER and need to toggle this to NON_BACKWARD_COMPATIBLE, if actually perfoming non compatible major or minor version changes. The latter is allowed right now, since we increment from 2.1 -> 2.2! - Added https://github.com/jeluard/semantic-versioning semver.jar (Apache License Version 2.0)
* RunnableTask: Add static method 'invokeOnNewThread(..)' for convenience ↵Sven Gothel2014-05-111-1/+39
| | | | (Used in JOGL to mitigate Bug 1004)