You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2015/06/29 13:35:21 UTC

[1/3] wicket git commit: FindBugs: Iterate over the entry set for better performance

Repository: wicket
Updated Branches:
  refs/heads/master 256f7ab58 -> 759a8355c


FindBugs: Iterate over the entry set for better performance


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/2f21e12a
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/2f21e12a
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/2f21e12a

Branch: refs/heads/master
Commit: 2f21e12ad9f9a0c195334036d102521289e34827
Parents: 256f7ab
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Mon Jun 29 14:29:22 2015 +0300
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Mon Jun 29 14:29:22 2015 +0300

----------------------------------------------------------------------
 .../apache/wicket/extensions/markup/html/basic/LinkParser.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/2f21e12a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/basic/LinkParser.java
----------------------------------------------------------------------
diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/basic/LinkParser.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/basic/LinkParser.java
index 1b68468..b8cb3fe 100644
--- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/basic/LinkParser.java
+++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/basic/LinkParser.java
@@ -67,9 +67,10 @@ public class LinkParser implements ILinkParser
 		// don't try to parse markup. just plain text. WICKET-4099
 		if (work.indexOf('<') == -1)
 		{
-			for (String pattern : renderStrategies.keySet())
+			for (Map.Entry<String, ILinkRenderStrategy> entry : renderStrategies.entrySet())
 			{
-				ILinkRenderStrategy strategy = renderStrategies.get(pattern);
+				String pattern = entry.getKey();
+				ILinkRenderStrategy strategy = entry.getValue();
 
 				Matcher matcher = Pattern.compile(pattern, Pattern.DOTALL).matcher(work);
 				StringBuffer buffer = new StringBuffer();


[3/3] wicket git commit: FindBugs: 'props' cannot be 'null'. It is either non-null or an exception is thrown, so there is no need to check

Posted by mg...@apache.org.
FindBugs: 'props' cannot be 'null'. It is either non-null or an exception is thrown, so there is no need to check


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/759a8355
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/759a8355
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/759a8355

Branch: refs/heads/master
Commit: 759a8355c9a9490b21406da7ba345e4138e058f6
Parents: 3311b07
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Mon Jun 29 14:30:45 2015 +0300
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Mon Jun 29 14:30:45 2015 +0300

----------------------------------------------------------------------
 .../main/java/org/apache/wicket/velocity/Initializer.java   | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/759a8355/wicket-velocity/src/main/java/org/apache/wicket/velocity/Initializer.java
----------------------------------------------------------------------
diff --git a/wicket-velocity/src/main/java/org/apache/wicket/velocity/Initializer.java b/wicket-velocity/src/main/java/org/apache/wicket/velocity/Initializer.java
index 3a54e65..34dfe54 100644
--- a/wicket-velocity/src/main/java/org/apache/wicket/velocity/Initializer.java
+++ b/wicket-velocity/src/main/java/org/apache/wicket/velocity/Initializer.java
@@ -56,14 +56,7 @@ public class Initializer implements IInitializer
 
 		try
 		{
-			if (null != props)
-			{
-				Velocity.init(props);
-			}
-			else
-			{
-				Velocity.init();
-			}
+			Velocity.init(props);
 			log.info("Initialized Velocity successfully");
 		}
 		catch (Exception e)


[2/3] wicket git commit: FindBugs: Check for non-null 'files' before staring to iterate over it.

Posted by mg...@apache.org.
FindBugs: Check for non-null 'files' before staring to iterate over it.


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/3311b078
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/3311b078
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/3311b078

Branch: refs/heads/master
Commit: 3311b0789ea26be6bddb0277f929c06d2a532051
Parents: 2f21e12
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Mon Jun 29 14:30:01 2015 +0300
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Mon Jun 29 14:30:01 2015 +0300

----------------------------------------------------------------------
 .../wicket/util/resource/ZipResourceStream.java | 49 +++++++++++---------
 1 file changed, 26 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/3311b078/wicket-util/src/main/java/org/apache/wicket/util/resource/ZipResourceStream.java
----------------------------------------------------------------------
diff --git a/wicket-util/src/main/java/org/apache/wicket/util/resource/ZipResourceStream.java b/wicket-util/src/main/java/org/apache/wicket/util/resource/ZipResourceStream.java
index cea2a45..270dd67 100644
--- a/wicket-util/src/main/java/org/apache/wicket/util/resource/ZipResourceStream.java
+++ b/wicket-util/src/main/java/org/apache/wicket/util/resource/ZipResourceStream.java
@@ -132,41 +132,44 @@ public class ZipResourceStream extends AbstractResourceStream
 		BufferedInputStream origin;
 		byte data[] = new byte[BUFFER];
 
-		for (String file : files)
+		if (files != null)
 		{
-			if (log.isDebugEnabled())
+			for (String file : files)
 			{
-				log.debug("Adding: '{}'", file);
-			}
-			File f = new File(dir, file);
-			if (f.isDirectory())
-			{
-				if (recursive)
+				if (log.isDebugEnabled())
 				{
-					zipDir(f, out, path + f.getName() + "/", recursive);
+					log.debug("Adding: '{}'", file);
 				}
-			}
-			else
-			{
-				out.putNextEntry(new ZipEntry(path + f.getName()));
+				File f = new File(dir, file);
+				if (f.isDirectory())
+				{
+					if (recursive)
+					{
+						zipDir(f, out, path + f.getName() + "/", recursive);
+					}
+				} else
+				{
+					out.putNextEntry(new ZipEntry(path + f.getName()));
 
-				FileInputStream fi = new FileInputStream(f);
-				origin = new BufferedInputStream(fi, BUFFER);
+					FileInputStream fi = new FileInputStream(f);
+					origin = new BufferedInputStream(fi, BUFFER);
 
-				try
-				{
-					int count;
-					while ((count = origin.read(data, 0, BUFFER)) != -1)
+					try
+					{
+						int count;
+						while ((count = origin.read(data, 0, BUFFER)) != -1)
+						{
+							out.write(data, 0, count);
+						}
+					} finally
 					{
-						out.write(data, 0, count);
+						origin.close();
 					}
-				} finally {
-					origin.close();
 				}
 			}
 		}
 
-		if (path.equals(""))
+		if ("".equals(path))
 		{
 			out.close();
 		}