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 2026/01/22 06:36:10 UTC

[Bug 69935] New: ClientAnchor: Inconsistent types between getCol1()/getCol2() returning short and setCol1()/setCol2() accepting int

https://bz.apache.org/bugzilla/show_bug.cgi?id=69935

            Bug ID: 69935
           Summary: ClientAnchor: Inconsistent types between
                    getCol1()/getCol2() returning short and
                    setCol1()/setCol2() accepting int
           Product: POI
           Version: unspecified
          Hardware: PC
                OS: Mac OS X 10.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: SS Common
          Assignee: dev@poi.apache.org
          Reporter: jogakdal@gmail.com
  Target Milestone: ---

The ClientAnchor interface has inconsistent return/parameter types for
column-related methods:                                                         

- getCol1() returns short                                                       
- setCol1(int col1) accepts int                                                 
- getCol2() returns short                                                       
- setCol2(int col2) accepts int                                                 

In contrast, row methods are consistent:                                        
- getRow1() returns int                                                         
- setRow1(int row1) accepts int                                                 

This is similar to Bug 46225, where HSSFSheet column methods were migrated from
short to int. 
It appears ClientAnchor.getCol1()/getCol2() were missed in that migration.

This inconsistency causes issues in Kotlin where property syntax requires
matching getter/setter types. 
Users are forced to use explicit setter method calls instead of property
assignment:

// Kotlin - This doesn't work:                                                  
anchor.col1 = 5  // Error: setter type mismatch                                 

// Must use:                                                                    
anchor.setCol1(5)                                                               

Suggestion: Change getCol1()/getCol2() to return int for consistency with row
methods, setters, and modern usage patterns.

Affected versions: All (verified in 5.2.5 and trunk)

-- 
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


[Bug 69935] ClientAnchor: Inconsistent types between getCol1()/getCol2() returning short and setCol1()/setCol2() accepting int

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

PJ Fanning <fa...@yahoo.com> changed:

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

--- Comment #4 from PJ Fanning <fa...@yahoo.com> ---
PR merged

-- 
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


[Bug 69935] ClientAnchor: Inconsistent types between getCol1()/getCol2() returning short and setCol1()/setCol2() accepting int

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

Matafagafo <ma...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |matafagafo@gmail.com

-- 
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


[Bug 69935] ClientAnchor: Inconsistent types between getCol1()/getCol2() returning short and setCol1()/setCol2() accepting int

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

--- Comment #3 from jogakdal@gmail.com ---
I’ve opened a PR for this issue:

https://github.com/apache/poi/pull/1006

The change adds default short-based setters `setCol1(short)` and
`setCol2(short)` on `ClientAnchor` that delegate to the existing int-based
setters, and includes a small regression test (`TestClientAnchorShortSetter`)
to verify both the new and existing setters. 
The `@since` tag is left as `TBD` for the committer to adjust to the
appropriate release version.

-- 
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


[Bug 69935] ClientAnchor: Inconsistent types between getCol1()/getCol2() returning short and setCol1()/setCol2() accepting int

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

--- Comment #2 from sfisque@gmail.com ---
a PR to ADD missing versions of the setters so they match, e.g. setCol1( short
) could do the trick.  java supports method overloading.  

would merely adding the missing setters for short satisfy kotlin support? 
probably need to make sure any reflective code in POI doesn't get confused by
multiple method redefinitions on the affected objects

-- 
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


[Bug 69935] ClientAnchor: Inconsistent types between getCol1()/getCol2() returning short and setCol1()/setCol2() accepting int

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

--- Comment #1 from PJ Fanning <fa...@yahoo.com> ---
Unfortunately making breaking changes causes more unhappy users than changing
old APIs to suit a very small number of people.

If this is a big issue for you, you can write your own lib method that wraps
the call that you don't like.

-- 
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