Skip to content
Closed
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 @@ -88,7 +88,7 @@ protected java.net.PasswordAuthentication getPasswordAuthentication() {
dialogTitle = bundle.getString("CTL_PasswordProtected");
passwordPanel.setPrompt(NbBundle.getMessage(AdminAuthenticator.class,
"PROMPT_GLASSFISH_AUTH", getRequestingHost(),
Integer.valueOf(getRequestingPort()).toString()));
Integer.toString(getRequestingPort())));
}
DialogDescriptor dd = new DialogDescriptor(passwordPanel, dialogTitle);
java.awt.Dialog dialog = DialogDisplayer.getDefault().createDialog(dd);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ static String getDup(List<String> targets) {
return null;
}
for (String target : targets) {
int colon = target.indexOf(":");
int colon = target.indexOf(':');
if (-1 == colon) {
colon = target.length();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public void run() {
pushPrefix = k.substring(0,dex);
}
String[] aRow = new String[colCount];
int dex = k.lastIndexOf(".");
int dex = k.lastIndexOf('.');
String partialKey = k.substring(0, dex);
aRow[0] = data.get(k);
for (int i = 2 ; i < colCount+1; i++) {
Expand All @@ -244,7 +244,7 @@ public void run() {
pushPrefix = k.substring(0, dex);
}
String[] aRow = new String[colCount];
int dex = k.lastIndexOf(".");
int dex = k.lastIndexOf('.');
String propName = k.substring(dex + 1);
aRow[0] = propName;
aRow[1] = data.get(k);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public static File getFileFromPattern(String jarNamePattern, File modulesDir) {
return null;
}

int subindex = jarNamePattern.lastIndexOf("/");
int subindex = jarNamePattern.lastIndexOf('/');
if (subindex != -1) {
String subdir = jarNamePattern.substring(0, subindex);
jarNamePattern = jarNamePattern.substring(subindex + 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ private boolean saveDomainScriptFile(Document domainScriptDocument, String domai
// or to "-agentpath:C:\Program Files\lib\profileragent.dll=\"C:\Program Files\lib\",5140" (GlassFish or AS 9.0)
private String formatJvmOption(String jvmOption) {
// only jvmOption containing \" needs to be formatted
if (jvmOption.indexOf("\"") != -1) { // NOI18N
if (jvmOption.indexOf('"') != -1) { // NOI18N
// special handling for -agentpath
if (jvmOption.indexOf("\\\"") != -1 && jvmOption.indexOf("-agentpath") != -1 ){ // NOI18N
// Modification for AS 8.1, 8.2, initial modification for AS 9.0, GlassFish
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ private static boolean addMonitorJars(String domainLoc, String domainName, Strin
File instDir = new File(loc);
boolean retVal = copyFromIDEInstToDir("modules/ext/org-netbeans-modules-web-httpmonitor.jar" , instDir, "lib/org-netbeans-modules-web-httpmonitor.jar"); // NOI18N
for (String anOther : others) {
int lastSlash = anOther.lastIndexOf("/");
int lastSlash = anOther.lastIndexOf('/');
if (lastSlash > -1) {
String jarName = anOther.substring(lastSlash+1);
retVal = retVal && copyFromIDEInstToDir(anOther , instDir, "lib/"+jarName); // NOI18N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ private static Map<String, String> parseProperties(final String data) {
String [] properties = data.split("[;?&:]");
for(int i = 0; i < properties.length; i++) {
if(properties[i] != null && properties[i].length() > 0) {
int eqIndex = properties[i].indexOf("=");
int eqIndex = properties[i].indexOf('=');
if(eqIndex != -1) {
result.put(properties[i].substring(0, eqIndex), properties[i].substring(eqIndex+1));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ protected File getJarName(String glassfishInstallRoot, String jarNamePattern) {

File modulesDir = new File(glassfishInstallRoot + File.separatorChar +
GFV3_MODULES_DIR_NAME);
int subindex = jarNamePattern.lastIndexOf("/");
int subindex = jarNamePattern.lastIndexOf('/');
if(subindex != -1) {
String subdir = jarNamePattern.substring(0, subindex);
jarNamePattern = jarNamePattern.substring(subindex+1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public static File getWsJarName(String glassfishInstallRoot,
{
File modulesDir = new File(glassfishInstallRoot + File.separatorChar +
GFV3_MODULES_DIR_NAME);
int subindex = jarNamePattern.lastIndexOf("/");
int subindex = jarNamePattern.lastIndexOf('/');
if(subindex != -1) {
String subdir = jarNamePattern.substring(0, subindex);
jarNamePattern = jarNamePattern.substring(subindex+1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private static String makeShorterLegalFilename(String filename) {


static String stripExtraDBInfo(String dbConnectionString) {
int bracketIndex = dbConnectionString.indexOf("["); // NOI18N
int bracketIndex = dbConnectionString.indexOf('['); // NOI18N
if(bracketIndex != -1) {
dbConnectionString = dbConnectionString.substring(0, bracketIndex).trim();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public static File getFileFromPattern(String pattern, File dir) {
assert pattern != null : "Search pattern should not be null";
assert dir != null : "Search directory tree root should not be null";
// TODO: Check if this is OK of File.pathSeparator should be used.
int subindex = pattern.lastIndexOf("/");
int subindex = pattern.lastIndexOf('/');
if (subindex != -1) {
String subdir = pattern.substring(0, subindex);
pattern = pattern.substring(subindex + 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ private FileObject getMainClassFO(FileObject sourcesRoot, String mainClass) {
}

static String getPackageName(String displayName) {
StringBuffer builder = new StringBuffer();
StringBuilder builder = new StringBuilder();
boolean firstLetter = true;
for (int i=0; i< displayName.length(); i++) {
char c = displayName.charAt(i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ private boolean updateWsCompileProperties(String serviceName) {
}

if(newWscJars) {
StringBuffer newClasspathBuf = new StringBuffer(256);
StringBuilder newClasspathBuf = new StringBuilder(256);
for(Iterator<String> iter = wscJars.iterator(); iter.hasNext(); ) {
newClasspathBuf.append(iter.next().toString());
if(iter.hasNext()) {
Expand Down Expand Up @@ -815,7 +815,7 @@ public JAXRPCClientStubDescriptor(String name, String displayName, String [] def
}

public String getDefaultFeaturesAsArgument() {
StringBuffer buf = new StringBuffer(defaultFeatures.length*32);
StringBuilder buf = new StringBuilder(defaultFeatures.length*32);
for(int i = 0; i < defaultFeatures.length; i++) {
if(i > 0) {
buf.append(','); // NOI18N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ public void run(Context actionContext) {
} catch (DatasourceAlreadyExistsException daee) { // it should not occur bcs it should be already handled in DatasourceCustomizer
StringBuilder sb = new StringBuilder();
for (Object conflict : daee.getDatasources()) {
sb.append(conflict.toString() + "\n"); // NOI18N
sb.append(conflict.toString()).append("\n"); // NOI18N
}

String message = NbBundle.getMessage(DatasourceUIHelper.class, "ERR_DsConflict", sb.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ private static String guessPackageName(final FileObject f) {
java.io.Reader r = null;
try {
r = new BufferedReader(new InputStreamReader(f.getInputStream(), "utf-8")); // NOI18N
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
final char[] buffer = new char[4096];
int len;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ private static boolean matchURL(String jdbcResourceUrl, String dsInfoUrl, boolea
}

if (jdbcResourceUrl.contains("derby")) {
int lastIndexOfColon = jdbcResourceUrl.lastIndexOf(":");
int lastIndexOfSlash = jdbcResourceUrl.lastIndexOf("/");
int lastIndexOfColon = jdbcResourceUrl.lastIndexOf(':');
int lastIndexOfSlash = jdbcResourceUrl.lastIndexOf('/');

if (lastIndexOfColon >= 0 && lastIndexOfSlash >= 0) {
String newJdbcResourceUrl = jdbcResourceUrl.substring(0, lastIndexOfColon) + jdbcResourceUrl.substring(lastIndexOfSlash);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public static Profile fromPropertiesString(@NullAllowed String value) {

private static String getProfileVersion(@NonNull Profile profile) {
String profileDetails = profile.toPropertiesString();
int indexOfDash = profileDetails.indexOf("-");
int indexOfDash = profileDetails.indexOf('-');
if (indexOfDash != -1) {
return profileDetails.substring(0, indexOfDash);
}
Expand All @@ -206,7 +206,7 @@ private static boolean compareWebAndFull(@NonNull Profile profileToCompare, @Non

private static boolean isFullProfile(@NonNull Profile profile) {
final String profileDetails = profile.toPropertiesString();
if (profileDetails.indexOf("-") == -1) {
if (profileDetails.indexOf('-') == -1) {
return true;
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ private static String extractVersion(Document document) {
// it is XSD-based
String schemaLocation = document.getDocumentElement().getAttribute("xsi:schemaLocation");
if (schemaLocation != null) {
id = schemaLocation.substring(schemaLocation.lastIndexOf(" ") + 1);
id = schemaLocation.substring(schemaLocation.lastIndexOf(' ') + 1);
}
}
if (id != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public String toString() {
StringBuilder sb = new StringBuilder();
final String newLine = System.getProperty("line.separator");

sb.append(this.getClass().getName() + " Object {");
sb.append(this.getClass().getName()).append(" Object {");
sb.append(newLine);

sb.append(" Name: ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,13 +515,13 @@ public void run () {
for (int i=0;i<deletedEjbNames.size();i++) {
String deletedServletName = (String)deletedEjbNames.get(i);
String deletedName=deletedServletName;
int index = deletedServletName.lastIndexOf("."); //NOI18N
int index = deletedServletName.lastIndexOf('.'); //NOI18N
if (index>0) deletedName = deletedServletName.substring(index+1);
boolean found = false;
for (int j=0;j<newFileNames.size();j++) {
String newFileName = newFileNames.get(j);
String newName = newFileName;
int ind = newFileName.lastIndexOf("."); //NOI18N
int ind = newFileName.lastIndexOf('.'); //NOI18N
if (ind>0) newName = newFileName.substring(ind+1);
if (deletedName.equals(newName)) { // servlet was removed
found=true;
Expand Down Expand Up @@ -562,7 +562,7 @@ public void fileRenamed(org.openide.filesystems.FileRenameEvent fileRenameEvent)
FileObject fo = fileRenameEvent.getFile();
String resourceName = getPackageName (fo);
if (resourceName != null) {
int index = resourceName.lastIndexOf("."); //NOI18N
int index = resourceName.lastIndexOf('.'); //NOI18N
String oldName = fileRenameEvent.getName();
String oldResourceName = (index>=0?resourceName.substring(0,index+1):"")+oldName;
Application ejbJar = getApplication();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -693,12 +693,12 @@ private static void showDialog(String elementName, String attrName, String attrV
}

private static String getIndentBefore(int level) {
StringBuffer sb = new StringBuffer("\n"); //NOI18N
StringBuilder sb = new StringBuilder("\n"); //NOI18N
for (int i=0;i<=level;i++) sb.append(" "); //NOI18N
return sb.toString();
}
private static String getIndentAfter(int level) {
StringBuffer sb = new StringBuffer("\n"); //NOI18N
StringBuilder sb = new StringBuilder("\n"); //NOI18N
for (int i=0;i<level;i++) sb.append(" "); //NOI18N
return sb.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,15 +309,15 @@ public void run() {
for (int i = 0; i < deletedEjbNames.size(); i++) {
String deletedServletName = deletedEjbNames.get(i);
String deletedName = deletedServletName;
int index = deletedServletName.lastIndexOf("."); //NOI18N
int index = deletedServletName.lastIndexOf('.'); //NOI18N
if (index > 0) {
deletedName = deletedServletName.substring(index + 1);
}
boolean found = false;
for (int j = 0; j < newFileNames.size(); j++) {
String newFileName = newFileNames.get(j);
String newName = newFileName;
int ind = newFileName.lastIndexOf("."); //NOI18N
int ind = newFileName.lastIndexOf('.'); //NOI18N
if (ind > 0) {
newName = newFileName.substring(ind + 1);
}
Expand Down Expand Up @@ -363,7 +363,7 @@ public void fileRenamed(FileRenameEvent fileRenameEvent) {
FileObject fo = fileRenameEvent.getFile();
String resourceName = getPackageName(fo);
if (resourceName != null) {
int index = resourceName.lastIndexOf("."); //NOI18N
int index = resourceName.lastIndexOf('.'); //NOI18N
String oldName = fileRenameEvent.getName();
String oldResourceName = (index >= 0 ? resourceName.substring(0, index + 1) : "") + oldName;
EjbJar ejbJar = getEjbJar();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ public static String addItem(String text, String newItem, boolean asFirst) {
}

private static String getAsString(List list) {
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
for (int i=0;i<list.size();i++) {
if (i>0) buf.append(", "); //NOI18N
buf.append((String)list.get(i));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ String getJspGroupTitle(JspPropertyGroup jspGroup) {
if (name==null) name = NbBundle.getMessage(PagesMultiViewElement.class,"NODE_JSP_GROUP");

String[] patterns = jspGroup.getUrlPattern();
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
for (int i=0;i<patterns.length;i++) {
if (i>0) buf.append(", ");
buf.append(patterns[i]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private void getWelcomeFiles() {
return;
} else {
String[] welcomeFiles = wfList.getWelcomeFile();
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
for (int i=0;i<welcomeFiles.length;i++) {
if (i>0) buf.append(", ");
buf.append(welcomeFiles[i].trim());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ String[] getTargetNames(String command, Lookup context, Properties p) throws Ill
if (null != wm) {
FileObject fo = wm.getDocumentBase();
if (null != fo) {
edbd.append(FileUtil.toFile(fo).getAbsolutePath()+":"); //NOI18N
edbd.append(FileUtil.toFile(fo).getAbsolutePath()).append(":"); //NOI18N
}
}
}
Expand Down Expand Up @@ -287,7 +287,7 @@ String[] getTargetNames(String command, Lookup context, Properties p) throws Ill
if (null != wm) {
FileObject fo = wm.getDocumentBase();
if (null != fo) {
edbd.append(FileUtil.toFile(fo).getAbsolutePath()+":"); //NOI18N
edbd.append(FileUtil.toFile(fo).getAbsolutePath()).append(":"); //NOI18N
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ public String toString() {
StringBuilder sb = new StringBuilder();
final String newLine = System.getProperty("line.separator");

sb.append(this.getClass().getName() + " Object {");
sb.append(this.getClass().getName()).append(" Object {");
sb.append(newLine);

sb.append(" Name: ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public String toString() {
StringBuilder sb = new StringBuilder();
final String newLine = System.getProperty("line.separator");

sb.append(this.getClass().getName() + " Object {");
sb.append(this.getClass().getName()).append(" Object {");
sb.append(newLine);

if (connector != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public String toString() {
StringBuilder sb = new StringBuilder();
final String newLine = System.getProperty("line.separator");

sb.append(this.getClass().getName() + " Object {");
sb.append(this.getClass().getName()).append(" Object {");
sb.append(newLine);

sb.append(" Module Uri: ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public static String toClasspathString(File[] classpathEntries) {
if (classpathEntries == null) {
return "";
}
StringBuffer classpath = new StringBuffer();
StringBuilder classpath = new StringBuilder();
for (int i = 0; i < classpathEntries.length; i++) {
classpath.append(classpathEntries[i].getAbsolutePath());
if (i + 1 < classpathEntries.length) {
Expand Down
Loading