Fixed most reported issues by SonarCloud.

This commit is contained in:
Toxic Dreamz
2020-08-15 21:47:39 +04:00
parent e7e3ace01f
commit 31471acb69
190 changed files with 1426 additions and 661 deletions

View File

@ -35,6 +35,10 @@ import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import static javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED;
import static javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED;
import static javax.swing.WindowConstants.EXIT_ON_CLOSE;
/**
* This class is the GUI implementation of the View component in the Model-View-Presenter pattern.
*/
@ -80,7 +84,7 @@ public class FileSelectorJFrame extends JFrame implements FileSelectorView, Acti
*/
public FileSelectorJFrame() {
super("File Loader");
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
this.setLayout(null);
this.setBounds(100, 100, 500, 200);
@ -119,8 +123,8 @@ public class FileSelectorJFrame extends JFrame implements FileSelectorView, Acti
*/
this.area = new JTextArea(100, 100);
var pane = new JScrollPane(area);
pane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
pane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
pane.setHorizontalScrollBarPolicy(HORIZONTAL_SCROLLBAR_AS_NEEDED);
pane.setVerticalScrollBarPolicy(VERTICAL_SCROLLBAR_AS_NEEDED);
panel.add(pane);
this.area.setEditable(false);
pane.setBounds(150, 100, 250, 80);

View File

@ -25,14 +25,16 @@ package com.iluwatar.model.view.presenter;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
/**
* Application test
*/
public class AppTest {
class AppTest {
@Test
public void test() {
App.main(new String[]{});
void shouldExecuteApplicationWithoutException() {
assertDoesNotThrow(() -> App.main(new String[]{}));
}
}