Permalink
Browse files

ignore empty strings for number (just set to 0) - and added intellij …

…iml file
  • Loading branch information...
1 parent 27eb68e commit 5254b85788c56d8d654202e273f322a3c2fa6f04 @hofmeister committed Feb 8, 2013
Showing with 26 additions and 1 deletion.
  1. +20 −0 babelshark.iml
  2. +6 −1 src/main/java/com/vonhof/babelshark/ConvertUtils.java
View
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
+ <excludeFolder url="file://$MODULE_DIR$/target" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" scope="TEST" name="Maven: junit:junit:3.8.1" level="project" />
+ <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-core-asl:1.9.5" level="project" />
+ <orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-mapper-asl:1.9.5" level="project" />
+ <orderEntry type="library" name="Maven: com.thoughtworks.paranamer:paranamer:2.4.1" level="project" />
+ </component>
+</module>
+
@@ -25,8 +25,13 @@
return (T) str;
if (boolean.class.equals(type) || Boolean.class.equals(type))
return (T) Boolean.valueOf(str);
- if (int.class.equals(type) || Integer.class.equals(type))
+
+ if (int.class.equals(type) || Integer.class.equals(type)) {
+ if (str.isEmpty())
+ str = "0";
return (T) Integer.valueOf(str);
+ }
+
if (float.class.equals(type) || Float.class.equals(type))
return (T) Float.valueOf(str);
if (double.class.equals(type) || Double.class.equals(type))

0 comments on commit 5254b85

Please sign in to comment.