Quantcast

Phrase not handling null strings

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Phrase not handling null strings

Tonji Zimmerman
I am working on a project and we are having problems w/ adding a null
string to a phrase.  We have upgraded to 1.3.1 where there is a bug fix
but it's not working.  Has anyone else had this issue?  We have put in a
work around but would like a viable solution.

thanks,
Tonji


**********************************************************
Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues.


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Phrase not handling null strings

Paulo Soares
Showing some code, stack trace, etc, might help.

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On
> Behalf Of Tonji Zimmerman
> Sent: Friday, July 15, 2005 2:59 PM
> To: [hidden email]
> Subject: [iText-questions] Phrase not handling null strings
>
> I am working on a project and we are having problems w/ adding a null
> string to a phrase.  We have upgraded to 1.3.1 where there is
> a bug fix
> but it's not working.  Has anyone else had this issue?  We
> have put in a
> work around but would like a viable solution.
>
> thanks,
> Tonji
>
>
> **********************************************************
> Electronic Mail is not secure, may not be read every day, and
> should not be used for urgent or sensitive issues.
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> _______________________________________________
> iText-questions mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. <a href="http://ads.osdn.com/?ad_idt77&alloc_id492&op=click">http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Phrase not handling null strings

blowagie
In reply to this post by Tonji Zimmerman
Tonji Zimmerman wrote:

>I am working on a project and we are having problems w/ adding a null
>string to a phrase.  We have upgraded to 1.3.1 where there is a bug fix
>but it's not working.  Has anyone else had this issue?  We have put in a
>work around but would like a viable solution.
>
Are you referring to the bugfix by August Detlefsen?
It ignores Strings that are null in the constructor
instead of throwing a NullPointerException.
I see there's no check in the add-methods.
Is that what goes wrong? I'll add the check
so that it's in the next version.
br,
Bruno


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Phrase not handling null strings

blowagie
In reply to this post by Tonji Zimmerman
Tonji Zimmerman wrote:

>I am working on a project and we are having problems w/ adding a null
>string to a phrase.  We have upgraded to 1.3.1 where there is a bug fix
>but it's not working.  Has anyone else had this issue?  We have put in a
>work around but would like a viable solution.
>
OK, I added the check in the add-methods in CVS. I'm not sure if that's
a good thing, though. Now the NullPointerException that would have been
thrown is 'eaten' by the iText code. That makes the code hard to debug.
People think something should be added, but nothing happens. If a
NullPointerException is thrown, they have an indication of what could be
going wrong. I may remove the check later on, because you really
shouldn't be adding null to a Phrase.
br,
Bruno


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Phrase not handling null strings

Paulo Soares
In reply to this post by Tonji Zimmerman
I think it should throw an exception. If null objects are acceped here
then they should be accepted everywhere there's an Add. I should also
note that no further info related to the actual problem was posted so
the fix is really an educated guess.

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On
> Behalf Of bruno
> Sent: Friday, July 15, 2005 3:35 PM
> To: Tonji Zimmerman
> Cc: [hidden email]
> Subject: Re: [iText-questions] Phrase not handling null strings
>
> Tonji Zimmerman wrote:
>
> >I am working on a project and we are having problems w/ adding a null
> >string to a phrase.  We have upgraded to 1.3.1 where there
> is a bug fix
> >but it's not working.  Has anyone else had this issue?  We
> have put in a
> >work around but would like a viable solution.
> >
> OK, I added the check in the add-methods in CVS. I'm not sure
> if that's
> a good thing, though. Now the NullPointerException that would
> have been
> thrown is 'eaten' by the iText code. That makes the code hard
> to debug.
> People think something should be added, but nothing happens. If a
> NullPointerException is thrown, they have an indication of
> what could be
> going wrong. I may remove the check later on, because you really
> shouldn't be adding null to a Phrase.
> br,
> Bruno
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> _______________________________________________
> iText-questions mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. <a href="http://ads.osdn.com/?ad_idt77&alloc_id492&op=click">http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Phrase not handling null strings

