You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2011/02/04 04:37:22 UTC

DO NOT REPLY [Bug 50718] New: New CellReference created from missing Name throws "Mismatched quotes" Runtime Ex

https://issues.apache.org/bugzilla/show_bug.cgi?id=50718

           Summary: New CellReference created from missing Name throws
                    "Mismatched quotes" Runtime Ex
           Product: POI
           Version: 3.7
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: POI Overall
        AssignedTo: dev@poi.apache.org
        ReportedBy: carl.pritchett@gmail.com


Creating a CellReference from a Name's "refers to formula" when that named
range has been half deleted throws a misleading exception:

"java.lang.RuntimeException: Mismatched quotes: ('MySheetName'!#REF!)"

If a Name has been half deleted (e.g. one row out of the two the Name refers to
is deleted) then the method Name.getRefersToFormula() will return something
like:

'MySheetName'!#REF!

When creating a CellReference from this string the
org.apache.poi.ss.util.CellReference.parseSheetName(CellReference.java:376)
method will fail as it does not expect the string to contain two "!"
characters.

The CellReference is created as follows:

AreaReference aref = new AreaReference(namedRange.getRefersToFormula());

The exception is misleading as the real error is that the "refers to formula"
(the "reference" param in the parseSheetName() method) is really invalid. Both
quotes are present thus the error "Mismatched quotes" is not correct.


The relevant stack trace is:

java.lang.RuntimeException: Mismatched quotes: ('MySheetTitle'!#REF!)
    at
org.apache.poi.ss.util.CellReference.parseSheetName(CellReference.java:376)
    at
org.apache.poi.ss.util.CellReference.separateRefParts(CellReference.java:340)
    at org.apache.poi.ss.util.CellReference.<init>(CellReference.java:88)
    at org.apache.poi.ss.util.AreaReference.<init>(AreaReference.java:55)
    at org.apache.poi.hssf.util.AreaReference.<init>(AreaReference.java:28)

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 50718] New CellReference created from damaged Name throws misleading "Mismatched quotes" Runtime Ex

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50718

Nick Burch <ni...@alfresco.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #1 from Nick Burch <ni...@alfresco.com> 2011-03-04 11:18:06 EST ---
Fixed in r1078039 - now gives a more helpful:
  IllegalArgumentException - Cell reference invalid: Sheet1!#REF!

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 50718] New CellReference created from damaged Name throws misleading "Mismatched quotes" Runtime Ex

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50718

Carl Pritchett <ca...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|New CellReference created   |New CellReference created
                   |from missing Name throws    |from damaged Name throws
                   |"Mismatched quotes" Runtime |misleading "Mismatched
                   |Ex                          |quotes" Runtime Ex

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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