[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jedit-cvs
Subject:    [ jEdit-commits ] SF.net SVN: jedit:[21612] jEdit/trunk
From:       k_satoda () users ! sourceforge ! net
Date:       2012-04-28 16:49:03
Message-ID: E1SOApT-0006TV-Ei () sfp-svn-4 ! v30 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Revision: 21612
          http://jedit.svn.sourceforge.net/jedit/?rev=21612&view=rev
Author:   k_satoda
Date:     2012-04-28 16:49:03 +0000 (Sat, 28 Apr 2012)
Log Message:
-----------
Fixed NPE which was shown in place of a proper error message for empty
keyword elements in mode XML.

Modified Paths:
--------------
    jEdit/trunk/doc/CHANGES.txt
    jEdit/trunk/org/gjt/sp/jedit/syntax/XModeHandler.java

Modified: jEdit/trunk/doc/CHANGES.txt
===================================================================
--- jEdit/trunk/doc/CHANGES.txt	2012-04-28 16:41:52 UTC (rev 21611)
+++ jEdit/trunk/doc/CHANGES.txt	2012-04-28 16:49:03 UTC (rev 21612)
@@ -12,6 +12,9 @@
 
 {{{ Bug fixes
 
+- Fixed NPE which was shown in place of a proper error message for empty
+  keyword elements in mode XML. (Kazutoshi Satoda)
+
 - Fixed NPE when opening View option pane for the first time on a fresh
   installation (#3520577 Matthieu Casanova)
 

Modified: jEdit/trunk/org/gjt/sp/jedit/syntax/XModeHandler.java
===================================================================
--- jEdit/trunk/org/gjt/sp/jedit/syntax/XModeHandler.java	2012-04-28 16:41:52 UTC \
                (rev 21611)
+++ jEdit/trunk/org/gjt/sp/jedit/syntax/XModeHandler.java	2012-04-28 16:49:03 UTC \
(rev 21612) @@ -372,7 +372,17 @@
 			{
 				byte token = Token.stringToToken(tag.tagName);
 				if(token != -1)
-					addKeyword(tag.lastKeyword.toString(),token);
+				{
+					if (tag.lastKeyword == null
+						|| tag.lastKeyword.length() == 0)
+					{
+						error("empty-keyword", null);
+					}
+					else
+					{
+						addKeyword(tag.lastKeyword.toString(),token);
+					}
+				}
 			} //}}}
 		}
 		else
@@ -474,12 +484,6 @@
 	//{{{ addKeyword() method
 	private void addKeyword(String k, byte id)
 	{
-		if(k == null)
-		{
-			error("empty-keyword",null);
-			return;
-		}
-
 		if (keywords == null) return;
 		keywords.add(k,id);
 	} //}}}

This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
jEdit-CVS mailing list
jEdit-CVS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jedit-cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic