Skip to content

The Unified and Autonomous Development Platform

midwork

robin shine58fcbdc7304a
diff --git a/commons.antlr/src/main/java/com/pmease/commons/antlr/codeassist/SurroundingAware.java b/commons.antlr/src/main/java/com/pmease/commons/antlr/codeassist/SurroundingAware.java
index 5ff06e9823..ada2002cd2 100644
--- a/commons.antlr/src/main/java/com/pmease/commons/antlr/codeassist/SurroundingAware.java
+++ b/commons.antlr/src/main/java/com/pmease/commons/antlr/codeassist/SurroundingAware.java
@@ -36,10 +36,11 @@ public abstract class SurroundingAware {
}
public List<InputSuggestion> suggest(ElementSpec spec, String matchWith) {
+ if (matchWith.endsWith(suffix))
+ return new ArrayList<>();
+
if (matchWith.startsWith(prefix))
matchWith = matchWith.substring(prefix.length());
- if (matchWith.endsWith(suffix))
- matchWith = matchWith.substring(0, matchWith.length()-suffix.length());
matchWith = matchWith.trim();
List<InputSuggestion> suggestions = match(matchWith);
diff --git a/commons.antlr/src/test/java/com/pmease/commons/antlr/codeassist/test/CodeAssistTest2.java b/commons.antlr/src/test/java/com/pmease/commons/antlr/codeassist/test/CodeAssistTest2.java
index 55df23dcd9..71596c7e9a 100644
--- a/commons.antlr/src/test/java/com/pmease/commons/antlr/codeassist/test/CodeAssistTest2.java
+++ b/commons.antlr/src/test/java/com/pmease/commons/antlr/codeassist/test/CodeAssistTest2.java
@@ -73,6 +73,21 @@ public class CodeAssistTest2 {
assertEquals("branch(dev):11", suggestions.get(1).toString());
assertEquals("branch(feature1):16", suggestions.get(2).toString());
assertEquals("branch(feature2):16", suggestions.get(3).toString());
+
+ suggestions = suggest(new InputStatus("branch(feature)"), "query");
+ assertEquals(12, suggestions.size());
+ assertEquals("branch(feature)^:16", suggestions.get(0).toString());
+ assertEquals("branch(feature)branch(:22", suggestions.get(1).toString());
+ assertEquals("branch(feature)tag(:19", suggestions.get(2).toString());
+ assertEquals("branch(feature)id(:18", suggestions.get(3).toString());
+ assertEquals("branch(feature)..:17", suggestions.get(4).toString());
+ assertEquals("branch(feature)...:18", suggestions.get(5).toString());
+ assertEquals("branch(feature)before(:22", suggestions.get(6).toString());
+ assertEquals("branch(feature)after(:21", suggestions.get(7).toString());
+ assertEquals("branch(feature)committer(:25", suggestions.get(8).toString());
+ assertEquals("branch(feature)author(:22", suggestions.get(9).toString());
+ assertEquals("branch(feature)path(:20", suggestions.get(10).toString());
+ assertEquals("branch(feature)message(:23", suggestions.get(11).toString());
suggestions = suggest(new InputStatus(""), "revisionCriteria");
assertEquals(4, suggestions.size());
diff --git a/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/AuxiliaryManager.java b/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/AuxiliaryManager.java
index 568b2bd607..f351afd982 100644
--- a/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/AuxiliaryManager.java
+++ b/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/AuxiliaryManager.java
@@ -1,5 +1,6 @@
package com.pmease.gitplex.core.manager;
+import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -10,10 +11,10 @@ public interface AuxiliaryManager {
void check(Repository repository, String refName);
- byte[] getPaths(Repository repository);
+ List<String> getFiles(Repository repository);
- Set<NameAndEmail> getContributors(Repository repository);
+ List<NameAndEmail> getContributors(Repository repository);
- Map<String, Map<NameAndEmail, Long>> getContributors(Repository repository, Set<String> files);
+ Map<String, Map<NameAndEmail, Long>> getContributions(Repository repository, Set<String> files);
}
diff --git a/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/impl/DefaultAuxiliaryManager.java b/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/impl/DefaultAuxiliaryManager.java
index d8f5b7ff6c..65ebb55390 100644
--- a/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/impl/DefaultAuxiliaryManager.java
+++ b/gitplex.core/src/main/java/com/pmease/gitplex/core/manager/impl/DefaultAuxiliaryManager.java
@@ -2,13 +2,17 @@ package com.pmease.gitplex.core.manager.impl;
import java.io.File;
import java.io.Serializable;
+import java.nio.file.Path;
+import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
@@ -17,17 +21,6 @@ import javax.annotation.Nullable;
import javax.inject.Inject;
import javax.inject.Singleton;
-import jetbrains.exodus.ArrayByteIterable;
-import jetbrains.exodus.ByteIterable;
-import jetbrains.exodus.env.Environment;
-import jetbrains.exodus.env.EnvironmentConfig;
-import jetbrains.exodus.env.Environments;
-import jetbrains.exodus.env.Store;
-import jetbrains.exodus.env.StoreConfig;
-import jetbrains.exodus.env.Transaction;
-import jetbrains.exodus.env.TransactionalComputable;
-import jetbrains.exodus.env.TransactionalExecutable;
-
import org.apache.commons.lang3.SerializationUtils;
import org.apache.commons.lang3.StringUtils;
@@ -46,6 +39,17 @@ import com.pmease.gitplex.core.manager.StorageManager;
import com.pmease.gitplex.core.manager.WorkManager;
import com.pmease.gitplex.core.model.Repository;
+import jetbrains.exodus.ArrayByteIterable;
+import jetbrains.exodus.ByteIterable;
+import jetbrains.exodus.env.Environment;
+import jetbrains.exodus.env.EnvironmentConfig;
+import jetbrains.exodus.env.Environments;
+import jetbrains.exodus.env.Store;
+import jetbrains.exodus.env.StoreConfig;
+import jetbrains.exodus.env.Transaction;
+import jetbrains.exodus.env.TransactionalComputable;
+import jetbrains.exodus.env.TransactionalExecutable;
+
@Singleton
public class DefaultAuxiliaryManager implements AuxiliaryManager, RepositoryListener, RefListener, LifecycleListener {
@@ -55,13 +59,13 @@ public class DefaultAuxiliaryManager implements AuxiliaryManager, RepositoryList
private static final String COMMITS_STORE = "commmits";
- private static final String FILES_STORE = "files";
+ private static final String CONTRIBUTIONS_STORE = "contributions";
private static final ByteIterable LAST_COMMIT_KEY = new StringByteIterable("lastCommit");
private static final ByteIterable CONTRIBUTORS_KEY = new StringByteIterable("contributors");
- private static final ByteIterable PATHS_KEY = new StringByteIterable("paths");
+ private static final ByteIterable FILES_KEY = new StringByteIterable("files");
private final StorageManager storageManager;
@@ -71,6 +75,10 @@ public class DefaultAuxiliaryManager implements AuxiliaryManager, RepositoryList
private final Map<Long, Environment> envs = new HashMap<>();
+ private final Map<Long, List<String>> files = new ConcurrentHashMap<>();
+
+ private final Map<Long, List<NameAndEmail>> contributors = new ConcurrentHashMap<>();
+
@Inject
public DefaultAuxiliaryManager(StorageManager storageManager, WorkManager workManager,
SequentialWorkManager sequentialWorkManager) {
@@ -97,7 +105,7 @@ public class DefaultAuxiliaryManager implements AuxiliaryManager, RepositoryList
Environment env = getEnv(repository);
final Store defaultStore = getStore(env, DEFAULT_STORE);
final Store commitsStore = getStore(env, COMMITS_STORE);
- final Store filesStore = getStore(env, FILES_STORE);
+ final Store contributionsStore = getStore(env, CONTRIBUTIONS_STORE);
final AtomicReference<String> lastCommit = new AtomicReference<>();
env.executeInTransaction(new TransactionalExecutable() {
@@ -133,8 +141,8 @@ public class DefaultAuxiliaryManager implements AuxiliaryManager, RepositoryList
final AtomicReference<Set<NameAndEmail>> contributors = new AtomicReference<>(null);
final AtomicBoolean contributorsChanged = new AtomicBoolean(false);
- final AtomicReference<Set<String>> paths = new AtomicReference<>(null);
- final AtomicBoolean pathsChanged = new AtomicBoolean(false);
+ final AtomicReference<Set<String>> files = new AtomicReference<>(null);
+ final AtomicBoolean filesChanged = new AtomicBoolean(false);
log.revisions(revisions).listChangedFiles(true).run(new CommitConsumer() {
@@ -169,46 +177,46 @@ public class DefaultAuxiliaryManager implements AuxiliaryManager, RepositoryList
}
}
- if (paths.get() == null) {
- byte[] bytes = getBytes(defaultStore.get(txn, PATHS_KEY));
+ if (files.get() == null) {
+ byte[] bytes = getBytes(defaultStore.get(txn, FILES_KEY));
if (bytes != null)
- paths.set((Set<String>) SerializationUtils.deserialize(bytes));
+ files.set((Set<String>) SerializationUtils.deserialize(bytes));
else
- paths.set(new HashSet<String>());
+ files.set(new HashSet<String>());
}
for (String file: commit.getChangedFiles()) {
ByteIterable fileKey = new StringByteIterable(file);
- byte[] bytes = getBytes(filesStore.get(txn, fileKey));
- Map<NameAndEmail, Long> contributors;
+ byte[] bytes = getBytes(contributionsStore.get(txn, fileKey));
+ Map<NameAndEmail, Long> fileContributions;
if (bytes != null)
- contributors = (Map<NameAndEmail, Long>) SerializationUtils.deserialize(bytes);
+ fileContributions = (Map<NameAndEmail, Long>) SerializationUtils.deserialize(bytes);
else
- contributors = new HashMap<>();
+ fileContributions = new HashMap<>();
if (StringUtils.isNotBlank(commit.getAuthor().getName())
|| StringUtils.isNotBlank(commit.getAuthor().getEmailAddress())) {
NameAndEmail contributor = new NameAndEmail(commit.getAuthor());
- long authorTime = commit.getAuthor().getWhen().getTime();
- Long when = contributors.get(contributor);
- if (when == null || when.longValue() < authorTime)
- contributors.put(contributor, authorTime);
+ long contributionTime = commit.getAuthor().getWhen().getTime();
+ Long lastContributionTime = fileContributions.get(contributor);
+ if (lastContributionTime == null || lastContributionTime.longValue() < contributionTime)
+ fileContributions.put(contributor, contributionTime);
}
if (StringUtils.isNotBlank(commit.getCommitter().getName())
|| StringUtils.isNotBlank(commit.getCommitter().getEmailAddress())) {
NameAndEmail contributor = new NameAndEmail(commit.getCommitter());
- long committerTime = commit.getCommitter().getWhen().getTime();
- Long when = contributors.get(contributor);
- if (when == null || when.longValue() < committerTime)
- contributors.put(contributor, committerTime);
+ long contributionTime = commit.getCommitter().getWhen().getTime();
+ Long lastContributionTime = fileContributions.get(contributor);
+ if (lastContributionTime == null || lastContributionTime.longValue() < contributionTime)
+ fileContributions.put(contributor, contributionTime);
}
- bytes = SerializationUtils.serialize((Serializable) contributors);
- filesStore.put(txn, fileKey, new ArrayByteIterable(bytes));
+ bytes = SerializationUtils.serialize((Serializable) fileContributions);
+ contributionsStore.put(txn, fileKey, new ArrayByteIterable(bytes));
- if (!paths.get().contains(file)) {
- paths.get().add(file);
- pathsChanged.set(true);
+ if (!files.get().contains(file)) {
+ files.get().add(file);
+ filesChanged.set(true);
}
}
@@ -223,9 +231,10 @@ public class DefaultAuxiliaryManager implements AuxiliaryManager, RepositoryList
bytes = SerializationUtils.serialize((Serializable) contributors.get());
defaultStore.put(txn, CONTRIBUTORS_KEY, new ArrayByteIterable(bytes));
}
- if (pathsChanged.get()) {
- bytes = SerializationUtils.serialize((Serializable) paths.get());
- defaultStore.put(txn, PATHS_KEY, new ArrayByteIterable(bytes));
+ if (filesChanged.get()) {
+ bytes = SerializationUtils.serialize((Serializable) files.get());
+ defaultStore.put(txn, FILES_KEY, new ArrayByteIterable(bytes));
+ DefaultAuxiliaryManager.this.files.remove(repository.getId());
}
if (lastCommit.get() != null) {
bytes = lastCommit.get().getBytes();
@@ -248,7 +257,7 @@ public class DefaultAuxiliaryManager implements AuxiliaryManager, RepositoryList
if (env == null) {
EnvironmentConfig config = new EnvironmentConfig();
config.setLogCacheShared(false);
- config.setMemoryUsage(1024*1024*10);
+ config.setMemoryUsage(1024*1024*64);
env = Environments.newInstance(getAuxiliaryDir(repository), config);
envs.put(repository.getId(), env);
}
@@ -272,61 +281,87 @@ public class DefaultAuxiliaryManager implements AuxiliaryManager, RepositoryList
}
@Override
- public Set<NameAndEmail> getContributors(Repository repository) {
- Environment env = getEnv(repository);
- final Store defaultStore = getStore(env, DEFAULT_STORE);
+ public List<NameAndEmail> getContributors(Repository repository) {
+ List<NameAndEmail> repoContributors = contributors.get(repository.getId());
+ if (repoContributors == null) {
+ Environment env = getEnv(repository);
+ final Store store = getStore(env, DEFAULT_STORE);
- return env.computeInReadonlyTransaction(new TransactionalComputable<Set<NameAndEmail>>() {
+ repoContributors = env.computeInReadonlyTransaction(new TransactionalComputable<List<NameAndEmail>>() {
- @SuppressWarnings("unchecked")
- @Override
- public Set<NameAndEmail> compute(Transaction txn) {
- byte[] value = getBytes(defaultStore.get(txn, CONTRIBUTORS_KEY));
- if (value != null)
- return (Set<NameAndEmail>) SerializationUtils.deserialize(value);
- else
- return new HashSet<>();
- }
- });
+ @SuppressWarnings("unchecked")
+ @Override
+ public List<NameAndEmail> compute(Transaction txn) {
+ byte[] bytes = getBytes(store.get(txn, CONTRIBUTORS_KEY));
+ if (bytes != null) {
+ List<NameAndEmail> repoContributors =
+ new ArrayList<>((Set<NameAndEmail>) SerializationUtils.deserialize(bytes));
+ Collections.sort(repoContributors);
+ return repoContributors;
+ } else {
+ return new ArrayList<>();
+ }
+ }
+ });
+ contributors.put(repository.getId(), repoContributors);
+ }
+ return repoContributors;
}
@Override
- public byte[] getPaths(Repository repository) {
- Environment env = getEnv(repository);
- final Store defaultStore = getStore(env, DEFAULT_STORE);
+ public List<String> getFiles(Repository repository) {
+ List<String> repoFiles = files.get(repository.getId());
+ if (repoFiles == null) {
+ Environment env = getEnv(repository);
+ final Store store = getStore(env, DEFAULT_STORE);
- return env.computeInReadonlyTransaction(new TransactionalComputable<byte[]>() {
+ repoFiles = env.computeInReadonlyTransaction(new TransactionalComputable<List<String>>() {
- @SuppressWarnings("unchecked")
- @Override
- public byte[] compute(Transaction txn) {
- return getBytes(defaultStore.get(txn, PATHS_KEY));
- }
- });
+ @SuppressWarnings("unchecked")
+ @Override
+ public List<String> compute(Transaction txn) {
+ byte[] bytes = getBytes(store.get(txn, FILES_KEY));
+ if (bytes != null) {
+ List<Path> paths = new ArrayList<>();
+ for (String file: (Set<String>)SerializationUtils.deserialize(bytes))
+ paths.add(Paths.get(file));
+ Collections.sort(paths);
+ List<String> files = new ArrayList<>();
+ for (Path path: paths)
+ files.add(path.toString().replace('\\', '/'));
+ return files;
+ } else {
+ return new ArrayList<>();
+ }
+ }
+ });
+ files.put(repository.getId(), repoFiles);
+ }
+ return repoFiles;
}
@Override
- public Map<String, Map<NameAndEmail, Long>> getContributors(Repository repository, final Set<String> files) {
+ public Map<String, Map<NameAndEmail, Long>> getContributions(Repository repository, final Set<String> files) {
Environment env = getEnv(repository);
- final Store filesStore = getStore(env, FILES_STORE);
+ final Store store = getStore(env, CONTRIBUTIONS_STORE);
return env.computeInReadonlyTransaction(new TransactionalComputable<Map<String, Map<NameAndEmail, Long>>>() {
@SuppressWarnings("unchecked")
@Override
public Map<String, Map<NameAndEmail, Long>> compute(Transaction txn) {
- Map<String, Map<NameAndEmail, Long>> file2authors = new HashMap<>();
+ Map<String, Map<NameAndEmail, Long>> fileContributors = new HashMap<>();
for (String file: files) {
ByteIterable fileKey = new StringByteIterable(file);
- Map<NameAndEmail, Long> authors;
- byte[] value = getBytes(filesStore.get(txn, fileKey));
+ Map<NameAndEmail, Long> contributions;
+ byte[] value = getBytes(store.get(txn, fileKey));
if (value != null)
- authors = (Map<NameAndEmail, Long>) SerializationUtils.deserialize(value);
+ contributions = (Map<NameAndEmail, Long>) SerializationUtils.deserialize(value);
else
- authors = new HashMap<>();
- file2authors.put(file, authors);
+ contributions = new HashMap<>();
+ fileContributors.put(file, contributions);
}
- return file2authors;
+ return fileContributors;
}
});
}
@@ -341,6 +376,7 @@ public class DefaultAuxiliaryManager implements AuxiliaryManager, RepositoryList
Environment env = envs.remove(repository.getId());
if (env != null)
env.close();
+ files.remove(repository.getId());
FileUtils.deleteDir(getAuxiliaryDir(repository));
}
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/commit/QueryAssistBehavior.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/commit/QueryAssistBehavior.java
index 7df02508be..96211b347e 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/commit/QueryAssistBehavior.java
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/repository/commit/QueryAssistBehavior.java
@@ -1,8 +1,11 @@
package com.pmease.gitplex.web.page.repository.commit;
import java.util.ArrayList;
-import java.util.Collections;
+import java.util.LinkedHashSet;
import java.util.List;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import org.apache.wicket.Component;
import org.apache.wicket.model.IModel;
@@ -51,28 +54,26 @@ public class QueryAssistBehavior extends ANTLRAssistBehavior {
@Override
protected List<InputSuggestion> match(String matchWith) {
- matchWith = matchWith.toLowerCase();
+ String lowerCaseMatchWith = matchWith.toLowerCase();
int count = 0;
List<InputSuggestion> suggestions = new ArrayList<>();
int tokenType = element.getRoot().getLastMatchedToken().getType();
if (tokenType == CommitQueryParser.BRANCH) {
for (String value: repoModel.getObject().getBranches()) {
- if (value.toLowerCase().contains(matchWith) && count++<MAX_SUGGESTIONS)
+ if (value.toLowerCase().contains(lowerCaseMatchWith) && count++<MAX_SUGGESTIONS)
suggestions.add(new InputSuggestion(value));
}
} else if (tokenType == CommitQueryParser.TAG) {
for (String value: repoModel.getObject().getTags()) {
- if (value.toLowerCase().contains(matchWith) && count++<MAX_SUGGESTIONS)
+ if (value.toLowerCase().contains(lowerCaseMatchWith) && count++<MAX_SUGGESTIONS)
suggestions.add(new InputSuggestion(value));
}
} else if (tokenType == CommitQueryParser.AUTHOR
|| tokenType == CommitQueryParser.COMMITTER) {
AuxiliaryManager auxiliaryManager = GitPlex.getInstance(AuxiliaryManager.class);
- List<NameAndEmail> contributors = new ArrayList<>(auxiliaryManager
- .getContributors(repoModel.getObject()));
- Collections.sort(contributors);
+ List<NameAndEmail> contributors = auxiliaryManager.getContributors(repoModel.getObject());
for (NameAndEmail contributor: contributors) {
- if ((contributor.getName().toLowerCase().contains(matchWith) || contributor.getEmailAddress().toLowerCase().contains(matchWith))
+ if ((contributor.getName().toLowerCase().contains(lowerCaseMatchWith) || contributor.getEmailAddress().toLowerCase().contains(lowerCaseMatchWith))
&& count++<MAX_SUGGESTIONS) {
String content;
if (StringUtils.isNotBlank(contributor.getEmailAddress()))
@@ -89,7 +90,33 @@ public class QueryAssistBehavior extends ANTLRAssistBehavior {
for (String dateExample: DATE_EXAMPLES)
suggestions.add(new InputSuggestion(dateExample));
} else if (tokenType == CommitQueryParser.PATH) {
+ Set<String> suggestedInputs = new LinkedHashSet<>();
+ AuxiliaryManager auxiliaryManager = GitPlex.getInstance(AuxiliaryManager.class);
+ lowerCaseMatchWith = StringUtils.replace(lowerCaseMatchWith, "(", "\\(");
+ lowerCaseMatchWith = StringUtils.replace(lowerCaseMatchWith, ")", "\\)");
+ lowerCaseMatchWith = StringUtils.replace(lowerCaseMatchWith, "?", ".");
+ lowerCaseMatchWith = "^" + StringUtils.replace(lowerCaseMatchWith, "*", ".*");
+ Pattern pattern = Pattern.compile(lowerCaseMatchWith);
+ for (String path: auxiliaryManager.getFiles(repoModel.getObject())) {
+ Matcher matcher = pattern.matcher(path.toLowerCase());
+ if (matcher.find()) {
+ String suffix = path.substring(matcher.end());
+ int index = suffix.indexOf('/');
+ String suggestedInput;
+ if (index != -1)
+ suggestedInput = matchWith + suffix.substring(0, index) + "/";
+ else
+ suggestedInput = matchWith + suffix;
+ if (!suggestedInputs.contains(suggestedInput)) {
+ suggestedInputs.add(suggestedInput);
+ if (suggestedInputs.size() == MAX_SUGGESTIONS)
+ break;
+ }
+ }
+ }
+ for (String suggestedInput: suggestedInputs)
+ suggestions.add(new InputSuggestion(suggestedInput));
}
return suggestions;
}
diff --git a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/test/TestPage.java b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/test/TestPage.java
index fb03907d60..3c1213bb4c 100644
--- a/gitplex.web/src/main/java/com/pmease/gitplex/web/page/test/TestPage.java
+++ b/gitplex.web/src/main/java/com/pmease/gitplex/web/page/test/TestPage.java
@@ -1,10 +1,10 @@
package com.pmease.gitplex.web.page.test;
-import java.util.Set;
+import java.util.List;
+import java.util.regex.Pattern;
import org.apache.wicket.markup.html.link.Link;
-import com.pmease.commons.git.NameAndEmail;
import com.pmease.commons.hibernate.dao.Dao;
import com.pmease.gitplex.core.GitPlex;
import com.pmease.gitplex.core.manager.AuxiliaryManager;
@@ -35,8 +35,11 @@ public class TestPage extends BasePage {
Repository repository = GitPlex.getInstance(Dao.class).load(Repository.class, 1L);
long time = System.currentTimeMillis();
- byte[] paths = GitPlex.getInstance(AuxiliaryManager.class).getPaths(repository);
- System.out.println("paths: " + paths.length);
+ List<String> paths = GitPlex.getInstance(AuxiliaryManager.class).getFiles(repository);
+ Pattern pattern = Pattern.compile("hello.*world/linux.");
+ for (String path: paths) {
+ pattern.matcher(path).find();
+ }
System.out.println("cost time: " + (System.currentTimeMillis()-time));
}