Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -387,11 +387,11 @@ class ResourceProxyVisitor implements IResourceProxyVisitor {
// The character "." must be escaped in regex
String input = getInput();
// replace "." with "\\."
input = input.replaceAll("\\.", "\\\\."); //$NON-NLS-1$ //$NON-NLS-2$
input = input.replace(".", "\\."); //$NON-NLS-1$ //$NON-NLS-2$
// replace "*" with ".*"
input = input.replaceAll("\\*", "\\.\\*"); //$NON-NLS-1$ //$NON-NLS-2$
input = input.replace("*", ".*"); //$NON-NLS-1$ //$NON-NLS-2$
// replace "?" with ".?"
input = input.replaceAll("\\?", "\\.\\?"); //$NON-NLS-1$ //$NON-NLS-2$
input = input.replace("?", ".?"); //$NON-NLS-1$ //$NON-NLS-2$
pattern = Pattern.compile(input);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ public boolean test(Object receiver, String method, Object[] args, Object expect
if (PROPERTY_MATCHES_PATTERN.equals(method)) {
String fileName = resource.getName();
String expected = (String) expectedValue;
expected = expected.replaceAll("\\.", "\\\\."); //$NON-NLS-1$//$NON-NLS-2$
expected = expected.replaceAll("\\*", "\\.\\*"); //$NON-NLS-1$//$NON-NLS-2$
expected = expected.replace(".", "\\."); //$NON-NLS-1$//$NON-NLS-2$
expected = expected.replace("*", ".*"); //$NON-NLS-1$//$NON-NLS-2$
Pattern pattern = Pattern.compile(expected);
boolean retVal = pattern.matcher(fileName).find();
return retVal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public String resolveValue(IDynamicVariable variable, String argument) throws Co
// the filename so they don't conflict with these
// special quotes.
//
osPath = osPath.replaceAll("\"", "\\\\\""); //$NON-NLS-1$ //$NON-NLS-2$
osPath = osPath.replace("\"", "\\\""); //$NON-NLS-1$ //$NON-NLS-2$
fileList.append("\"" + osPath + "\""); //$NON-NLS-1$ //$NON-NLS-2$
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ public void testSortOrderPaths() {
List<String> pathsTrimmed = paths.stream().map(s -> s //
.replaceAll("/$", "") // remove trailing slashes
.replaceAll("/[^/]+/\\.\\./", "/") // collapse /a/../ to /
.replaceAll("/\\./", "/") // collapse /./ to /
.replace("/./", "/") // collapse /./ to /
).toList();
paths = new ArrayList<>(paths); // to get a mutable copy for shuffling
Collections.shuffle(paths);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public String getUrl() {
}

public URI getUri() {
return URI.create(url.replaceAll("\"", "")); //$NON-NLS-1$//$NON-NLS-2$
return URI.create(url.replace("\"", "")); //$NON-NLS-1$//$NON-NLS-2$
}

public void setUrl(String url) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ public void updateMessage() {
} else {
//remove mnemonic see bug 75886
String title = currentPage.getTitle();
title = title.replaceAll("&", "");//$NON-NLS-1$ //$NON-NLS-2$
title = title.replace("&", "");//$NON-NLS-1$ //$NON-NLS-2$
setMessage(title);
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ protected String state2msg(CTabItem item, TerminalState state) {
// Get he current terminal state as string
String stateStr = state.toString();
// Lookup a matching text representation of the state
String key = "TabFolderManager_state_" + stateStr.replaceAll("\\.", " ").trim().toLowerCase(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
String key = "TabFolderManager_state_" + stateStr.replace('.', ' ').trim().toLowerCase(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
String stateMsg = null;
if (properties != null) {
stateMsg = properties.get(key) instanceof String ? (String) properties.get(key) : null;
Expand Down
2 changes: 1 addition & 1 deletion ua/org.eclipse.help.ui/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %help_system_plugin_name
Bundle-SymbolicName: org.eclipse.help.ui; singleton:=true
Bundle-Version: 4.8.200.qualifier
Bundle-Version: 4.8.300.qualifier
Bundle-Activator: org.eclipse.help.ui.internal.HelpUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ private Control createInfoArea(Composite parent) {
}
if (styledText == null && context.getText() != null) {
styledText = context.getText();
styledText= styledText.replaceAll("<b>","<@#\\$b>"); //$NON-NLS-1$ //$NON-NLS-2$
styledText= styledText.replaceAll("</b>", "</@#\\$b>"); //$NON-NLS-1$ //$NON-NLS-2$
styledText= styledText.replace("<b>","<@#$b>"); //$NON-NLS-1$ //$NON-NLS-2$
styledText= styledText.replace("</b>", "</@#$b>"); //$NON-NLS-1$ //$NON-NLS-2$
}
if (styledText == null) { // no description found in context objects.
styledText = Messages.ContextHelpPart_noDescription;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ private void initializeStatusBar(Browser browser) {

// Text
browser.addStatusTextListener(event -> {
event.text = event.text.replaceAll("&", "&&"); //$NON-NLS-1$ //$NON-NLS-2$
event.text = event.text.replace("&", "&&"); //$NON-NLS-1$ //$NON-NLS-2$
if (!event.text.equals(statusText)) {
statusText = event.text;
statusBarText.setText(statusText);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static String escapeSpecialCharsLeavinggBold(String value) {
}

public static String escapeAmpersand(String value) {
return value.replaceAll("&", "&amp;"); //$NON-NLS-1$ //$NON-NLS-2$
return value.replace("&", "&amp;"); //$NON-NLS-1$ //$NON-NLS-2$
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -702,8 +702,8 @@ private String decodeContextBoldTags(IContext context) {
if (styledText == null) {
return Messages.ContextHelpPart_noDescription;
}
String decodedString = styledText.replaceAll("<@#\\$b>", "<b>"); //$NON-NLS-1$ //$NON-NLS-2$
decodedString = decodedString.replaceAll("</@#\\$b>", "</b>"); //$NON-NLS-1$ //$NON-NLS-2$
String decodedString = styledText.replace("<@#$b>", "<b>"); //$NON-NLS-1$ //$NON-NLS-2$
decodedString = decodedString.replace("</@#$b>", "</b>"); //$NON-NLS-1$ //$NON-NLS-2$
decodedString = EscapeUtils.escapeSpecialCharsLeavinggBold(decodedString);
decodedString = decodedString.replaceAll("\r\n|\n|\r", "<br/>"); //$NON-NLS-1$ //$NON-NLS-2$
return decodedString;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ private URLConnection openConnection(String url,
String jar = url.substring(0, excl);
String path = url.length() > excl + 2 ? url.substring(excl + 2)
: ""; //$NON-NLS-1$
url = jar.replaceAll("!", "%21") + "!/" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ path.replaceAll("!", "%21"); //$NON-NLS-1$ //$NON-NLS-2$
url = jar.replace("!", "%21") + "!/" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ path.replace("!", "%21"); //$NON-NLS-1$ //$NON-NLS-2$
}
helpURL = new URL(url);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static String readString(InputStream in) throws IOException {
String result = new String(out.toByteArray(), StandardCharsets.UTF_8);
if (result.length() > 0) {
// filter windows-specific newline
result = result.replaceAll("\r", "");
result = result.replace("\r", "");
}
// ignore whitespace at start or end
return result.trim();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static String removeEnvironmentSpecificContent(String xhtml) {
* becomes:
* <myElement myAttribute="myValue"/>
*/
xhtml = xhtml.replaceAll(" />", "/>");
xhtml = xhtml.replace(" />", "/>");

/*
* The base tag is added before showing in browser. It contains an
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public static Map<String, String> getXHTMLFiles(IntroModelRoot model) {
});
xhtml = XHTMLUtil.removeEnvironmentSpecificContent(xhtml);
// filter windows-specific newline
xhtml = xhtml.replaceAll("\r", "");
xhtml = xhtml.replace("\r", "");
// ignore all beginning and ending whitespace
xhtml = xhtml.trim();
map.put(page.getInitialBase() + page.getRawContent(), xhtml);
Expand Down
Loading