Use common library to read file content.
[javainspect.git] / src / main / java / eu / svjatoslav / inspector / java / methods / Annotation.java
old mode 100644 (file)
new mode 100755 (executable)
index 0f12dd4..d3f282f
@@ -1,3 +1,12 @@
+/*
+ * JavaInspect - Utility to visualize java software
+ * Copyright (C) 2013-2020, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 3 of the GNU Lesser General Public License
+ * or later as published by the Free Software Foundation.
+ */
+
 package eu.svjatoslav.inspector.java.methods;
 
 import eu.svjatoslav.commons.string.tokenizer.InvalidSyntaxException;
@@ -6,32 +15,32 @@ import eu.svjatoslav.commons.string.tokenizer.TokenizerMatch;
 
 public class Annotation {
 
-       private String name;
+    private String name;
 
-       public Annotation(final Tokenizer tokenizer) throws InvalidSyntaxException {
+    public Annotation(final Tokenizer tokenizer) throws InvalidSyntaxException {
 
-               name = tokenizer.getNextToken().token;
+        name = tokenizer.getNextToken().token;
 
-               if (!tokenizer.probeNextToken("("))
-                       return;
+        if (!tokenizer.consumeIfNextToken("("))
+            return;
 
-               int depth = 1;
+        int depth = 1;
 
-               while (true) {
-                       final TokenizerMatch token = tokenizer.getNextToken();
+        while (true) {
+            final TokenizerMatch token = tokenizer.getNextToken();
 
-                       if (token == null)
-                               return;
+            if (token == null)
+                return;
 
-                       if ("(".equals(token.token))
-                               depth++;
-                       if (")".equals(token.token))
-                               depth--;
+            if ("(".equals(token.token))
+                depth++;
+            if (")".equals(token.token))
+                depth--;
 
-                       if (depth == 0)
-                               return;
-               }
+            if (depth == 0)
+                return;
+        }
 
-       }
+    }
 
 }