Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #174 compiler warnings + #172 addresses some LGTM alerts #206

Merged
merged 3 commits into from
May 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions src/main/java/net/atomique/ksar/SSHCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,12 @@ private void initComponents(JDialog dialog) {
infopanel = new javax.swing.JPanel();
hostnamePanel = new javax.swing.JPanel();
HostnameLabel = new javax.swing.JLabel();
HostComboBox = new javax.swing.JComboBox();
passwordPanel = new javax.swing.JPanel();
HostComboBox = new javax.swing.JComboBox<>();
PasswordLabel = new javax.swing.JLabel();
PasswordField = new javax.swing.JPasswordField();
commandPanel = new javax.swing.JPanel();
ComboBoxLabel = new javax.swing.JLabel();
commandComboBox = new javax.swing.JComboBox();
commandComboBox = new javax.swing.JComboBox<>();
buttonpanel = new javax.swing.JPanel();
Cancelbutton = new javax.swing.JButton();
ConnectionButton = new javax.swing.JButton();
Expand Down Expand Up @@ -488,21 +487,21 @@ public void showMessage(String message) {
private javax.swing.JButton Cancelbutton;
private javax.swing.JLabel ComboBoxLabel;
private javax.swing.JButton ConnectionButton;
private javax.swing.JComboBox HostComboBox;
private javax.swing.JComboBox<String> HostComboBox;
private javax.swing.JLabel HostnameLabel;
private javax.swing.JPasswordField PasswordField;
private javax.swing.JLabel PasswordLabel;
private javax.swing.JPanel buttonpanel;
private javax.swing.JComboBox commandComboBox;
private javax.swing.JComboBox<String> commandComboBox;
private javax.swing.JPanel commandPanel;
private javax.swing.JPanel headerpanel;
private javax.swing.JPanel hostnamePanel;
private javax.swing.JPanel infopanel;
private javax.swing.JPanel passwordPanel;
private javax.swing.JPanel passwordPanel = new JPanel();
private javax.swing.JLabel titleLabel;
// End of variables declaration
private DefaultComboBoxModel userhostModel = new DefaultComboBoxModel();
private DefaultComboBoxModel commandModel = new DefaultComboBoxModel();
private DefaultComboBoxModel<String> userhostModel = new DefaultComboBoxModel<>();
private DefaultComboBoxModel<String> commandModel = new DefaultComboBoxModel<>();
private String command;
private kSar mysar;
private JDialog dialog = new JDialog();
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/net/atomique/ksar/export/FileCSV.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

Expand Down Expand Up @@ -86,7 +85,7 @@ private void export_treenode_header(SortedTreeNode node) {
int num = node.getChildCount();

if (num > 0) {
/* Object obj1 = node.getUserObject();
/*Object obj1 = node.getUserObject();
if (obj1 instanceof ParentNodeInfo) {
ParentNodeInfo tmpnode = (ParentNodeInfo) obj1;
List nodeobj = tmpnode.getNode_object();
Expand All @@ -112,7 +111,7 @@ private void export_treenode_data(SortedTreeNode node, RegularTimePeriod time) {
int num = node.getChildCount();

if (num > 0) {
/* Object obj1 = node.getUserObject();
/*Object obj1 = node.getUserObject();
if (obj1 instanceof ParentNodeInfo) {
ParentNodeInfo tmpnode = (ParentNodeInfo) obj1;
List nodeobj = tmpnode.getNode_object();
Expand Down
55 changes: 30 additions & 25 deletions src/main/java/net/atomique/ksar/export/FilePDF.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,33 +92,38 @@ public void run() {

try {
writer = PdfWriter.getInstance(document, new FileOutputStream(pdffilename));

writer.setPageEvent(this);
writer.setCompressionLevel(0);

// document parameter before open
document.addTitle("kSar Grapher");
//document.addSubject("SAR Statistics of " + mysar.hostName);
//document.addKeywords("https://github.com/vlsi/ksar");
//document.addKeywords(mysar.hostName);
//document.addKeywords(mysar.myOS.sarStartDate);
//document.addKeywords(mysar.myOS.sarEndDate);
document.addCreator("kSar Version:" + VersionNumber.getVersionString());
document.addAuthor("https://github.com/vlsi/ksar");

// open the doc
document.open();
pdfcb = writer.getDirectContent();
PdfOutline root = pdfcb.getRootOutline();

IndexPage(document);

export_treenode(mysar.graphtree, root);

document.close();

} catch (DocumentException | FileNotFoundException ex) {
log.error("Parser Exception", ex);
log.error("PDF creation Exception", ex);
} finally {
if (writer != null) {
writer.close();
}
}
writer.setPageEvent(this);
writer.setCompressionLevel(0);

// document parameter before open
document.addTitle("kSar Grapher");
//document.addSubject("SAR Statistics of " + mysar.hostName);
//document.addKeywords("https://github.com/vlsi/ksar");
//document.addKeywords(mysar.hostName);
//document.addKeywords(mysar.myOS.sarStartDate);
//document.addKeywords(mysar.myOS.sarEndDate);
document.addCreator("kSar Version:" + VersionNumber.getVersionString());
document.addAuthor("https://github.com/vlsi/ksar");

// open the doc
document.open();
pdfcb = writer.getDirectContent();
PdfOutline root = pdfcb.getRootOutline();

IndexPage(document);

export_treenode(mysar.graphtree, root);

document.close();
writer.close();

if (dialog != null) {
dialog.dispose();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/atomique/ksar/ui/Preferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ private void CancelButtonActionPerformed(
private javax.swing.JSpinner jSpinner1;
private javax.swing.JSpinner jSpinner2;
// End of variables declaration//GEN-END:variables
DefaultComboBoxModel UI_lanf_model = new DefaultComboBoxModel();
DefaultComboBoxModel<String> UI_lanf_model = new DefaultComboBoxModel<>();
DefaultComboBoxModel<String> PageFormatComboBox = new DefaultComboBoxModel<>();
DefaultComboBoxModel<String> LinuxFormatComboModel = new DefaultComboBoxModel<>();
SpinnerNumberModel imageWidthSpinner =
Expand Down