no warnings
authorEneko Pinzolas Murua <kelossus@localhost.localdomain>
Sat, 18 Apr 2015 14:09:49 +0000 (16:09 +0200)
committerEneko Pinzolas Murua <kelossus@localhost.localdomain>
Sat, 18 Apr 2015 14:09:49 +0000 (16:09 +0200)
20 files changed:
ruralHouses/src/businessLogic/BookingManager.java
ruralHouses/src/businessLogic/HouseManager.java
ruralHouses/src/businessLogic/LoginManager.java
ruralHouses/src/businessLogic/LoginManagerInterface.java
ruralHouses/src/businessLogic/OfferManager.java
ruralHouses/src/dataAccess/DB4oManager.java
ruralHouses/src/dataAccess/DB4oManagerServer.java
ruralHouses/src/gui/AddOffersGUI.java
ruralHouses/src/gui/DeleteOfferGUI.java
ruralHouses/src/gui/HouseFeaturesGUI.java
ruralHouses/src/gui/LoginGUI.java
ruralHouses/src/gui/ModifyHouseGUI.java
ruralHouses/src/gui/ModifyOfferGUI.java
ruralHouses/src/gui/QueryAvailabilityGUI2.java
ruralHouses/src/gui/RequestDeleteHouseGUI.java
ruralHouses/src/gui/RequestNewHouseGUI.java
ruralHouses/src/gui/StartWindow.java
ruralHouses/src/gui/listOfAdditionRequestsGUI.java
ruralHouses/src/gui/listOfHousesGUI.java
ruralHouses/src/gui/listOfRemovalRequestsGUI.java

index 24dd41c..b9fa7bd 100644 (file)
@@ -48,7 +48,7 @@ public final class BookingManager {
        public static BookingManager getInstance()  {
                ObjectContainer db=DB4oManager.getContainer();
            BookingManager b = new BookingManager();
-           ObjectSet result = db.queryByExample(b);
+           ObjectSet<BookingManager> result = db.queryByExample(b);
            if (!result.hasNext()){
                theBookingManager = new BookingManager();
                db.store(theBookingManager);
index 4601b88..7de62a4 100644 (file)
@@ -4,7 +4,6 @@ import java.rmi.RemoteException;
 import java.util.Vector;
 
 import dataAccess.DB4oManager;
-import domain.HouseFeatures;
 import domain.Owner;
 import domain.RuralHouse;
 
index b0aadd8..8064310 100644 (file)
@@ -5,7 +5,6 @@ import java.util.Vector;
 
 import dataAccess.DB4oManager;
 import domain.Account;
-import domain.Owner;
 
 public class LoginManager implements LoginManagerInterface {
 
index 682b500..f2a1f8d 100644 (file)
@@ -1,7 +1,6 @@
 package businessLogic;
 
 import domain.Account;
-import domain.Owner;
 
 public interface LoginManagerInterface {
        
index 4ac0255..a0cd67e 100644 (file)
@@ -43,7 +43,7 @@ public final class OfferManager {
        public static OfferManager getInstance()  {
                ObjectContainer db=DB4oManager.getContainer();
                OfferManager b = new OfferManager();
-               ObjectSet result = db.queryByExample(b);
+               ObjectSet<OfferManager> result = db.queryByExample(b);
                if (!result.hasNext()){
                        theOfferManager = new OfferManager();
                        db.store(theOfferManager);
index eb80b86..0e6e881 100644 (file)
@@ -4,15 +4,12 @@ import java.io.File;
 //import java.util.Enumeration;
 //import java.util.Vector;
 import java.rmi.RemoteException;
-
-
 import java.util.Date;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.ListIterator;
 import java.util.Vector;
 
-
 import com.db4o.Db4oEmbedded;
 import com.db4o.ObjectContainer;
 import com.db4o.ObjectSet;
@@ -72,8 +69,8 @@ public class DB4oManager {
                } else // c.getDataBaseOpenMode().equals("open")
 
                {
-                       ObjectSet res = db.queryByExample(DB4oManagerAux.class);
-                       ListIterator listIter = res.listIterator();
+                       ObjectSet<DB4oManagerAux> res = db.queryByExample(DB4oManagerAux.class);
+                       ListIterator<DB4oManagerAux> listIter = res.listIterator();
                        if (listIter.hasNext())
                                theDB4oManagerAux = (DB4oManagerAux) res.next();
                }
@@ -155,8 +152,7 @@ public class DB4oManager {
 
                try {
                        Owner proto = new Owner(null, null);
-                       ObjectSet result = db.queryByExample(proto);
-                       Vector<Owner> owners = new Vector<Owner>();
+                       ObjectSet<Owner> result = db.queryByExample(proto);
                        while (result.hasNext()) {
                                Owner o = (Owner) result.next();
                                System.out.println("Deleted owner: " + o.toString());
@@ -223,16 +219,23 @@ public class DB4oManager {
        }
 
        
+       @SuppressWarnings("static-access")
        public LinkedList<RuralHouse>[] getAdminData(){
                if (c.isDatabaseLocal() == false)
                        openSDB();
                else
                        openDB();
+               @SuppressWarnings("unchecked")
                LinkedList<RuralHouse>[] ret =  new LinkedList[2];
                
                try {
                        
                        List<Administrator> admL = db.query(new Predicate<Administrator>(){
+                               /**
+                                * 
+                                */
+                               private static final long serialVersionUID = 1L;
+
                                public boolean match(Administrator admin){
                                        return true;
                                }
@@ -249,6 +252,7 @@ public class DB4oManager {
                
        }
        
+       @SuppressWarnings("static-access")
        public void storeAdmin() {
                if (c.isDatabaseLocal() == false)
                        openSDB();
@@ -257,6 +261,11 @@ public class DB4oManager {
                try {
                        
                        List<Administrator> admL = db.query(new Predicate<Administrator>(){
+                               /**
+                                * 
+                                */
+                               private static final long serialVersionUID = 1L;
+
                                public boolean match(Administrator admin){
                                        return true;
                                }
@@ -304,7 +313,7 @@ public class DB4oManager {
 
                        RuralHouse proto = new RuralHouse(ruralHouse.getHouseName(), null,
                                        ruralHouse.getDescription(), ruralHouse.getDistrict(), null);
-                       ObjectSet result = db.queryByExample(proto);
+                       ObjectSet<RuralHouse> result = db.queryByExample(proto);
                        RuralHouse rh = (RuralHouse) result.next();
 
                        Offer offer;
@@ -364,7 +373,7 @@ public class DB4oManager {
 
                try {
                        RuralHouse proto = new RuralHouse(null, null, null, null, null);
-                       ObjectSet result = db.queryByExample(proto);
+                       ObjectSet<RuralHouse> result = db.queryByExample(proto);
                        Vector<RuralHouse> ruralHouses = new Vector<RuralHouse>();
                        while (result.hasNext())
                                ruralHouses.add((RuralHouse) result.next());
index b329e95..106cfff 100644 (file)
@@ -21,6 +21,10 @@ import domain.Owner;
 
 public class DB4oManagerServer extends JDialog {
 
+       /**
+        * 
+        */
+       private static final long serialVersionUID = 1L;
        private final JPanel contentPanel = new JPanel();
        JTextArea textArea;
        ObjectServer server;
index 12d501b..8d34025 100644 (file)
@@ -24,7 +24,6 @@ import businessLogic.OfferManager;
 
 import com.toedter.calendar.JCalendar;
 
-import domain.Offer;
 import domain.RuralHouse;
 import exceptions.BadDates;
 import exceptions.OverlappingOfferExists;
@@ -35,7 +34,7 @@ public class AddOffersGUI extends JFrame  {
 private static final long serialVersionUID = 1L;
 
        
-  private JComboBox jComboBox1;
+  private JComboBox<RuralHouse> jComboBox1;
   private JLabel jLabel1 = new JLabel();
   private JLabel jLabel2 = new JLabel();
   private JTextField jTextField1 = new JTextField();
@@ -74,7 +73,7 @@ private static final long serialVersionUID = 1L;
     this.setTitle("Set availability");
     
     
-    jComboBox1 = new JComboBox(v);
+    jComboBox1 = new JComboBox<RuralHouse>(v);
     jComboBox1.setBounds(new Rectangle(115, 30, 115, 20));
     jLabel1.setText("List of houses:");
     jLabel1.setBounds(new Rectangle(25, 30, 95, 20));
index bed2cb7..90f538e 100644 (file)
@@ -6,8 +6,6 @@ import java.awt.event.ItemEvent;
 import java.awt.event.ItemListener;
 import java.util.Vector;
 
-import javax.swing.GroupLayout;
-import javax.swing.GroupLayout.Alignment;
 import javax.swing.JButton;
 import javax.swing.JComboBox;
 import javax.swing.JFrame;
@@ -20,8 +18,6 @@ import businessLogic.OfferManager;
 import domain.Offer;
 import domain.Owner;
 import domain.RuralHouse;
-import javax.swing.LayoutStyle.ComponentPlacement;
-import javax.swing.JTextField;
 
 public class DeleteOfferGUI extends JFrame {
 
index e53b148..95ddb3a 100644 (file)
@@ -218,6 +218,11 @@ public class HouseFeaturesGUI extends JFrame {
 
                }
                table.setDefaultRenderer(Object.class, new DefaultTableCellRenderer() {
+                       /**
+                        * 
+                        */
+                       private static final long serialVersionUID = 1L;
+
                        @Override
                        public Component getTableCellRendererComponent(JTable table,
                                        Object value, boolean isSelected, boolean hasFocus,
index db04aff..2689506 100644 (file)
@@ -16,10 +16,6 @@ import javax.swing.SwingConstants;
 import businessLogic.LoginManager;
 import businessLogic.LoginManagerInterface;
 import domain.Account;
-import domain.Owner;
-
-import javax.swing.JRadioButton;
-import javax.swing.ButtonGroup;
 
 public class LoginGUI extends JFrame {
 
@@ -29,7 +25,6 @@ public class LoginGUI extends JFrame {
        private JPasswordField passwordField;
        private LoginManagerInterface loginManager = new LoginManager();
        private JLabel loginFeedback;
-       private final ButtonGroup buttonGroup = new ButtonGroup();
        public LoginGUI() {
                super();
                initialize();
index 51815a5..d902074 100644 (file)
@@ -5,7 +5,6 @@ import java.awt.event.ActionListener;
 import java.awt.event.ItemEvent;
 import java.awt.event.ItemListener;
 
-
 import javax.swing.DefaultComboBoxModel;
 import javax.swing.JButton;
 import javax.swing.JComboBox;
index eb6308f..6f69df6 100644 (file)
@@ -30,7 +30,6 @@ import com.toedter.calendar.JCalendar;
 import domain.Offer;
 import domain.RuralHouse;
 import exceptions.BadDates;
-import exceptions.OverlappingOfferExists;
 
 public class ModifyOfferGUI extends JFrame {
 
index 40cfe1c..18555fc 100644 (file)
@@ -42,7 +42,7 @@ import domain.RuralHouse;
 public class QueryAvailabilityGUI2 extends JFrame {
        private static final long serialVersionUID = 1L;
 
-       private JComboBox jComboBox1;
+       private JComboBox<String> jComboBox1;
        private JLabel jLabel2 = new JLabel();
        private JTextField jTextField1 = new JTextField();
        private JLabel jLabel3 = new JLabel();
@@ -99,7 +99,7 @@ public class QueryAvailabilityGUI2 extends JFrame {
                this.setSize(new Dimension(550, 500));
                this.setTitle("Query Availability");
 
-               jComboBox1 = new JComboBox(new DefaultComboBoxModel(
+               jComboBox1 = new JComboBox<String>(new DefaultComboBoxModel<String>(
                                Districs.longNames()));
                jComboBox1.setEnabled(false);
                jComboBox1.setBounds(new Rectangle(115, 30, 115, 20));
index 7dd1ee6..e9ad2e8 100644 (file)
@@ -5,11 +5,10 @@ import java.awt.event.ActionListener;
 import java.awt.event.ItemEvent;
 import java.awt.event.ItemListener;
 
-import javax.swing.GroupLayout;
-import javax.swing.GroupLayout.Alignment;
 import javax.swing.JButton;
 import javax.swing.JComboBox;
 import javax.swing.JFrame;
+import javax.swing.JLabel;
 import javax.swing.JPanel;
 import javax.swing.JRadioButton;
 import javax.swing.border.EmptyBorder;
@@ -17,11 +16,13 @@ import javax.swing.border.EmptyBorder;
 import businessLogic.AdminManager;
 import domain.Owner;
 import domain.RuralHouse;
-import javax.swing.JLabel;
-import javax.swing.LayoutStyle.ComponentPlacement;
 
 public class RequestDeleteHouseGUI extends JFrame {
 
+       /**
+        * 
+        */
+       private static final long serialVersionUID = 1L;
        private JPanel contentPane;
        private Owner owner;
        private JComboBox<RuralHouse> comboBox;
index 7b7ed0a..ba4eca9 100644 (file)
@@ -4,10 +4,11 @@ import java.awt.Color;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 
+import javax.swing.DefaultComboBoxModel;
 import javax.swing.GroupLayout;
 import javax.swing.GroupLayout.Alignment;
-import javax.swing.DefaultComboBoxModel;
 import javax.swing.JButton;
+import javax.swing.JComboBox;
 import javax.swing.JFrame;
 import javax.swing.JLabel;
 import javax.swing.JPanel;
@@ -22,8 +23,6 @@ import domain.HouseFeatures;
 import domain.Owner;
 import domain.RuralHouse;
 
-import javax.swing.JComboBox;
-
 public class RequestNewHouseGUI extends JFrame {
 
        /**
index 842b818..663369b 100644 (file)
@@ -17,7 +17,6 @@ import javax.swing.SwingConstants;
 import javax.swing.UIManager;
 
 import configuration.ConfigXML;
-import domain.Administrator;
 
 
 public class StartWindow extends JFrame {
@@ -48,30 +47,9 @@ public class StartWindow extends JFrame {
                        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
 
                        c=configuration.ConfigXML.getInstance();
-                       if (c.isBusinessLogicLocal()){
-                               //facadeInterface=new FacadeImplementation();
-                       }
-                       else {
-                               
-                               final String businessLogicNode = c.getBusinessLogicNode();
-                               // Remote service name
-                               String serviceName = "/"+c.getServiceRMI();
-                               // RMI server port number
-                               int portNumber = Integer.parseInt(c.getPortRMI());
-                               // RMI server host IP IP 
-                               /*facadeInterface = (ApplicationFacadeInterface) Naming.lookup("rmi://"
-                                       + businessLogicNode + ":" + portNumber + serviceName);*/
-                       } 
-
-               }/* catch (java.rmi.ConnectException e) {
-                       a.lblNewLabel.setText("No business logic: Run BusinessLogicServer first!!");
-                       a.lblNewLabel.setForeground(Color.RED);
-                       System.out.println("Error in StartWindow: "+e.toString());
-               } catch (java.rmi.NotBoundException e) {
-                       a.lblNewLabel.setText("No business logic: Maybe problems running BusinessLogicServer");
-                       a.lblNewLabel.setForeground(Color.RED);
-                       System.out.println("Error in StartWindow: "+e.toString());
-               } */catch (com.db4o.ext.DatabaseFileLockedException e) {
+
+
+               }catch (com.db4o.ext.DatabaseFileLockedException e) {
                        a.lblNewLabel.setText("Database locked: Do not run BusinessLogicServer or BusinessLogicServer!!");
                        a.lblNewLabel.setForeground(Color.RED);         
                        System.out.println("Error in StartWindow: "+e.toString());
index 2829bc1..8a24d45 100644 (file)
@@ -24,6 +24,10 @@ import domain.RuralHouse;
 
 public class listOfAdditionRequestsGUI extends JFrame {
 
+       /**
+        * 
+        */
+       private static final long serialVersionUID = 1L;
        private JPanel contentPane;
        private JTable table;
        private DefaultTableModel tableModel;
index 171dbbd..c144ccc 100644 (file)
@@ -19,6 +19,10 @@ import domain.RuralHouse;
 
 public class listOfHousesGUI extends JFrame {
 
+       /**
+        * 
+        */
+       private static final long serialVersionUID = 1L;
        private JPanel contentPane;
        private JTable table;
        private DefaultTableModel tableModel;
index 07ee348..53cb7e6 100644 (file)
@@ -24,6 +24,10 @@ import domain.RuralHouse;
 
 public class listOfRemovalRequestsGUI extends JFrame {
 
+       /**
+        * 
+        */
+       private static final long serialVersionUID = 1L;
        private JPanel contentPane;
        private JTable table;
        private DefaultTableModel tableModel;