Tonji Zimmerman
In reply to this post by Tonji Zimmerman
It's basically like
cell.add(new Phrase(someNullSringFromDB, new Font(Font.HELVETICA, 9));

We put in a convience method that checks if the string is null and if it
is just add an empty string to the Phrase obj.  But we will have to do
this everywhere.  Is that a viable way for the Phrase to handle nulls?


>>> "Paulo Soares" <[hidden email]> 07/15/05 11:00 AM >>>
I think it should throw an exception. If null objects are acceped here
then they should be accepted everywhere there's an Add. I should also
note that no further info related to the actual problem was posted so
the fix is really an educated guess.

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On
> Behalf Of bruno
> Sent: Friday, July 15, 2005 3:35 PM
> To: Tonji Zimmerman
> Cc: [hidden email]
> Subject: Re: [iText-questions] Phrase not handling null strings
>
> Tonji Zimmerman wrote:
>
> >I am working on a project and we are having problems w/ adding a null
> >string to a phrase.  We have upgraded to 1.3.1 where there
> is a bug fix
> >but it's not working.  Has anyone else had this issue?  We
> have put in a
> >work around but would like a viable solution.
> >
> OK, I added the check in the add-methods in CVS. I'm not sure
> if that's
> a good thing, though. Now the NullPointerException that would
> have been
> thrown is 'eaten' by the iText code. That makes the code hard
> to debug.
> People think something should be added, but nothing happens. If a
> NullPointerException is thrown, they have an indication of
> what could be
> going wrong. I may remove the check later on, because you really
> shouldn't be adding null to a Phrase.
> br,
> Bruno
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> _______________________________________________
> iText-questions mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>



**********************************************************
Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues.


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Phrase not handling null strings

Tonji Zimmerman
In reply to this post by Tonji Zimmerman
Yes, that is the one I am referring to.

>>> bruno <[hidden email]> 07/15/05 10:29 AM >>>
Tonji Zimmerman wrote:

>I am working on a project and we are having problems w/ adding a null
>string to a phrase.  We have upgraded to 1.3.1 where there is a bug fix
>but it's not working.  Has anyone else had this issue?  We have put in
a
>work around but would like a viable solution.
>
Are you referring to the bugfix by August Detlefsen?
It ignores Strings that are null in the constructor
instead of throwing a NullPointerException.
I see there's no check in the add-methods.
Is that what goes wrong? I'll add the check
so that it's in the next version.
br,
Bruno



**********************************************************
Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues.


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Phrase not handling null strings

Tonji Zimmerman
In reply to this post by Tonji Zimmerman
here's a stack trace
java.lang.NullPointerException
        at com.lowagie.text.Phrase.<init>(Phrase.java:197)
        at com.lowagie.text.Phrase.<init>(Phrase.java:170)
        at
edu.umich.med.does.models.BasicDietListResults.addConsults(BasicDietListResults.java:374)
        at
edu.umich.med.does.models.BasicDietListResults.getLocation(BasicDietListResults.java:319)
        at
edu.umich.med.does.models.BasicDietListResults.getPatientTable(BasicDietListResults.java:120)
        at
edu.umich.med.does.models.BasicDietListResults.buildDietList(BasicDietListResults.java:97)
        at
edu.umich.med.does.web.reports.DietListAction.search(DietListAction.java:82)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:276)
        at
org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:196)
        at edu.umich.med.does.web.DoesAction.execute(DoesAction.java:66)
        at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
        at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
        at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
        at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
        at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
        at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
        at java.lang.Thread.run(Thread.java:534)


>>> Tonji Zimmerman 07/15/05 11:43 AM >>>
It's basically like
cell.add(new Phrase(someNullSringFromDB, new Font(Font.HELVETICA, 9));

We put in a convience method that checks if the string is null and if it
is just add an empty string to the Phrase obj.  But we will have to do
this everywhere.  Is that a viable way for the Phrase to handle nulls?


>>> "Paulo Soares" <[hidden email]> 07/15/05 11:00 AM >>>
I think it should throw an exception. If null objects are acceped here
then they should be accepted everywhere there's an Add. I should also
note that no further info related to the actual problem was posted so
the fix is really an educated guess.

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On
> Behalf Of bruno
> Sent: Friday, July 15, 2005 3:35 PM
> To: Tonji Zimmerman
> Cc: [hidden email]
> Subject: Re: [iText-questions] Phrase not handling null strings
>
> Tonji Zimmerman wrote:
>
> >I am working on a project and we are having problems w/ adding a null
> >string to a phrase.  We have upgraded to 1.3.1 where there
> is a bug fix
> >but it's not working.  Has anyone else had this issue?  We
> have put in a
> >work around but would like a viable solution.
> >
> OK, I added the check in the add-methods in CVS. I'm not sure
> if that's
> a good thing, though. Now the NullPointerException that would
> have been
> thrown is 'eaten' by the iText code. That makes the code hard
> to debug.
> People think something should be added, but nothing happens. If a
> NullPointerException is thrown, they have an indication of
> what could be
> going wrong. I may remove the check later on, because you really
> shouldn't be adding null to a Phrase.
> br,
> Bruno
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> _______________________________________________
> iText-questions mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>



**********************************************************
Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues.


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Loading...