• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jiangxincode / ApkToolBoxGUI / #1207

13 Sep 2025 11:58PM UTC coverage: 2.895% (-0.006%) from 2.901%
#1207

push

jiangxincode
fix #569: 可能在完全初始化子类之前逃逸了 'this'

0 of 32 new or added lines in 22 files covered. (0.0%)

9 existing lines in 8 files now uncovered.

248 of 8567 relevant lines covered (2.89%)

0.03 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/edu/jiangxin/apktoolbox/swing/extend/autocomplete/AutoCompleteComboBox.java
1
package edu.jiangxin.apktoolbox.swing.extend.autocomplete;
2

3
import javax.swing.*;
4
import java.io.Serial;
5
import java.util.Vector;
6

7
/**
8
 * @author jiangxin
9
 * @author 2018-09-09
10
 *
11
 */
12
public class AutoCompleteComboBox<E> extends JComboBox<E> {
13

14
    @Serial
15
    private static final long serialVersionUID = 1L;
16
    private transient AutoCompleter<E> completer;
17

18
    public AutoCompleteComboBox() {
19
        super();
×
20
    }
×
21

22
    // in case of escape of "this"
23
    public void initialize() {
NEW
24
        setUI(new ScrollBasicComboBoxUI());
×
25
        setEditable(true);
×
26
        completer = new AutoCompleter<>(this);
×
27
    }
×
28

29
    public void autoComplete(String str) {
30
        this.completer.autoComplete(str);
×
31
    }
×
32

33
    public String getText() {
34
        return ((JTextField) getEditor().getEditorComponent()).getText();
×
35
    }
36

37
    public void setText(String text) {
38
        ((JTextField) getEditor().getEditorComponent()).setText(text);
×
39
    }
×
40

41
    public boolean containsItem(String itemString) {
42
        for (int i = 0; i < this.getModel().getSize(); i++) {
×
43
            String item = " " + this.getModel().getElementAt(i);
×
44
            if (item.equals(itemString)) {
×
45
                return true;
×
46
            }
47
        }
48
        return false;
×
49
    }
50
}
51

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc