Skip to content

Commit b0a8006

Browse files
committed
Reformat code and remove empty lines
1 parent 80e90d7 commit b0a8006

File tree

4 files changed

+34
-14
lines changed

4 files changed

+34
-14
lines changed

swan-assist/src/main/java/de/fraunhofer/iem/swan/assist/data/MethodWrapper.java

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public MethodWrapper() {
4949

5050
/**
5151
* Initializes MethodWrapper Object
52+
*
5253
* @param method Method
5354
*/
5455
public MethodWrapper(Method method) {
@@ -58,6 +59,7 @@ public MethodWrapper(Method method) {
5859

5960
/**
6061
* Initialises MethodWrapper object
62+
*
6163
* @param methodName Name of method
6264
* @param parameters List of method's parameters
6365
* @param returnType Method's return type
@@ -76,6 +78,7 @@ public int compareTo(@NotNull MethodWrapper o) {
7678

7779
/**
7880
* Returns Method object
81+
*
7982
* @return Method object
8083
*/
8184
public Method getMethod() {
@@ -84,6 +87,7 @@ public Method getMethod() {
8487

8588
/**
8689
* Trim argument and returns last string
90+
*
8791
* @param property Classname or data to be trimmed
8892
* @return Trimmed data
8993
*/
@@ -93,6 +97,7 @@ private String trimProperty(String property) {
9397

9498
/**
9599
* Returns classname for method
100+
*
96101
* @param fullyQualifiedName Condition to determine if fully qualified name of class should be returned
97102
* @return Method name
98103
*/
@@ -106,6 +111,7 @@ public String getMethodName(boolean fullyQualifiedName) {
106111

107112
/**
108113
* Returns classname for method
114+
*
109115
* @param fullyQualifiedName Condition to determine if fully qualified name of class should be returned
110116
* @return Method's classname
111117
*/
@@ -119,6 +125,7 @@ public String getClassName(boolean fullyQualifiedName) {
119125

120126
/**
121127
* Returns filename for method
128+
*
122129
* @return Filename with extension
123130
*/
124131
public String getFileName() {
@@ -128,6 +135,7 @@ public String getFileName() {
128135

129136
/**
130137
* Returns method's signature
138+
*
131139
* @param isfullyQualifiedName Condition to determine if fully qualified name of class should be returned
132140
* @return Method's signature
133141
*/
@@ -139,6 +147,7 @@ public String getSignature(boolean isfullyQualifiedName) {
139147

140148
/**
141149
* Returns the list of parameters
150+
*
142151
* @param isFullyQualifiedName Condition to determine if fully qualified name of class should be returned
143152
* @return List of parameters
144153
*/
@@ -158,6 +167,7 @@ public List<String> getParameters(boolean isFullyQualifiedName) {
158167

159168
/**
160169
* Returns the return type of the function
170+
*
161171
* @param isFullyQualifiedName Condition to determine if fully qualified name of class should be returned
162172
* @return Method's return type
163173
*/
@@ -171,21 +181,23 @@ public String getReturnType(boolean isFullyQualifiedName) {
171181

172182
/**
173183
* Returns array list of CWEs that are assigned to the method
184+
*
174185
* @return Array list of CWE's
175186
*/
176187
public ArrayList<String> getCWEList() {
177188

178189
ArrayList<String> cweList = new ArrayList<String>();
179190

180191
for (Category category : method.getCwe()) {
181-
cweList.add(category.toString());
192+
cweList.add(category.toString());
182193
}
183194

184195
return cweList;
185196
}
186197

187198
/**
188199
* Returns array list of types that are assigned to the method
200+
*
189201
* @param capitalize Condition to capitalize first character of types
190202
* @return Array list of types
191203
*/
@@ -205,6 +217,7 @@ public ArrayList<String> getTypesList(boolean capitalize) {
205217

206218
/**
207219
* Returns set of method categories
220+
*
208221
* @return Set of Method categories
209222
*/
210223
public Set<Category> getCategories() {
@@ -213,14 +226,15 @@ public Set<Category> getCategories() {
213226

214227
/**
215228
* Set method categories
229+
*
216230
* @param categories Method categories
217231
*/
218232
public void setCategories(Set<Category> categories) {
219233

220234
Set<Category> cweCategories = new HashSet<>();
221235
Set<Category> srmCategories = new HashSet<>();
222236

223-
for(Category category: categories) {
237+
for (Category category : categories) {
224238
if (category.isCwe()) {
225239
cweCategories.add(category);
226240
} else {
@@ -233,6 +247,7 @@ public void setCategories(Set<Category> categories) {
233247

234248
/**
235249
* Returns update operation for method: new, delete, etc.
250+
*
236251
* @return Update operation for method.
237252
*/
238253
public String getUpdateOperation() {
@@ -241,6 +256,7 @@ public String getUpdateOperation() {
241256

242257
/**
243258
* Returns whether the method is a training method
259+
*
244260
* @return Whether the method is a training method
245261
*/
246262
public boolean isTrainingMethod() {
@@ -249,6 +265,7 @@ public boolean isTrainingMethod() {
249265

250266
/**
251267
* Set whether the method is a training method
268+
*
252269
* @param trainingMethod Whether the method is a training method
253270
*/
254271
public void setTrainingMethod(boolean trainingMethod) {
@@ -257,6 +274,7 @@ public void setTrainingMethod(boolean trainingMethod) {
257274

258275
/**
259276
* Set method's update operation
277+
*
260278
* @param updateOperation Method's update operation
261279
*/
262280
public void setUpdateOperation(String updateOperation) {
@@ -267,21 +285,23 @@ public void setUpdateOperation(String updateOperation) {
267285

268286
/**
269287
* Generates and returns the message for the editor marker
288+
*
270289
* @return Message for editor marker
271290
*/
272291
public String getMarkerMessage() {
273292

274293
String message = "<html><i>Potential</i> <b>" + StringUtils.join(getTypesList(true), ", ") + "</b> method";
275294

276-
if(getCWEList().size()>0)
277-
message += " of sensitive information relevant for <b>" + StringUtils.join(getCWEList(), ", ")+"</b";
295+
if (!getCWEList().isEmpty())
296+
message += " of sensitive information relevant for <b>" + StringUtils.join(getCWEList(), ", ") + "</b";
278297

279-
message+=".</html>";
298+
message += ".</html>";
280299
return message;
281300
}
282301

283302
/**
284303
* Set message that should be used for marker.
304+
*
285305
* @param markerMessage Method's message
286306
*/
287307
public void setMarkerMessage(String markerMessage) {
@@ -290,6 +310,7 @@ public void setMarkerMessage(String markerMessage) {
290310

291311
/**
292312
* Status of method: suggested, etc.
313+
*
293314
* @return Method's status/origin
294315
*/
295316
public MethodStatus getStatus() {
@@ -298,6 +319,7 @@ public MethodStatus getStatus() {
298319

299320
/**
300321
* Set method status
322+
*
301323
* @param status Method's status/origin
302324
*/
303325
public void setStatus(MethodStatus status) {
@@ -306,9 +328,10 @@ public void setStatus(MethodStatus status) {
306328

307329
/**
308330
* Returns method as string: method signature
331+
*
309332
* @return Method signature
310333
*/
311-
public String toString(){
334+
public String toString() {
312335
return getSignature(false);
313336
}
314337
}

swan-assist/src/main/java/de/fraunhofer/iem/swan/assist/ui/MethodListTree.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,6 @@ private DefaultMutableTreeNode searchNode(DefaultMutableTreeNode root, String qu
512512
if (node.getUserObject() instanceof MethodWrapper) {
513513

514514
MethodWrapper methodWrapper = (MethodWrapper) node.getUserObject();
515-
516515
if (query.equals(methodWrapper.getSignature(true))) {
517516
return node;
518517
}

swan-assist/src/main/java/de/fraunhofer/iem/swan/assist/ui/MethodTreeRenderer.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ else if (method.getUpdateOperation() != null && method.getUpdateOperation().equa
7272
} else if (object instanceof Category) {
7373

7474
Category category = (Category) object;
75-
7675
text.setIcon(IconUtils.getIcon(category.toString()));
7776

7877
if (category.isCwe()) {

swan-assist/src/main/java/de/fraunhofer/iem/swan/assist/ui/SummaryToolWindow.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/*******************************************************************************
22
* Copyright (c) 2018 Fraunhofer IEM, Paderborn, Germany.
3-
*
43
* Contributors:
54
* Oshando Johnson (oshando.johnson@iem.fraunhofer.de ) - initial implementation
65
******************************************************************************/
@@ -42,10 +41,10 @@ public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindo
4241
final DefaultActionGroup actions = (DefaultActionGroup) ActionManager.getInstance().getAction("SWAN_Assist.ActionBar");
4342
final ActionToolbar actionToolbar = ActionManager.getInstance().createActionToolbar("SummaryToolbar", actions, true);
4443

45-
if(toolWindow.getAnchor().isHorizontal()){
44+
if (toolWindow.getAnchor().isHorizontal()) {
4645
actionToolbar.setOrientation(SwingConstants.VERTICAL);
4746
toolPanel.add(actionToolbar.getComponent(), BorderLayout.LINE_START);
48-
}else{
47+
} else {
4948
actionToolbar.setOrientation(SwingConstants.HORIZONTAL);
5049
toolPanel.add(actionToolbar.getComponent(), BorderLayout.PAGE_START);
5150
}
@@ -54,11 +53,11 @@ public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindo
5453
toolPanel.add(new JBScrollPane(new MethodListTree(project)), BorderLayout.CENTER);
5554

5655
//If a configuration file was already selected, load it
57-
if(PropertiesComponent.getInstance(project).isValueSet(Constants.LAST_SRM_LIST)){
56+
if (PropertiesComponent.getInstance(project).isValueSet(Constants.LAST_SRM_LIST)) {
5857

59-
File configFile = new File(Objects.requireNonNull(PropertiesComponent.getInstance(project).getValue(Constants.LAST_SRM_LIST)));
58+
File configFile = new File(Objects.requireNonNull(PropertiesComponent.getInstance(project).getValue(Constants.LAST_SRM_LIST)));
6059

61-
if(configFile.exists()){
60+
if (configFile.exists()) {
6261

6362
MessageBus messageBus = project.getMessageBus();
6463
ConfigurationFileNotifier publisher = messageBus.syncPublisher(ConfigurationFileNotifier.FILE_NOTIFIER_TOPIC);

0 commit comments

Comments
 (0)