diff --git a/.classpath b/.classpath index 24bc4d8..3af1ad0 100644 --- a/.classpath +++ b/.classpath @@ -25,7 +25,7 @@ - + diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index 8db228c..a5c7673 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -1,6 +1,6 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.compliance=1.7 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error diff --git a/src/main/java/org/gcube/socialnetworking/socialtoken/SanitizedURL.java b/src/main/java/org/gcube/socialnetworking/socialtoken/SanitizedURL.java index 2b59fd0..8a4bc62 100644 --- a/src/main/java/org/gcube/socialnetworking/socialtoken/SanitizedURL.java +++ b/src/main/java/org/gcube/socialnetworking/socialtoken/SanitizedURL.java @@ -13,11 +13,13 @@ public class SanitizedURL { protected final URL url; public SanitizedURL(String urlString) throws MalformedURLException { - if(Objects.isNull(urlString) || urlString.isEmpty()) { + if(Objects.isNull(urlString) || urlString.isEmpty() || urlString.length()<2) { throw new MalformedURLException(); } - prefix = urlString.substring(0,1);; + + + prefix = urlString.substring(0,1); if(prefix.matches(CHARACTERS_TO_REMOVE)) { prefix = urlString.substring(0, 1); urlString = urlString.substring(1);