Przeglądaj źródła

Remove ErrorFixedStatus

Change-Id: I84546c0da3ff10421178a7a39b92471dc06ee980
Depends-On: Ib80c1852cb5e9a627e793ff468723e932dda500d
Reviewed-on: http://gerrit.dmdirc.com/3331
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Greg Holmes <greg@dmdirc.com>
pull/1/head
Chris Smith 10 lat temu
rodzic
commit
3fecbb0160

+ 0
- 65
src/com/dmdirc/logger/ErrorFixedStatus.java Wyświetl plik

@@ -1,65 +0,0 @@
1
-/*
2
- * Copyright (c) 2006-2014 DMDirc Developers
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal
6
- * in the Software without restriction, including without limitation the rights
7
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- * copies of the Software, and to permit persons to whom the Software is
9
- * furnished to do so, subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- * SOFTWARE.
21
- */
22
-
23
-package com.dmdirc.logger;
24
-
25
-/**
26
- * Error fixed status.
27
- */
28
-public enum ErrorFixedStatus {
29
-
30
-    /** Not applicable. */
31
-    NEW("New bug"),
32
-    /** Finished state. */
33
-    KNOWN("Known bug"),
34
-    /** Sending state. */
35
-    FIXED("Fixed"),
36
-    /** Waiting state. */
37
-    INVALID("Invalid bug"),
38
-    /** Unreported. */
39
-    UNREPORTED("Unreported"),
40
-    /** Client too old. */
41
-    TOOOLD("Client too old - please update"),
42
-    /** Duplicate bug exists in list.
43
-     *
44
-     * @since 0.6.3m2 */
45
-    DUPLICATE("Duplicate bug exists in list"),
46
-    /** Unknown state. */
47
-    UNKNOWN("Unknown status");
48
-    /** toString value of the item. */
49
-    private String value;
50
-
51
-    /**
52
-     * Instantiates the enum.
53
-     *
54
-     * @param value toString value
55
-     */
56
-    ErrorFixedStatus(final String value) {
57
-        this.value = value;
58
-    }
59
-
60
-    @Override
61
-    public String toString() {
62
-        return value;
63
-    }
64
-
65
-}

+ 0
- 4
src/com/dmdirc/logger/ErrorManager.java Wyświetl plik

