[izpack-devel] Custom Actions NPE, patch

Bartz, Klaus Klaus.Bartz at coi.de
Thu Mar 8 09:44:37 CET 2007


Hi Scott, 

> 
> Thanks, Klaus! You're the only one to reply. I found out that the 

It's my baby. Therfore support is also on me.


> problem occurs when the class name isn't the same as the 
> listener name. 
>

?? What is the listener name?? Do you mean the name of the jar file?
Yes this have to be the same. This is not only for the listener else
also for panels. It is something since many years (never seen IzPack
other), therefore we do not remember it at the first step.
May be about that I have not verified this in the compiler code.
To do it is a good way to reduce errors, therefor I will put it 
into trunk.

Cheers

Klaus


> -----Original Message-----
> From: izpack-devel-bounces at lists.berlios.de 
> [mailto:izpack-devel-bounces at lists.berlios.de] On Behalf Of 
> Scott Plante
> Sent: Thursday, March 08, 2007 3:55 AM
> To: izpack-devel at lists.berlios.de
> Subject: [izpack-devel] Custom Actions NPE, patch
> 
> 
> I discovered today that to create a custom listener you have 
> to name the 
> class the same as the listener. If you do not, you get a very 
> unhelpful 
> NullPointerException at the installer run time. I would like 
> to propose 
> that this patch be included in the next version. It will check, and 
> cause an error at installer compile time if there is no 
> matching class 
> in the listener. This is an "svn diff", if there is a better way to 
> submit patches, please let me know.
> 
> 
> Index: lib/com/izforge/izpack/compiler/Compiler.java
> ===================================================================
> --- lib/com/izforge/izpack/compiler/Compiler.java       
> (revision 1753)
> +++ lib/com/izforge/izpack/compiler/Compiler.java       (working copy)
> @@ -730,6 +730,12 @@
>          URL url = findIzPackResource(jarPath, "CustomAction 
> jar file");
>          List filePaths = getContainedFilePaths(url);
>          String fullClassName = getFullClassName(url, className);
> +        if (fullClassName == null)
> +        {
> +          throw new CompilerException(
> +              "CustomListener class '" + className + "' not 
> found in '"
> +              + url + "'. The class and listener name must match");
> +        }
>          CustomData ca = new CustomData(fullClassName, filePaths, 
> constraints, type);
>          packager.addCustomJar(ca, url);
>      }
> 
> 
> -- 
> Scott Plante, CTO
> Insight Systems, Inc.
> (+1) 404 873 0058 x104
> splante at insightsys.com
> http://zyross.com
> 
> _______________________________________________
> izpack-devel mailing list
> izpack-devel at lists.berlios.de 
> https://lists.berlios.de/mailman/listinfo/izpack-devel
> 



More information about the izpack-devel mailing list