On Wed, 18 Jun 2025 20:32:26 GMT, Phil Race <p...@openjdk.org> wrote:
>> BasicTextUI.getVisibleEditorRect wording is rephrased to remove the wording >> "Due to an unfortunate set of historical events this method is >> inappropriately named". > > src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextUI.java line > 1033: > >> 1031: /** >> 1032: * Gets the allocation to give the root View. >> 1033: * The Rectangle returned has nothing to do with visibility but > > "nothing to do with" -> "unrelated to" > > > But what I'd really like to see is an explanation of what the return from > this method ACTUALLY means / is used for. > What does "the allocation" mean ? Too woolly for me. getVisibleEditorRect() return the bounds of the text editor and the return value is used to to set-size/paint the `javax.swing.text.View` of this text editor component. "the allocation" refers to what allocated area the view needs to paint, it seems to be a common phrase used in context of View class which says > "The view gets its allocation from the parent at paint time, so it must be > prepared to redo layout if the allocated area is different from what it is > prepared to deal with. " In that regard, probably getAllocatedViewRect() would have been better choice of the method name ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25850#discussion_r2156050700