• 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/plugin/ProgressBarDialog.java
1
package edu.jiangxin.apktoolbox.swing.extend.plugin;
2

3
import edu.jiangxin.apktoolbox.utils.Constants;
4

5
import javax.swing.*;
6
import java.awt.*;
7
import java.io.Serial;
8

9
public class ProgressBarDialog extends JDialog {
10
    @Serial
11
    private static final long serialVersionUID = 1L;
12
    final JProgressBar progressBar = new JProgressBar();
×
13
    final JLabel progressLabel = new JLabel("");
×
14

NEW
15
    public ProgressBarDialog() {
×
NEW
16
    }
×
17

18
    // in case of escape of "this"
19
    public void initialize(String title) {
20
        setTitle(title);
×
21
        setSize(400, 100);
×
22
        setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));
×
23
        //Swing Worker can't update GUI components in modal jdialog
24
        //https://stackoverflow.com/questions/54496606/swing-worker-cant-update-gui-components-in-modal-jdialog
25
        setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
×
26
        setLocationRelativeTo(null);
×
27

28
        add(Box.createVerticalStrut(Constants.DEFAULT_Y_BORDER));
×
29

30
        JPanel contentPanel = new JPanel();
×
31
        contentPanel.setLayout(new BoxLayout(contentPanel, BoxLayout.X_AXIS));
×
32
        add(contentPanel);
×
33

34
        contentPanel.add(Box.createHorizontalStrut(Constants.DEFAULT_X_BORDER));
×
35

36
        progressBar.setMaximum(100);
×
37
        progressBar.setValue(0);
×
38
        progressBar.setPreferredSize(new Dimension(300, 20));
×
39
        contentPanel.add(progressBar);
×
40

41
        contentPanel.add(Box.createHorizontalStrut(Constants.DEFAULT_X_BORDER));
×
42

43
        contentPanel.add(progressLabel);
×
44

45
        contentPanel.add(Box.createHorizontalStrut(Constants.DEFAULT_X_BORDER));
×
46

47
        add(Box.createVerticalStrut(Constants.DEFAULT_Y_BORDER));
×
48
    }
×
49

50
    public void setValue(int value) {
51
        progressBar.setValue(value);
×
52
        progressLabel.setText(value + "%");
×
53
    }
×
54
}
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