summaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/gluegen/cgram
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-03-06 07:41:58 +0100
committerSven Gothel <[email protected]>2015-03-06 07:41:58 +0100
commit1df503b8f14b385b35c6b50a4ff7ff03d1c3134f (patch)
treec72874810009800c93bf83b46a8057f43d5392f2 /src/java/com/jogamp/gluegen/cgram
parent4183867b055e99762d9b1a9163012657738be31a (diff)
Bug 1134 - Fix ProcAddressEmitter.getFunctionPointerTypedefName() ; Fix JavaEmitter's Function/Struct Emission
Fix ProcAddressEmitter.getFunctionPointerTypedefName(): - needs to produce function-pointer-type name w/ original name Fix JavaEmitter's Function/Struct Emission: - needs to create FunctionSymbol w/ original native name, - then rename - preserving the original one.
Diffstat (limited to 'src/java/com/jogamp/gluegen/cgram')
-rw-r--r--src/java/com/jogamp/gluegen/cgram/types/AliasedSymbol.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/java/com/jogamp/gluegen/cgram/types/AliasedSymbol.java b/src/java/com/jogamp/gluegen/cgram/types/AliasedSymbol.java
index 18477c1..679d44d 100644
--- a/src/java/com/jogamp/gluegen/cgram/types/AliasedSymbol.java
+++ b/src/java/com/jogamp/gluegen/cgram/types/AliasedSymbol.java
@@ -42,13 +42,19 @@ public interface AliasedSymbol {
* to the list of {@link #getAliasedNames() aliases}.
* while the given {@code newName} will be removed.
* </p>
- * @param newName the new {@link #getName() current-name}
+ * <p>
+ * Operation will be ignored if {@code newName} is {@code null}.
+ * </p>
+ * @param newName the new {@link #getName() current-name}, maybe {@code null}
*/
void rename(final String newName);
/**
* Add the given {@code origName} to the list of {@link #getAliasedNames() aliases}
* if not equal {@link #getName() current-name}.
- * @param origName the new alias to be added
+ * <p>
+ * Operation will be ignored if {@code newName} is {@code null}.
+ * </p>
+ * @param origName the new alias to be added, maybe {@code null}
*/
void addAliasedName(final String origName);
/**
@@ -94,13 +100,16 @@ public interface AliasedSymbol {
private String name;
public AliasedSymbolImpl(final String origName) {
+ if( null == origName ) {
+ throw new IllegalArgumentException("Null origName not allowed");
+ }
this.origName = origName;
this.aliasedNames=new HashSet<String>();
this.name = origName;
}
@Override
public void rename(final String newName) {
- if( !name.equals(newName) ) {
+ if( null != newName && !name.equals(newName) ) {
aliasedNames.add(name);
aliasedNames.remove(newName);
name = newName;
@@ -108,7 +117,7 @@ public interface AliasedSymbol {
}
@Override
public void addAliasedName(final String origName) {
- if( !name.equals(origName) ) {
+ if( null != origName && !name.equals(origName) ) {
aliasedNames.add(origName);
}
}