Skip to content

Commit

Permalink
Merge pull request #5282 from bjhargrave/code-scanning-alerts
Browse files Browse the repository at this point in the history
Improve regex expressions
  • Loading branch information
bjhargrave committed Jun 14, 2022
2 parents 017248d + 3487b9b commit 6730d70
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
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

0 comments on commit 6730d70

Please sign in to comment.