You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Patrick Moore (JIRA)" <de...@tapestry.apache.org> on 2008/08/10 21:43:44 UTC

[jira] Created: (TAPESTRY-2570) NPE when trying to report an exception involving an instance that returns null for toString()

NPE when trying to report an exception involving an instance that returns null for toString()
---------------------------------------------------------------------------------------------

                 Key: TAPESTRY-2570
                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2570
             Project: Tapestry
          Issue Type: Bug
          Components: Framework
    Affects Versions: 4.1.5
            Reporter: Patrick Moore
            Priority: Minor
             Fix For: 4.1.6




Code from ExceptionAnaylzer:
(line 178)            stringValue = value.toString().trim();

            if (stringValue.length() == 0)
                continue;

------------------------
value.toString() returns null. Seems somewhat useless code.....

I don't understand why the stringValue.length is being checked for it being an empty string because then stringValue is not used. And no comments to help :-(
----------------------

Thread trace:

Thread [main] (Suspended (exception NullPointerException))	
	ExceptionAnalyzer.buildDescription(Throwable) line: 178	
	ExceptionAnalyzer.analyze(Throwable) line: 87	
	ExceptionAnalyzer.reportException(Throwable, PrintStream) line: 371	
	ApplicationServlet.show(Exception) line: 158	
	ApplicationServlet.init(ServletConfig) line: 207	
	StandardWrapper.loadServlet() line: 1139	
	StandardWrapper.load() line: 966	
	StandardContext.loadOnStartup(Container[]) line: 3956	
	StandardContext.start() line: 4230	
	StandardHost(ContainerBase).addChildInternal(Container) line: 760	
	StandardHost(ContainerBase).addChild(Container) line: 740	
	StandardHost.addChild(Container) line: 544	
	HostConfig.deployDescriptor(String, File, String) line: 626	
	HostConfig.deployDescriptors(File, String[]) line: 553	
	HostConfig.deployApps() line: 488	
	HostConfig.start() line: 1149	
	HostConfig.lifecycleEvent(LifecycleEvent) line: 311	
	LifecycleSupport.fireLifecycleEvent(String, Object) line: 120	
	StandardHost(ContainerBase).start() line: 1022	
	StandardHost.start() line: 736	
	StandardEngine(ContainerBase).start() line: 1014	
	StandardEngine.start() line: 443	
	StandardService.start() line: 448	
	StandardServer.start() line: 700	
	Catalina.start() line: 552	
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
	Method.invoke(Object, Object...) line: 597	
	Bootstrap.start() line: 295	
	Bootstrap.main(String[]) line: 433	


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Updated: (TAPESTRY-2570) NPE when trying to report an exception involving an instance that returns null for toString()

Posted by "Patrick Moore (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-2570?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Moore updated TAPESTRY-2570:
------------------------------------

    Description: 
Problem occured when I had a custom hivemind schema. The custom hivemind schema was trying to set a non-existent property on an object that was being created. Because the 'value's  toString() method just returns one of its properties as its string value, value.toString() returns null.

Code from ExceptionAnaylzer:
(line 178)            stringValue = value.toString().trim();

            if (stringValue.length() == 0)
                continue;

------------------------
value.toString() returns null. Seems somewhat useless code.....

I don't understand why the stringValue.length is being checked for it being an empty string because then stringValue is not used. And no comments to help :-(
----------------------

Thread trace:

Thread [main] (Suspended (exception NullPointerException))	
	ExceptionAnalyzer.buildDescription(Throwable) line: 178	
	ExceptionAnalyzer.analyze(Throwable) line: 87	
	ExceptionAnalyzer.reportException(Throwable, PrintStream) line: 371	
	ApplicationServlet.show(Exception) line: 158	
	ApplicationServlet.init(ServletConfig) line: 207	
	StandardWrapper.loadServlet() line: 1139	
	StandardWrapper.load() line: 966	
	StandardContext.loadOnStartup(Container[]) line: 3956	
	StandardContext.start() line: 4230	
	StandardHost(ContainerBase).addChildInternal(Container) line: 760	
	StandardHost(ContainerBase).addChild(Container) line: 740	
	StandardHost.addChild(Container) line: 544	
	HostConfig.deployDescriptor(String, File, String) line: 626	
	HostConfig.deployDescriptors(File, String[]) line: 553	
	HostConfig.deployApps() line: 488	
	HostConfig.start() line: 1149	
	HostConfig.lifecycleEvent(LifecycleEvent) line: 311	
	LifecycleSupport.fireLifecycleEvent(String, Object) line: 120	
	StandardHost(ContainerBase).start() line: 1022	
	StandardHost.start() line: 736	
	StandardEngine(ContainerBase).start() line: 1014	
	StandardEngine.start() line: 443	
	StandardService.start() line: 448	
	StandardServer.start() line: 700	
	Catalina.start() line: 552	
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
	Method.invoke(Object, Object...) line: 597	
	Bootstrap.start() line: 295	
	Bootstrap.main(String[]) line: 433	


  was:


Code from ExceptionAnaylzer:
(line 178)            stringValue = value.toString().trim();

            if (stringValue.length() == 0)
                continue;

------------------------
value.toString() returns null. Seems somewhat useless code.....

I don't understand why the stringValue.length is being checked for it being an empty string because then stringValue is not used. And no comments to help :-(
----------------------

Thread trace:

Thread [main] (Suspended (exception NullPointerException))	
	ExceptionAnalyzer.buildDescription(Throwable) line: 178	
	ExceptionAnalyzer.analyze(Throwable) line: 87	
	ExceptionAnalyzer.reportException(Throwable, PrintStream) line: 371	
	ApplicationServlet.show(Exception) line: 158	
	ApplicationServlet.init(ServletConfig) line: 207	
	StandardWrapper.loadServlet() line: 1139	
	StandardWrapper.load() line: 966	
	StandardContext.loadOnStartup(Container[]) line: 3956	
	StandardContext.start() line: 4230	
	StandardHost(ContainerBase).addChildInternal(Container) line: 760	
	StandardHost(ContainerBase).addChild(Container) line: 740	
	StandardHost.addChild(Container) line: 544	
	HostConfig.deployDescriptor(String, File, String) line: 626	
	HostConfig.deployDescriptors(File, String[]) line: 553	
	HostConfig.deployApps() line: 488	
	HostConfig.start() line: 1149	
	HostConfig.lifecycleEvent(LifecycleEvent) line: 311	
	LifecycleSupport.fireLifecycleEvent(String, Object) line: 120	
	StandardHost(ContainerBase).start() line: 1022	
	StandardHost.start() line: 736	
	StandardEngine(ContainerBase).start() line: 1014	
	StandardEngine.start() line: 443	
	StandardService.start() line: 448	
	StandardServer.start() line: 700	
	Catalina.start() line: 552	
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
	Method.invoke(Object, Object...) line: 597	
	Bootstrap.start() line: 295	
	Bootstrap.main(String[]) line: 433	



> NPE when trying to report an exception involving an instance that returns null for toString()
> ---------------------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-2570
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2570
>             Project: Tapestry
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: 4.1.5
>            Reporter: Patrick Moore
>            Priority: Minor
>             Fix For: 4.1.6
>
>
> Problem occured when I had a custom hivemind schema. The custom hivemind schema was trying to set a non-existent property on an object that was being created. Because the 'value's  toString() method just returns one of its properties as its string value, value.toString() returns null.
> Code from ExceptionAnaylzer:
> (line 178)            stringValue = value.toString().trim();
>             if (stringValue.length() == 0)
>                 continue;
> ------------------------
> value.toString() returns null. Seems somewhat useless code.....
> I don't understand why the stringValue.length is being checked for it being an empty string because then stringValue is not used. And no comments to help :-(
> ----------------------
> Thread trace:
> Thread [main] (Suspended (exception NullPointerException))	
> 	ExceptionAnalyzer.buildDescription(Throwable) line: 178	
> 	ExceptionAnalyzer.analyze(Throwable) line: 87	
> 	ExceptionAnalyzer.reportException(Throwable, PrintStream) line: 371	
> 	ApplicationServlet.show(Exception) line: 158	
> 	ApplicationServlet.init(ServletConfig) line: 207	
> 	StandardWrapper.loadServlet() line: 1139	
> 	StandardWrapper.load() line: 966	
> 	StandardContext.loadOnStartup(Container[]) line: 3956	
> 	StandardContext.start() line: 4230	
> 	StandardHost(ContainerBase).addChildInternal(Container) line: 760	
> 	StandardHost(ContainerBase).addChild(Container) line: 740	
> 	StandardHost.addChild(Container) line: 544	
> 	HostConfig.deployDescriptor(String, File, String) line: 626	
> 	HostConfig.deployDescriptors(File, String[]) line: 553	
> 	HostConfig.deployApps() line: 488	
> 	HostConfig.start() line: 1149	
> 	HostConfig.lifecycleEvent(LifecycleEvent) line: 311	
> 	LifecycleSupport.fireLifecycleEvent(String, Object) line: 120	
> 	StandardHost(ContainerBase).start() line: 1022	
> 	StandardHost.start() line: 736	
> 	StandardEngine(ContainerBase).start() line: 1014	
> 	StandardEngine.start() line: 443	
> 	StandardService.start() line: 448	
> 	StandardServer.start() line: 700	
> 	Catalina.start() line: 552	
> 	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
> 	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
> 	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
> 	Method.invoke(Object, Object...) line: 597	
> 	Bootstrap.start() line: 295	
> 	Bootstrap.main(String[]) line: 433	

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Updated: (TAPESTRY-2570) NPE when trying to report an exception involving an instance that returns null for toString()

Posted by "Marcus Schulte (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-2570?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcus Schulte updated TAPESTRY-2570:
-------------------------------------

    Fix Version/s:     (was: 4.1.6)
                   4.1.7

> NPE when trying to report an exception involving an instance that returns null for toString()
> ---------------------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-2570
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2570
>             Project: Tapestry
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: 4.1.5
>            Reporter: Patrick Moore
>            Priority: Minor
>             Fix For: 4.1.7
>
>
> Problem occured when I had a custom hivemind schema. The custom hivemind schema was trying to set a non-existent property on an object that was being created. Because the 'value's  toString() method just returns one of its properties as its string value, value.toString() returns null.
> Code from ExceptionAnaylzer:
> (line 178)            stringValue = value.toString().trim();
>             if (stringValue.length() == 0)
>                 continue;
> ------------------------
> value.toString() returns null. Seems somewhat useless code.....
> I don't understand why the stringValue.length is being checked for it being an empty string because then stringValue is not used. And no comments to help :-(
> ----------------------
> Thread trace:
> Thread [main] (Suspended (exception NullPointerException))	
> 	ExceptionAnalyzer.buildDescription(Throwable) line: 178	
> 	ExceptionAnalyzer.analyze(Throwable) line: 87	
> 	ExceptionAnalyzer.reportException(Throwable, PrintStream) line: 371	
> 	ApplicationServlet.show(Exception) line: 158	
> 	ApplicationServlet.init(ServletConfig) line: 207	
> 	StandardWrapper.loadServlet() line: 1139	
> 	StandardWrapper.load() line: 966	
> 	StandardContext.loadOnStartup(Container[]) line: 3956	
> 	StandardContext.start() line: 4230	
> 	StandardHost(ContainerBase).addChildInternal(Container) line: 760	
> 	StandardHost(ContainerBase).addChild(Container) line: 740	
> 	StandardHost.addChild(Container) line: 544	
> 	HostConfig.deployDescriptor(String, File, String) line: 626	
> 	HostConfig.deployDescriptors(File, String[]) line: 553	
> 	HostConfig.deployApps() line: 488	
> 	HostConfig.start() line: 1149	
> 	HostConfig.lifecycleEvent(LifecycleEvent) line: 311	
> 	LifecycleSupport.fireLifecycleEvent(String, Object) line: 120	
> 	StandardHost(ContainerBase).start() line: 1022	
> 	StandardHost.start() line: 736	
> 	StandardEngine(ContainerBase).start() line: 1014	
> 	StandardEngine.start() line: 443	
> 	StandardService.start() line: 448	
> 	StandardServer.start() line: 700	
> 	Catalina.start() line: 552	
> 	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
> 	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
> 	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
> 	Method.invoke(Object, Object...) line: 597	
> 	Bootstrap.start() line: 295	
> 	Bootstrap.main(String[]) line: 433	

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org