JAL-3210 Barebones gradle/buildship/eclipse. See README
[jalview.git] / src / com / stevesoft / pat / Regex.java
index 455f040..6d07427 100755 (executable)
@@ -16,7 +16,6 @@ import java.util.Hashtable;
 
 import com.stevesoft.pat.wrap.StringWrap;
 
-
 /** Matches a Unicode punctuation character. */
 class UnicodePunct extends UniValidator
 {
@@ -307,7 +306,6 @@ class UnicodeLower extends UniValidator
  */
 public class Regex extends RegRes implements FilenameFilter
 {
-
   /**
    * BackRefOffset gives the identity number of the first pattern. Version 1.0
    * used zero, version 1.1 uses 1 to be more compatible with perl.
@@ -1097,13 +1095,16 @@ public class Regex extends RegRes implements FilenameFilter
   {
     try
     {
-      return getClass().newInstance();
+      return getClass().getDeclaredConstructor().newInstance();
     } catch (InstantiationException ie)
     {
       return null;
     } catch (IllegalAccessException iae)
     {
       return null;
+    } catch (ReflectiveOperationException roe)
+    {
+      return null;
     }
   }