[jbosstools-issues] [JBoss JIRA] (JBIDE-17433) Null pointer exception in Freemarker IDE when empty macro name typed
Fred Bricon (JIRA)
issues at jboss.org
Fri Jun 6 11:10:16 EDT 2014
[ https://issues.jboss.org/browse/JBIDE-17433?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Fred Bricon updated JBIDE-17433:
--------------------------------
Assignee: Denis Golovin
> Null pointer exception in Freemarker IDE when empty macro name typed
> --------------------------------------------------------------------
>
> Key: JBIDE-17433
> URL: https://issues.jboss.org/browse/JBIDE-17433
> Project: Tools (JBoss Tools)
> Issue Type: Bug
> Components: freemarker
> Environment: Windows x86, Eclipse Kepler (seems that issue doesn't depend on environment)
> Reporter: Tagir Valeev
> Assignee: Denis Golovin
> Fix For: 4.2.0.Beta3
>
>
> NullPointerException occurs when editing FTL file in Freemarker IDE due to problem in compareTo function in org.jboss.ide.eclipse.freemarker.model.MacroDirective. Proposed fix:
> {noformat}
> public int compareTo(Object arg0) {
> - if (arg0 instanceof MacroDirective)
> - return (getName().compareTo(((MacroDirective) arg0).getName()));
> + if (arg0 instanceof MacroDirective) {
> + String name = getName();
> + String otherName = ((MacroDirective) arg0).getName();
> + if(null == name)
> + name = "";
> + if(null == otherName)
> + otherName = "";
> + return (name.compareTo(otherName));
> + }
> else
> return 0;
> }
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.2.3#6260)
More information about the jbosstools-issues
mailing list