• R/O
  • SSH
  • HTTPS

提交

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

無人機動兵器ダンジョン探索ゲーム JAVAベース


Commit MetaInfo

修订版18 (tree)
时间2015-06-09 01:33:00
作者manjihq

Log Message

トラップできていない例外をキャッチするように修正

更改概述

差异

--- CarnageHack2/trunk/src/CarnageHack/OkeSoftPanel.java (revision 17)
+++ CarnageHack2/trunk/src/CarnageHack/OkeSoftPanel.java (revision 18)
@@ -2,6 +2,8 @@
22
33 import java.awt.*;
44 import java.awt.event.*;
5+import java.util.logging.Level;
6+import java.util.logging.Logger;
57
68 /**
79 * ソフトウェアチップテーブル
@@ -279,10 +281,15 @@
279281 newy = y / 40;
280282 OkeSoftChip chip = software.get(newx, newy);
281283 if (chip != null) {
282- OkeSoftChip wkchip = (OkeSoftChip) chip.clone();
283- if (wkchip.edit(newx, newy, software) == true) {
284- software.set(newx, newy, wkchip);
285- repaint();
284+ try {
285+ OkeSoftChip wkchip = (OkeSoftChip) chip.clone();
286+ if (wkchip.edit(newx, newy, software) == true) {
287+ software.set(newx, newy, wkchip);
288+ repaint();
289+ }
290+ } catch (CloneNotSupportedException ex) {
291+ Logger.getLogger(OkeSoftPanel.class.getName()).
292+ log(Level.SEVERE, null, ex);
286293 }
287294 }
288295 }
@@ -338,18 +345,23 @@
338345 newtx = tx / 40;
339346 newty = ty / 40;
340347 if (newsx != newtx || newsy != newty) {
341- OkeSoftChip wkchip
342- = (OkeSoftChip) software.get(newsx, newsy).clone();
343- if (software.check_arrow(newtx, newty, wkchip.get_green_arrow())
344- == false) {
345- wkchip.set_green_arrow(OkeSoftChip.ARROW_NONE);
348+ try {
349+ OkeSoftChip wkchip
350+ = (OkeSoftChip) software.get(newsx, newsy).clone();
351+ if (software.check_arrow(newtx, newty, wkchip.get_green_arrow())
352+ == false) {
353+ wkchip.set_green_arrow(OkeSoftChip.ARROW_NONE);
354+ }
355+ if (software.check_arrow(newtx, newty, wkchip.get_red_arrow())
356+ == false) {
357+ wkchip.set_red_arrow(OkeSoftChip.ARROW_NONE);
358+ }
359+ software.set(newtx, newty, wkchip);
360+ repaint();
361+ } catch (CloneNotSupportedException ex) {
362+ Logger.getLogger(OkeSoftPanel.class.getName()).
363+ log(Level.SEVERE, null, ex);
346364 }
347- if (software.check_arrow(newtx, newty, wkchip.get_red_arrow())
348- == false) {
349- wkchip.set_red_arrow(OkeSoftChip.ARROW_NONE);
350- }
351- software.set(newtx, newty, wkchip);
352- repaint();
353365 }
354366 }
355367