<commit_before>package com.pump.swing.popup;

import java.awt.Component;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Rectangle;
import java.util.Objects;

import javax.swing.JComponent;

/**
 * This PopupTarget points to a component's bounds.
 */
public class BasicPopupTarget implements PopupTarget {
	Component component;

	public BasicPopupTarget(Component c) {
		Objects.requireNonNull(c);
		this.component = c;
	}

	@Override
	public Rectangle getScreenBounds() {
		Insets insets;
		if (component instanceof JComponent) {<commit_msg>Fixing exception when component isn't showing<commit_after>package com.pump.swing.popup;

import java.awt.Component;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Rectangle;
import java.util.Objects;

import javax.swing.JComponent;

/**
 * This PopupTarget points to a component's bounds.
 */
public class BasicPopupTarget implements PopupTarget {
	Component component;

	public BasicPopupTarget(Component c) {
		Objects.requireNonNull(c);
		this.component = c;
	}

	@Override
	public Rectangle getScreenBounds() {
		if (!component.isShowing())
			return null;

		Insets insets;
		if (component instanceof JComponent) {
{'fraction_non_alphanumeric': 0.0972338642078793, 'fraction_numerical': 0.0, 'mean_word_length': 4.940298507462686, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2365936', 'n_tokens_mistral': 376, 'n_tokens_neox': 362, 'n_words': 97}