5555import java .util .Map ;
5656import java .util .Optional ;
5757import java .util .Set ;
58- import java .util .concurrent .atomic .AtomicInteger ;
5958import java .util .stream .Stream ;
6059
6160import static com .google .common .collect .ImmutableList .toImmutableList ;
@@ -194,7 +193,7 @@ public void mousePressed(MouseEvent e) {
194193 final Font editorFont = ScaleUtil .scaleFont (Config .currentFonts ().editor .value ());
195194 final Font italEditorFont = ScaleUtil .scaleFont (Config .currentFonts ().editor .value ().deriveFont (Font .ITALIC ));
196195
197- final AtomicInteger gridY = new AtomicInteger ( 0 ) ;
196+ int gridY = 0 ;
198197
199198 {
200199 final Box parentLabelRow = Box .createHorizontalBox ();
@@ -209,7 +208,7 @@ public void mousePressed(MouseEvent e) {
209208 parentLabelRow .add (Box .createHorizontalGlue ());
210209
211210 this .add (parentLabelRow , GridBagConstraintsBuilder .create ()
212- .pos (0 , gridY . getAndIncrement () )
211+ .pos (0 , gridY ++ )
213212 .insets (ROW_OUTER_INSET , ROW_OUTER_INSET , ROW_INNER_INSET , ROW_OUTER_INSET )
214213 .anchor (GridBagConstraints .LINE_START )
215214 .build ()
@@ -223,22 +222,22 @@ public void mousePressed(MouseEvent e) {
223222 // The snippet has its own scroll pane, but wrapping it in this one effectively disables its resizing.
224223 final var mainScroll = new JScrollPane (mainContent );
225224 mainScroll .setBorder (createEmptyBorder ());
226- final var mainGridY = new AtomicInteger ( 0 ) ;
225+ int mainGridY = 0 ;
227226
228227 final String javadoc = this .getJavadoc (target ).orElse (null );
229228 final ImmutableList <ParamJavadoc > paramJavadocs =
230229 this .paramJavadocsOf (target , editorFont , italEditorFont , stopInteraction );
231230 if (javadoc != null || !paramJavadocs .isEmpty ()) {
232231 mainContent .add (new JSeparator (), GridBagConstraintsBuilder .create ()
233- .pos (0 , mainGridY . getAndIncrement () )
232+ .pos (0 , mainGridY ++ )
234233 .weightX (1 )
235234 .fill (GridBagConstraints .HORIZONTAL )
236235 .build ()
237236 );
238237
239238 if (javadoc != null ) {
240239 mainContent .add (javadocOf (javadoc , italEditorFont , stopInteraction ), GridBagConstraintsBuilder .create ()
241- .pos (0 , mainGridY . getAndIncrement () )
240+ .pos (0 , mainGridY ++ )
242241 .insets (ROW_INNER_INSET , ROW_OUTER_INSET )
243242 .weightX (1 )
244243 .fill (GridBagConstraints .HORIZONTAL )
@@ -249,17 +248,17 @@ public void mousePressed(MouseEvent e) {
249248
250249 if (!paramJavadocs .isEmpty ()) {
251250 final JPanel params = new JPanel (new GridBagLayout ());
252- final AtomicInteger paramsGridY = new AtomicInteger ( 0 ) ;
251+ int paramsGridY = 0 ;
253252
254253 for (final ParamJavadoc paramJavadoc : paramJavadocs ) {
255254 params .add (paramJavadoc .name , GridBagConstraintsBuilder .create ()
256- .pos (0 , paramsGridY . get () )
255+ .pos (0 , paramsGridY )
257256 .anchor (GridBagConstraints .FIRST_LINE_END )
258257 .build ()
259258 );
260259
261260 params .add (paramJavadoc .javadoc , GridBagConstraintsBuilder .create ()
262- .pos (1 , paramsGridY . getAndIncrement () )
261+ .pos (1 , paramsGridY ++ )
263262 .weightX (1 )
264263 .fill (GridBagConstraints .HORIZONTAL )
265264 .anchor (GridBagConstraints .LINE_START )
@@ -269,7 +268,7 @@ public void mousePressed(MouseEvent e) {
269268
270269 mainContent .add (params , GridBagConstraintsBuilder .create ()
271270 .insets (ROW_INNER_INSET , ROW_OUTER_INSET )
272- .pos (0 , mainGridY . getAndIncrement () )
271+ .pos (0 , mainGridY ++ )
273272 .weightX (1 )
274273 .fill (GridBagConstraints .HORIZONTAL )
275274 .build ()
@@ -342,22 +341,22 @@ public void mouseClicked(MouseEvent e) {
342341 }
343342
344343 mainContent .add (this .declarationSnippet .ui , GridBagConstraintsBuilder .create ()
345- .pos (0 , mainGridY . getAndIncrement () )
344+ .pos (0 , mainGridY ++ )
346345 .weightX (1 )
347346 .fill (GridBagConstraints .HORIZONTAL )
348347 .anchor (GridBagConstraints .LINE_START )
349348 .build ()
350349 );
351350 } else {
352351 mainContent .add (new JSeparator (), GridBagConstraintsBuilder .create ()
353- .pos (0 , mainGridY . getAndIncrement () )
352+ .pos (0 , mainGridY ++ )
354353 .weightX (1 )
355354 .fill (GridBagConstraints .HORIZONTAL )
356355 .build ()
357356 );
358357
359358 mainContent .add (labelOf ("No source available" , italEditorFont ), GridBagConstraintsBuilder .create ()
360- .pos (0 , mainGridY . getAndIncrement () )
359+ .pos (0 , mainGridY ++ )
361360 .weightX (1 )
362361 .fill (GridBagConstraints .HORIZONTAL )
363362 .anchor (GridBagConstraints .LINE_START )
@@ -368,7 +367,7 @@ public void mouseClicked(MouseEvent e) {
368367 }
369368
370369 this .add (mainScroll , GridBagConstraintsBuilder .create ()
371- .pos (0 , gridY . getAndIncrement () )
370+ .pos (0 , gridY ++ )
372371 .weight (1 , 1 )
373372 .fill (GridBagConstraints .BOTH )
374373 .build ()
0 commit comments