OSDN Git Service

build : 出力先ディレクトリを'classes'に変更
authorunknown <yuu@c56naf0ltzhfdxe.(none)>
Sun, 18 Dec 2011 09:55:49 +0000 (18:55 +0900)
committerunknown <yuu@c56naf0ltzhfdxe.(none)>
Sun, 18 Dec 2011 09:55:49 +0000 (18:55 +0900)
コンパイル時の警告を修正

build.xml
src/hayashi/yuu/tools/properties/PropertySelectItem.java
src/jp/co/areaweb/tools/gui/Command.java

index 159de2e..b5a7a14 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -1,5 +1,6 @@
 <project name="hayashi" default="all" basedir=".">
     <property name="src" value="${basedir}/src" />
+    <property name="obj" value="${basedir}/classes" />
     <property name="doc" value="${basedir}/doc" />
     <property name="report" value="${basedir}/report" />
     <property file="build.properties" />
     <target name="clean" description="Delete build directory">
                <delete>
                        <fileset dir="${src}" includes="**/*.class" />
+                       <fileset dir="${obj}" includes="**/*.class" />
                </delete>
     </target>
   
        <!-- コンパイル -->
     <target name="compile" depends="prepare" description="Compile Java Sources">
-        <javac srcdir="${src}" destdir="${src}" encoding="UTF-8"
+        <javac srcdir="${src}" destdir="${obj}" encoding="UTF-8"
                target="1.5" optimize="off" debug="on" verbose="false">
             <include name="**/*.java" />
             <classpath refid="compile.classpath"/>
@@ -66,7 +68,7 @@
                <jar destfile="${appname}_${version}.jar">
                        <fileset file="README.txt"/>
                        <fileset dir="test" includes="**/*.class,**/*.java" />
-                       <fileset dir="${src}" includes="**/*.class,**/*.java" />
+                       <fileset dir="${obj}" includes="**/*.class,**/*.java" />
                        <manifest>
                                <attribute name="Implementation-Title"   value="${appname}"/>
                                <attribute name="Implementation-Version" value="hayashi lib ${version}"/>
index 7f2912e..49cad54 100644 (file)
@@ -6,19 +6,20 @@ import javax.swing.JComboBox;
 @SuppressWarnings("serial")
 public class PropertySelectItem extends PropertyItem {
 
+       @SuppressWarnings("unchecked")
        public PropertySelectItem(hayashi.yuu.tools.properties.Properties prop, String name, String title, boolean editable, String[] items) {
                super(prop, name, title, editable);
-               field = new JComboBox();
-               ((JComboBox)field).addActionListener(this);
+               field = new JComboBox<Object>();
+               ((JComboBox<?>)field).addActionListener(this);
                for (int i=0; i < items.length; i++) {
-                       ((JComboBox)field).addItem(items[i]);
+                       ((JComboBox<String>)field).addItem(items[i]);
                }
                createItem(name, title, prop.getProperty(name), editable);
        }
 
        void setupField(String name, String value, boolean editable) {
                this.value = value;
-               ((JComboBox)field).setSelectedItem(value);
+               ((JComboBox<?>)field).setSelectedItem(value);
 
                if (!editable) {
                        field.setEnabled(editable);
@@ -28,7 +29,7 @@ public class PropertySelectItem extends PropertyItem {
        
        @Override
        public void actionPerformed(ActionEvent e) {
-               this.value = (String) ((JComboBox)this.field).getSelectedItem();
+               this.value = (String) ((JComboBox<?>)this.field).getSelectedItem();
                logger.info("[反映] "+ propertyName +" = "+ this.value);
                prop.setProperty(propertyName, this.value);
        }
index b0aac0a..218a10f 100644 (file)
@@ -4,15 +4,13 @@ import java.text.SimpleDateFormat;
 class Command extends Thread {
        String[] args;          // コマンドパラメータ
        private String commandName = "";        // コマンド名
-       @SuppressWarnings("unchecked")
-       private Class cmd;              // 実行対象インスタンス
+       private Class<?> cmd;           // 実行対象インスタンス
        
        /**
         * コンストラクタ:実行対象のインスタンスを得る
         * @param cmd
         */
-       @SuppressWarnings("unchecked")
-       public Command(Class cmd) {
+       public Command(Class<?> cmd) {
                super();
                this.cmd = cmd;
                this.commandName = cmd.getName();
@@ -34,7 +32,6 @@ class Command extends Thread {
                return this.commandName;
        }
 
-       @SuppressWarnings("unchecked")
        public void run() {
                System.out.println("[START:"+ (new SimpleDateFormat("yyyy/MM/dd-HH:mm:ss")).format(new java.util.Date()) +"]\t"+ this.commandName);
                for (int i=0; i < args.length; i++) {