-
Notifications
You must be signed in to change notification settings - Fork 0
/
CodeSnips
145 lines (110 loc) · 4.73 KB
/
CodeSnips
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
s = String.format(LanguageController.getInstance().
getErrorProp("GeneralError"),
"No text returned.");
Utils.getInstance().showMsgTitleClassMethodMsgIcon(
LanguageController.getInstance().getErrorProp("Title"),
Thread.currentThread().getStackTrace()[1].
getClassName(),
Thread.currentThread().getStackTrace()[1].
getMethodName(),
s,
JOptionPane.ERROR_MESSAGE);
throw new UnsupportedOperationException(s);
String s;
s = String.format(errProps.getProperty("Formatted1"), Arrays.toString(args));
// there are arguments but they do not match what we can handle
Utils.getInstance().showMsgTitleClassMethodMsgIcon(
aTitle,
Thread.currentThread().getStackTrace()[1].getClassName(),
Thread.currentThread().getStackTrace()[1].getMethodName(),
s,
JOptionPane.ERROR_MESSAGE);
Thread.currentThread().getStackTrace()[1].getClassName(),
Thread.currentThread().getStackTrace()[1].getMethodName(),
class could be refactored into a named static inner class
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
value = "SIC_INNER_SHOULD_BE_STATIC_ANON",
justification = "Yes, but don't wanna")
nonconstant string passed to execute or addBatch method
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
value = "SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE",
justification = "Yes, but controlled")
prepared statement
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
value = "SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING",
justification = "Yes, but controlled")
serializable transient
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
value = "SE_BAD_FIELD",
justification = "Do not know what to do with this")
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
value="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD",
justification="Singleton, only one instance allowed")
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
value="NM_CONFUSING",
justification="Not confusing.")
"OBL_UNSATISFIED_OBLIGATION"
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
value="SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING",
justification="Not ready to fix this")
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
value="DM_CONVERT_CASE",
justification="Not ready to fix this")
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
value="SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING",
justification="Not ready to fix this")
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
value="URF_UNREAD_FIELD",
justification="True, but need it")
fErrorPrefix = Thread.currentThread().getStackTrace()[1].getMethodName();
***************
throw new DAOException(
LanguageModel.getInstance().getAppProp("Title"),
errorPrefix, fErrorPrefix,
ex.getMessage(), JOptionPane.ERROR_MESSAGE);
***************
public void showMsgTitleClassMethodMsgIcon(
String aTitle,
String aClass,
String aMethod,
String aMsg,
Integer iIcon)
String s;
s = String.format(errProps.getProperty("Formatted1"), Arrays.toString(args));
// there are arguments but they do not match what we can handle
Utils.getInstance().showMsgTitleClassMethodMsgIcon(
aTitle,
errorPrefix,
fErrorPrefix,
s,
JOptionPane.ERROR_MESSAGE);
return false;
*****************
public void showMsgTitleClassMethodMsgIcon(
String aTitle,
String aClass,
String aMethod,
String aMsg,
Integer iIcon)
Utils.getInstance().showMsgTitleClassMethodMsgIcon(
LanguageModel.getInstance().getAppProps().getProperty("Title"),
errorPrefix,
fErrorPrefix,
LanguageModel.getInstance().getAppProps().
getProperty("MenuFileOpenTitle") + " not implemented.",
JOptionPane.ERROR_MESSAGE);
**********************
s = String.format(LanguageModel.getInstance().
getErrorProps().getProperty("Formatted3"),
tm.getsTransType());
Utils.getInstance().
showErrorMsg(errorPrefix,
fErrorPrefix,
s,
JOptionPane.ERROR_MESSAGE);
return false;
********************
private Logger logger;
this.logger = LoggerFactory.getLogger(this.getClass().getName());
********************
fErrorPrefix = Thread.currentThread().getStackTrace()[1].getMethodName();