@@ -195,17 +195,13 @@ public class ErrorManager implements ConfigChangeListener {
195 195
         if (error.getLevel().equals(ErrorLevel.FATAL)) {
196 196
             if (dupe) {
197 197
                 error.setReportStatus(ErrorReportStatus.NOT_APPLICABLE);
198
-                error.setFixedStatus(ErrorFixedStatus.DUPLICATE);
199 198
             }
200 199
         } else if (!canReport || (appError && !error.isValidSource())) {
201 200
             error.setReportStatus(ErrorReportStatus.NOT_APPLICABLE);
202
-            error.setFixedStatus(ErrorFixedStatus.INVALID);
203 201
         } else if (!appError) {
204 202
             error.setReportStatus(ErrorReportStatus.NOT_APPLICABLE);
205
-            error.setFixedStatus(ErrorFixedStatus.UNREPORTED);
206 203
         } else if (dupe) {
207 204
             error.setReportStatus(ErrorReportStatus.NOT_APPLICABLE);
208
-            error.setFixedStatus(ErrorFixedStatus.DUPLICATE);
209 205
         } else if (sendReports) {
210 206
             sendError(error);
211 207
         }

+ 0
- 29
src/com/dmdirc/logger/ProgramError.java Wyświetl plik

@@ -81,8 +81,6 @@ public final class ProgramError implements Serializable {
81 81
     private AtomicInteger count;
82 82
     /** Error report Status. */
83 83
     private ErrorReportStatus reportStatus;
84
-    /** Error fixed Status. */
85
-    private ErrorFixedStatus fixedStatus;
86 84
 
87 85
     /**
88 86
      * Creates a new instance of ProgramError.
@@ -124,7 +122,6 @@ public final class ProgramError implements Serializable {
124 122
         this.lastDate = (Date) date.clone();
125 123
         this.count = new AtomicInteger(1);
126 124
         this.reportStatus = ErrorReportStatus.WAITING;
127
-        this.fixedStatus = ErrorFixedStatus.UNKNOWN;
128 125
     }
129 126
 
130 127
     /**
@@ -191,15 +188,6 @@ public final class ProgramError implements Serializable {
191 188
         return reportStatus;
192 189
     }
193 190
 
194
-    /**
195
-     * Returns the fixed status of this error.
196
-     *
197
-     * @return Error fixed status
198
-     */
199
-    public ErrorFixedStatus getFixedStatus() {
200
-        return fixedStatus;
201
-    }
202
-
203 191
     /**
204 192
      * Sets the report Status of this error.
205 193
      *
@@ -216,22 +204,6 @@ public final class ProgramError implements Serializable {
216 204
         }
217 205
     }
218 206
 
219
-    /**
220
-     * Sets the fixed status of this error.
221
-     *
222
-     * @param newStatus new ErrorFixedStatus for the error
223
-     */
224
-    public void setFixedStatus(final ErrorFixedStatus newStatus) {
225
-        if (newStatus != null && !fixedStatus.equals(newStatus)) {
226
-            fixedStatus = newStatus;
227
-            ErrorManager.getErrorManager().fireErrorStatusChanged(this);
228
-
229
-            synchronized (this) {
230
-                notifyAll();
231
-            }
232
-        }
233
-    }
234
-
235 207
     /**
236 208
      * Returns the ID of this error.
237 209
      *
@@ -337,7 +309,6 @@ public final class ProgramError implements Serializable {
337 309
         raven.sendEvent(eventBuilder.build());
338 310
 
339 311
         setReportStatus(ErrorReportStatus.FINISHED);
340
-        setFixedStatus(ErrorFixedStatus.NEW);
341 312
     }
342 313
 
343 314
     /**

+ 0
- 40
test/com/dmdirc/logger/ErrorFixedStatusTest.java Wyświetl plik

@@ -1,40 +0,0 @@
1
-/*
2
- * Copyright (c) 2006-2014 DMDirc Developers
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal
6
- * in the Software without restriction, including without limitation the rights
7
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- * copies of the Software, and to permit persons to whom the Software is
9
- * furnished to do so, subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- * SOFTWARE.
21
- */
22
-package com.dmdirc.logger;
23
-
24
-import org.junit.Test;
25
-
26
-import static org.junit.Assert.*;
27
-
28
-public class ErrorFixedStatusTest {
29
-
30
-    @Test
31
-    public void testToString() {
32
-        assertTrue(ErrorFixedStatus.NEW.toString().toLowerCase().indexOf("new") > -1);
33
-        assertTrue(ErrorFixedStatus.KNOWN.toString().toLowerCase().indexOf("known") > -1);
34
-        assertTrue(ErrorFixedStatus.FIXED.toString().toLowerCase().indexOf("fixed") > -1);
35
-        assertTrue(ErrorFixedStatus.INVALID.toString().toLowerCase().indexOf("invalid") > -1);
36
-        assertTrue(ErrorFixedStatus.UNREPORTED.toString().toLowerCase().indexOf("unreported") > -1);
37
-        assertTrue(ErrorFixedStatus.UNKNOWN.toString().toLowerCase().indexOf("unknown") > -1);
38
-    }
39
-
40
-}

+ 5
- 17
test/com/dmdirc/logger/ProgramErrorTest.java Wyświetl plik

@@ -19,10 +19,9 @@
19 19
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 20
  * SOFTWARE.
21 21
  */
22
-package com.dmdirc.logger;
23 22
 
23
+package com.dmdirc.logger;
24 24
 
25
-import java.util.Arrays;
26 25
 import java.util.Date;
27 26
 
28 27
 import org.junit.Before;
@@ -31,7 +30,9 @@ import org.junit.runner.RunWith;
31 30
 import org.mockito.Mock;
32 31
 import org.mockito.runners.MockitoJUnitRunner;
33 32
 
34
-import static org.junit.Assert.*;
33
+import static org.junit.Assert.assertEquals;
34
+import static org.junit.Assert.assertFalse;
35
+import static org.junit.Assert.assertTrue;
35 36
 
36 37
 @RunWith(MockitoJUnitRunner.class)
37 38
 public class ProgramErrorTest {
@@ -108,19 +109,6 @@ public class ProgramErrorTest {
108 109
         assertEquals(ErrorReportStatus.ERROR, pe.getReportStatus());
109 110
     }
110 111
 
111
-    @Test
112
-    public void testFixedStatus() {
113
-        final ProgramError pe = new ProgramError(1, ErrorLevel.HIGH, "moo",
114
-                new Exception(), null, new Date());
115
-        assertEquals(ErrorFixedStatus.UNKNOWN, pe.getFixedStatus());
116
-        pe.setFixedStatus(null);
117
-        assertEquals(ErrorFixedStatus.UNKNOWN, pe.getFixedStatus());
118
-        pe.setFixedStatus(ErrorFixedStatus.UNKNOWN);
119
-        assertEquals(ErrorFixedStatus.UNKNOWN, pe.getFixedStatus());
120
-        pe.setFixedStatus(ErrorFixedStatus.INVALID);
121
-        assertEquals(ErrorFixedStatus.INVALID, pe.getFixedStatus());
122
-    }
123
-
124 112
     @Test
125 113
     public void testToString() {
126 114
         final ProgramError pe = new ProgramError(1, ErrorLevel.HIGH, "moo",
@@ -159,4 +147,4 @@ public class ProgramErrorTest {
159 147
         assertEquals(pe1.hashCode(), pe1.hashCode());
160 148
     }
161 149
 
162
-}
150
+}

Ładowanie…
Anuluj
Zapisz