Browse Source

Nightly build script now removes the build and dist dirs prior to building to force non-stale builds

Callbacks now use volatile hashtables for specificData and callbackInfo
callSocketClosed() will not fire if the currentSocketState is already thought to be closed
Added some error logging to Logging plugin to counter an error that was reported


git-svn-id: http://svn.dmdirc.com/trunk@1922 00569f92-eb28-0410-84fd-f71c24880f
tags/0.5
Shane Mc Cormack 17 years ago
parent
commit
479e140078

+ 3
- 0
BuildAll.sh View File

@@ -33,6 +33,9 @@ mv ${MYDIR}/src/com/dmdirc/Main.java.tmp ${MYDIR}/src/com/dmdirc/Main.java
33 33
 awk '{gsub(/int RELEASE_DATE = 0/,"int RELEASE_DATE = '`date +%Y%m%d`'");print}' ${MYDIR}/src/com/dmdirc/Main.java > ${MYDIR}/src/com/dmdirc/Main.java.tmp
34 34
 mv ${MYDIR}/src/com/dmdirc/Main.java.tmp ${MYDIR}/src/com/dmdirc/Main.java
35 35
 
36
+# This makes sure we have a clean build with no stale class files, it just takes longer
37
+rm -Rf $MYDIR/build $MYDIR/dist
38
+
36 39
 $ANT -buildfile $MYDIR/build.xml -k
37 40
 if [ -f $MYDIR/dist/DMDirc.jar ]; then
38 41
 	FILENAME=DMDirc`date +_%Y%m%d`_${SVNREV}.jar

+ 12
- 0
src/com/dmdirc/addons/logging/LoggingPlugin.java View File

@@ -301,6 +301,10 @@ public final class LoggingPlugin extends Plugin implements EventPlugin, Preferen
301 301
 				case QUERY_CLOSED:
302 302
 					// ActionManager.processEvent(CoreActionType.QUERY_CLOSED, this);
303 303
 					query = (Query)arguments[0];
304
+					if (query.getServer() != null) {
305
+						Logger.appError(ErrorLevel.MEDIUM, "Query object has no server ("+thisType.toString()+")", new Exception("Query object has no server ("+thisType.toString()+")""));
306
+						break;
307
+					}
304 308
 					parser = query.getServer().getParser();
305 309
 					client = parser.getClientInfo(query.getHost());
306 310
 					if (client == null) {
@@ -337,6 +341,10 @@ public final class LoggingPlugin extends Plugin implements EventPlugin, Preferen
337 341
 				case QUERY_OPENED:
338 342
 					// ActionManager.processEvent(CoreActionType.QUERY_OPENED, this);
339 343
 					query = (Query)arguments[0];
344
+					if (query.getServer() != null) {
345
+						Logger.appError(ErrorLevel.MEDIUM, "Query object has no server ("+thisType.toString()+")", new Exception("Query object has no server ("+thisType.toString()+")""));
346
+						break;
347
+					}
340 348
 					parser = query.getServer().getParser();
341 349
 					client = parser.getClientInfo(query.getHost());
342 350
 					if (client == null) {
@@ -370,6 +378,10 @@ public final class LoggingPlugin extends Plugin implements EventPlugin, Preferen
370 378
 				case QUERY_SELF_ACTION:
371 379
 					// ActionManager.processEvent(CoreActionType.QUERY_MESSAGE, this, message);
372 380
 					query = (Query)arguments[0];
381
+					if (query.getServer() != null) {
382
+						Logger.appError(ErrorLevel.MEDIUM, "Query object has no server ("+thisType.toString()+")", new Exception("Query object has no server ("+thisType.toString()+")""));
383
+						break;
384
+					}
373 385
 					parser = query.getServer().getParser();
374 386
 					String overrideNick = "";
375 387
 					if (thisType == CoreActionType.QUERY_SELF_MESSAGE || thisType == CoreActionType.QUERY_SELF_ACTION) {

+ 12
- 6
src/com/dmdirc/parser/IRCParser.java View File

@@ -661,16 +661,20 @@ public final class IRCParser implements Runnable {
661 661
 			try {
662 662
 				lastLine = in.readLine(); // Blocking :/
663 663
 				if (lastLine == null) {
664
-					currentSocketState = STATE_CLOSED;
665
-					callSocketClosed();
664
+					if (currentSocketState != STATE_CLOSED) { 
665
+						currentSocketState = STATE_CLOSED;
666
+						callSocketClosed();
667
+					}
666 668
 					reset();
667 669
 					break;
668 670
 				} else {
669 671
 					processLine(lastLine);
670 672
 				}
671 673
 			} catch (IOException e) {
672
-				currentSocketState = STATE_CLOSED;
673
-				callSocketClosed();
674
+				if (currentSocketState != STATE_CLOSED) { 
675
+					currentSocketState = STATE_CLOSED;
676
+					callSocketClosed();
677
+				}
674 678
 				reset();
675 679
 				break;
676 680
 			}
@@ -1431,8 +1435,10 @@ public final class IRCParser implements Runnable {
1431 1435
 		} catch (Exception e) {
1432 1436
 			/* Do Nothing */
1433 1437
 		} finally {
1434
-			currentSocketState = STATE_CLOSED;
1435
-			callSocketClosed();
1438
+			if (currentSocketState != STATE_CLOSED) { 
1439
+				currentSocketState = STATE_CLOSED;
1440
+				callSocketClosed();
1441
+			}
1436 1442
 			reset();
1437 1443
 		}
1438 1444
 	}

+ 1
- 1
src/com/dmdirc/parser/callbacks/CallbackObject.java View File

@@ -39,7 +39,7 @@ import com.dmdirc.parser.callbacks.interfaces.ICallbackInterface;
39 39
  */
40 40
 public abstract class CallbackObject {
41 41
 	/** Arraylist for storing callback information related to the callback. */
42
-	protected ArrayList<ICallbackInterface> callbackInfo = new ArrayList<ICallbackInterface>();
42
+	protected volatile ArrayList<ICallbackInterface> callbackInfo = new ArrayList<ICallbackInterface>();
43 43
 	
44 44
 	/** Reference to the IRCParser that owns this callback. */
45 45
 	protected IRCParser myParser;

+ 1
- 1
src/com/dmdirc/parser/callbacks/CallbackObjectSpecific.java View File

@@ -41,7 +41,7 @@ import com.dmdirc.parser.callbacks.interfaces.ICallbackInterface;
41 41
 public abstract class CallbackObjectSpecific extends CallbackObject {
42 42
 	
43 43
 	/** Hashtable for storing specific information for callback. */	
44
-	protected Hashtable<ICallbackInterface, String> specificData = new Hashtable<ICallbackInterface, String>();
44
+	protected volatile Hashtable<ICallbackInterface, String> specificData = new Hashtable<ICallbackInterface, String>();
45 45
 	
46 46
 	/**
47 47
 	 * Create a new instance of the Callback Object.

Loading…
Cancel
Save