Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve regex expressions #5282

Merged
merged 3 commits into from Jun 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -13,10 +13,13 @@
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;

@Deprecated
public class HttpsUtil {

@Deprecated
public static final String PROP_DISABLE_SERVER_CERT_VERIFY = "disableServerVerify";

@Deprecated
static void disableServerVerification(URLConnection connection) throws GeneralSecurityException {
if (!(connection instanceof HttpsURLConnection))
return;
Expand Down
Expand Up @@ -18,15 +18,15 @@

public class BndCompletionProcessor implements IContentAssistProcessor {

private static final Pattern PREFIX_PATTERN = Pattern.compile("^(?:.*\\s)*(.*)$");
private static final Pattern PREFIX_PATTERN = Pattern.compile("(\\S+)$");

@Override
public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
try {
String pre = viewer.getDocument()
.get(0, offset);
Matcher matcher = PREFIX_PATTERN.matcher(pre);
if (matcher.matches()) {
if (matcher.find()) {
String prefix = matcher.group(1);
ICompletionProposal[] found = proposals(prefix, offset);
if (found.length == 1) {
Expand Down
Expand Up @@ -59,7 +59,7 @@ public class JarFileSystem extends FileSystem {
private final ConcurrentMap<IFileStore, Reference<JarRootNode>> roots = new ConcurrentHashMap<>();

private static final Pattern JARF_P = Pattern
.compile("jarf:///(?<fileuri>.*)!(?<path>(/[^!]*)+)");
.compile("jarf:///(?<fileuri>.*)!(?<path>/[^!]*)");

static abstract class JarNode extends FileStore {
private final JarFolderNode parent;
Expand Down