ItemList.java

1
/*******************************************************************************
2
 * Copyhacked (H) 2012-2025.
3
 * This program and the accompanying materials
4
 * are made available under no term at all, use it like
5
 * you want, but share and discuss it
6
 * every time possible with every body.
7
 * 
8
 * Contributors:
9
 *      ron190 at ymail dot com - initial implementation
10
 ******************************************************************************/
11
package com.jsql.view.swing.list;
12
13
/**
14
 * Basic object to avoid String incompatibility with drag and drop feature.
15
 */
16
public class ItemList {
17
    
18
    /**
19
     * Text displayed on item.
20
     */
21
    private final String originalString;
22
    private String internalString;
23
    private boolean isVulnerable = false;
24
25
    /**
26
     * Create a JList item.
27
     */
28
    public ItemList(String newString) {
29
        this.internalString = newString;
30
        this.originalString = newString;
31
    }
32
    
33
    public void reset() {
34
        this.internalString = this.originalString;
35
    }
36
    
37
    @Override
38
    public String toString() {
39 1 1. toString : replaced return value with "" for com/jsql/view/swing/list/ItemList::toString → NO_COVERAGE
        return this.internalString;
40
    }
41
    
42
    
43
    // Getter and setter
44
45
    public String getInternalString() {
46 1 1. getInternalString : replaced return value with "" for com/jsql/view/swing/list/ItemList::getInternalString → NO_COVERAGE
        return this.internalString;
47
    }
48
49
    public void setInternalString(String internalString) {
50
        this.internalString = internalString;
51
    }
52
    
53
    public String getOriginalString() {
54 1 1. getOriginalString : replaced return value with "" for com/jsql/view/swing/list/ItemList::getOriginalString → NO_COVERAGE
        return this.originalString;
55
    }
56
57
    public boolean isVulnerable() {
58 2 1. isVulnerable : replaced boolean return with true for com/jsql/view/swing/list/ItemList::isVulnerable → NO_COVERAGE
2. isVulnerable : replaced boolean return with false for com/jsql/view/swing/list/ItemList::isVulnerable → NO_COVERAGE
        return this.isVulnerable;
59
    }
60
61
    public void setVulnerable(boolean vulnerable) {
62
        this.isVulnerable = vulnerable;
63
    }
64
}

Mutations

39

1.1
Location : toString
Killed by : none
replaced return value with "" for com/jsql/view/swing/list/ItemList::toString → NO_COVERAGE

46

1.1
Location : getInternalString
Killed by : none
replaced return value with "" for com/jsql/view/swing/list/ItemList::getInternalString → NO_COVERAGE

54

1.1
Location : getOriginalString
Killed by : none
replaced return value with "" for com/jsql/view/swing/list/ItemList::getOriginalString → NO_COVERAGE

58

1.1
Location : isVulnerable
Killed by : none
replaced boolean return with true for com/jsql/view/swing/list/ItemList::isVulnerable → NO_COVERAGE

2.2
Location : isVulnerable
Killed by : none
replaced boolean return with false for com/jsql/view/swing/list/ItemList::isVulnerable → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.19.1