From b02e217241d1ea0030a4e4d3196ef43d551fb6de Mon Sep 17 00:00:00 2001 From: Andrei Briukhov Date: Sat, 7 Jan 2023 13:26:49 -0300 Subject: [PATCH] Simplified usage String.substring() method from two arguments to one argument if applicable One of String.substring() method implementation does require only one arg variant with detection of full length of the string inside. Therefore there is no needed to set length manually as second parametr. --- .../api/methodcontroller/EntityMethodController.java | 2 +- .../sun/api/restricted/ResourceConfigurator.java | 8 ++++---- .../j2ee/sun/ide/j2ee/mbmapping/JvmOptions.java | 2 +- .../j2ee/sun/ide/sunresources/wizards/Util.java | 2 +- .../wildfly/ide/WildflyIncrementalDeployment.java | 2 +- .../org/netbeans/modules/maven/j2ee/ear/EarImpl.java | 2 +- .../modules/web/el/refactoring/RefactoringUtil.java | 4 ++-- .../modules/web/monitor/data/RequestData.java | 8 ++++---- .../modules/web/refactoring/RefactoringUtil.java | 2 +- .../struts/editor/StrutsConfigHyperlinkProvider.java | 2 +- .../websvc/rest/codegen/ResourceJavaScript.java | 2 +- .../netbeans/modules/websvc/rest/wizard/Util.java | 2 +- .../apache/tools/ant/module/spi/AntOutputStream.java | 2 +- .../netbeans/modules/groovy/editor/api/ASTUtils.java | 2 +- .../groovy/editor/api/parser/GroovyParser.java | 12 ++++++------ .../modules/groovy/editor/utils/GroovyUtils.java | 2 +- .../editor/api/completion/GroovyCCTestBase.java | 2 +- .../refactoring/findusages/FindUsagesPainter.java | 2 +- .../groovy/refactoring/utils/IdentifiersUtil.java | 2 +- .../org/netbeans/jellytools/util/StringFilter.java | 2 +- .../issuetable/QueryTableCellRenderer.java | 2 +- .../modules/bugtracking/ui/search/PopupItem.java | 2 +- .../netbeans/modules/bugzilla/issue/IssuePanel.java | 2 +- .../modules/bugzilla/query/QueryController.java | 2 +- .../modules/bugzilla/query/ControllerTest.java | 2 +- .../org/netbeans/modules/css/lib/api/NodeUtil.java | 2 +- .../modules/css/model/impl/ElementHandleImpl.java | 2 +- .../querybuilder/QueryBuilderSqlTextArea.java | 4 ++-- .../db/explorer/driver/JDBCDriverConvertor.java | 2 +- .../modules/diff/cmdline/CmdlineDiffProvider.java | 10 +++++----- .../modules/editor/completion/CompletionImpl.java | 2 +- ide/editor.lib/src/org/netbeans/editor/BaseKit.java | 2 +- .../editor/lib2/actions/EditorActionUtilities.java | 4 ++-- .../netbeans/lib/editor/util/StringEscapeUtils.java | 2 +- .../git/options/GitOptionsPanelController.java | 2 +- .../test/git/utils/RepositoryMaintenance.java | 2 +- .../html/editor/lib/api/elements/ElementUtils.java | 2 +- .../completion/HtmlPaletteCompletionProvider.java | 2 +- .../options/MercurialOptionsPanelController.java | 2 +- .../test/mercurial/utils/RepositoryMaintenance.java | 2 +- .../org/netbeans/modules/mylyn/util/MylynUtils.java | 2 +- .../modules/properties/PropertiesParser.java | 2 +- .../modules/schema2beans/DDRegistryParser.java | 4 ++-- .../netbeans/modules/schema2beans/DOMBinding.java | 2 +- .../src/org/netbeans/modules/schema2beans/QName.java | 2 +- .../org/netbeans/modules/schema2beans/XMLUtil.java | 8 ++++---- .../modules/schema2beansdev/BeanBuilder.java | 8 ++++---- .../netbeans/modules/schema2beansdev/GraphLink.java | 2 +- .../netbeans/modules/schema2beansdev/GraphNode.java | 2 +- .../modules/schema2beansdev/JavaBeanClass.java | 2 +- .../netbeans/modules/schema2beansdev/S2bConfig.java | 2 +- .../netbeans/modules/schema2beansdev/SchemaRep.java | 2 +- .../modules/schema2beansdev/beangraph/BeanGraph.java | 2 +- .../beangraph/SchemaTypeMappingType.java | 2 +- .../modules/schema2beansdev/gen/JavaUtil.java | 2 +- .../modules/schema2beansdev/metadd/MetaDD.java | 2 +- .../modules/schema2beansdev/metadd/MetaElement.java | 2 +- .../modules/schema2beansdev/metadd/MetaProperty.java | 2 +- .../subversion/options/SvnOptionsController.java | 2 +- .../subversion/ui/history/RepositoryRevision.java | 2 +- .../subversion/ui/history/SearchExecutor.java | 2 +- .../test/subversion/utils/RepositoryMaintenance.java | 2 +- .../modules/subversion/AbstractSvnTestCase.java | 2 +- .../netbeans/modules/subversion/InteceptorTest.java | 2 +- .../modules/subversion/api/SearchHistoryTest.java | 2 +- .../subversion/ui/diff/RevisionSetupSupportTest.java | 2 +- .../modules/versioning/VCSInterceptorTestCase.java | 6 +++--- .../versioning/ui/history/HistoryComponent.java | 2 +- .../versioning/ui/history/HistoryFileView.java | 2 +- .../versioning/history/SummaryCellRenderer.java | 2 +- .../versioning/util/VCSNotificationDisplayer.java | 2 +- .../xml/schema/completion/util/CompletionUtil.java | 2 +- .../xml/text/completion/XMLCompletionQuery.java | 2 +- .../modules/xml/text/navigator/TreeNodeAdapter.java | 2 +- .../xml/text/syntax/javacc/ParseException.java | 2 +- .../xml/text/syntax/javacc/TokenMgrError.java | 2 +- .../xml/text/syntax/javacc/lib/CharStream.java | 2 +- .../text/syntax/javacc/lib/StringParserInput.java | 2 +- .../http/validation/HTTPComponentValidator.java | 6 +++--- .../soap/validation/SOAPComponentVisitor.java | 6 +++--- .../soap12/validation/SOAP12ComponentVisitor.java | 6 +++--- .../src/org/netbeans/tests/xml/AbstractTestUtil.java | 2 +- .../dbschema/migration/archiver/MapClassName.java | 4 ++-- .../jpda/ui/models/NumericDisplayFilter.java | 8 ++++---- .../modules/form/editors/MnemonicEditor.java | 2 +- .../form/editors2/CustomTableModelEditor.java | 2 +- .../java/editor/javadoc/JavadocCompletionTask.java | 2 +- .../debugging/EvaluationSpanTaskTest.java | 2 +- .../org/netbeans/modules/java/lsp/server/Utils.java | 2 +- .../modules/javadoc/search/IndexBuilder.java | 2 +- .../modules/javadoc/search/SearchThreadJdk12.java | 2 +- .../javadoc/search/SearchThreadJdk12_japan.java | 2 +- .../org/netbeans/modules/jshell/tool/JShellTool.java | 2 +- .../modules/maven/grammar/MavenProjectGrammar.java | 2 +- .../maven/hyperlinks/HyperlinkProviderImpl.java | 4 ++-- .../org/netbeans/performance/impl/logparsing/Gc.java | 2 +- .../performance/impl/logparsing/JavaLineswitch.java | 2 +- .../performance/impl/logparsing/ModulesLog.java | 2 +- .../modules/refactoring/java/WhereUsedElement.java | 2 +- .../spring/beans/completion/CompletorRegistry.java | 2 +- .../beans/refactoring/JavaElementRefFinder.java | 2 +- .../spring/beans/refactoring/PropertyRefFinder.java | 4 ++-- .../modules/xml/jaxb/cfg/schema/Binding.java | 2 +- .../modules/xml/jaxb/cfg/schema/Bindings.java | 2 +- .../modules/xml/jaxb/cfg/schema/Catalog.java | 2 +- .../netbeans/modules/xml/jaxb/cfg/schema/Schema.java | 2 +- .../modules/xml/jaxb/cfg/schema/SchemaSource.java | 2 +- .../modules/xml/jaxb/cfg/schema/SchemaSources.java | 2 +- .../modules/xml/jaxb/cfg/schema/Schemas.java | 2 +- .../modules/xml/jaxb/cfg/schema/XjcOption.java | 2 +- .../modules/xml/jaxb/cfg/schema/XjcOptions.java | 2 +- .../modules/javafx2/project/UpdateJFXImplTest.java | 2 +- .../netbeans/upgrade/systemoptions/SerParser.java | 2 +- nbbuild/antsrc/org/netbeans/nbbuild/CheckLinks.java | 6 +++--- .../org/netbeans/nbbuild/FixTestDependencies.java | 6 +++--- .../nbbuild/extlibs/VerifyLibsAndLicenses.java | 2 +- .../unit/src/org/netbeans/nbbuild/MakeJNLPTest.java | 2 +- .../unit/src/org/netbeans/nbbuild/MakeNBMTest.java | 2 +- .../modules/php/editor/model/impl/VariousUtils.java | 2 +- .../php/editor/parser/PHPDocCommentParser.java | 4 ++-- .../php/editor/parser/PHPVarCommentParser.java | 2 +- .../connections/ui/NewRemoteConnectionPanel.java | 2 +- .../saas/codegen/php/SoapClientPhpCodeGenerator.java | 2 +- .../api/search/provider/FileNameMatcher.java | 5 ++--- .../search/ui/ResultsOutlineCellRenderer.java | 2 +- .../core/network/proxy/NetworkProxySettings.java | 2 +- .../org/netbeans/beaninfo/editors/CharEditor.java | 2 +- .../src/org/openide/filesystems/URLMapper.java | 2 +- .../src/org/openide/loaders/DefaultDataObject.java | 3 +-- .../src/org/openide/util/BaseUtilities.java | 2 +- .../openide.util/src/org/openide/util/MapFormat.java | 2 +- .../src/org/netbeans/modules/print/ui/Attribute.java | 2 +- .../src/org/netbeans/modules/settings/Env.java | 2 +- .../netbeans/modules/quicksearch/ResultsModel.java | 2 +- .../lib/profiler/ui/components/HTMLTextArea.java | 6 +++--- .../netbeans/lib/profiler/ui/jdbc/SQLFormatter.java | 2 +- .../lib/profiler/server/ProfilerActivate15.java | 2 +- .../netbeans/modules/cordova/updatetask/XMLFile.java | 2 +- .../netbeans/modules/extbrowser/plugins/Utils.java | 6 ++---- .../javascript/jstestdriver/JSTestDriverSupport.java | 4 ++-- .../requirejs/editor/FSCompletionUtils.java | 4 ++-- .../webkit/tooling/console/BrowserConsoleLogger.java | 4 ++-- 142 files changed, 193 insertions(+), 197 deletions(-) diff --git a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/api/methodcontroller/EntityMethodController.java b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/api/methodcontroller/EntityMethodController.java index b134722a2d47..e58a262b0692 100644 --- a/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/api/methodcontroller/EntityMethodController.java +++ b/enterprise/j2ee.ejbcore/src/org/netbeans/modules/j2ee/ejbcore/api/methodcontroller/EntityMethodController.java @@ -224,7 +224,7 @@ public static String getMethodName(String fieldName, boolean get) { // } // String prefix = methodName.substring(0, 3); // if (prefix.equals("set") || prefix.equals("get")) { -// return lower(methodName.substring(3, methodName.length())); +// return lower(methodName.substring(3)); // } // return null; // } diff --git a/enterprise/j2ee.sun.appsrv/src/org/netbeans/modules/j2ee/sun/api/restricted/ResourceConfigurator.java b/enterprise/j2ee.sun.appsrv/src/org/netbeans/modules/j2ee/sun/api/restricted/ResourceConfigurator.java index a92ca07bcf41..02ca2aebf393 100644 --- a/enterprise/j2ee.sun.appsrv/src/org/netbeans/modules/j2ee/sun/api/restricted/ResourceConfigurator.java +++ b/enterprise/j2ee.sun.appsrv/src/org/netbeans/modules/j2ee/sun/api/restricted/ResourceConfigurator.java @@ -389,12 +389,12 @@ private JdbcConnectionPool setAdditionalProps(String vendorName, String url, Jdb if(vendorName.equals("sybase2")){ //NOI18N int index = url.indexOf("Tds:"); //NOI18N if(index != -1){ - workingUrl = url.substring(index + 4, url.length()); //NOI18N + workingUrl = url.substring(index + 4); //NOI18N } else { return jdbcConnectionPool; } }else { - workingUrl = url.substring(url.indexOf("//") + 2, url.length()); //NOI18N + workingUrl = url.substring(url.indexOf("//") + 2); //NOI18N } PropertyElement servName = jdbcConnectionPool.newPropertyElement(); servName.setName(WizardConstants.__ServerName); @@ -652,7 +652,7 @@ public String getDerbyDatabaseName(String url){ if(colonIndex != -1) { databaseName = url.substring(index + 1, colonIndex); } else { - databaseName = url.substring(index + 1, url.length()); + databaseName = url.substring(index + 1); } } return databaseName; @@ -662,7 +662,7 @@ private String getDerbyConnAttrs(String url){ String connAttr = ""; //NOI18N int colonIndex = url.indexOf(";"); //NOI18N if(colonIndex != -1) { - connAttr = url.substring(colonIndex, url.length()); + connAttr = url.substring(colonIndex); } return connAttr; } diff --git a/enterprise/j2ee.sun.appsrv/src/org/netbeans/modules/j2ee/sun/ide/j2ee/mbmapping/JvmOptions.java b/enterprise/j2ee.sun.appsrv/src/org/netbeans/modules/j2ee/sun/ide/j2ee/mbmapping/JvmOptions.java index 9ebd028a130e..951e284d63aa 100644 --- a/enterprise/j2ee.sun.appsrv/src/org/netbeans/modules/j2ee/sun/ide/j2ee/mbmapping/JvmOptions.java +++ b/enterprise/j2ee.sun.appsrv/src/org/netbeans/modules/j2ee/sun/ide/j2ee/mbmapping/JvmOptions.java @@ -196,7 +196,7 @@ public void setAddressValue(String portNumber){ String inMiddle = debugOptionsVal.substring(debugOptionsVal.indexOf(DEBUG_OPTIONS_ADDRESS) + DEBUG_OPTIONS_ADDRESS.length(), debugOptionsVal.length()); int hasMore = inMiddle.indexOf(","); //NOI18N if(hasMore != -1){ - String debugOptionsEnd = inMiddle.substring(hasMore, inMiddle.length()); + String debugOptionsEnd = inMiddle.substring(hasMore); debugOptionsStart = debugOptionsStart + debugOptionsEnd; } Attribute newAttr = new Attribute(DEBUG_OPTIONS, debugOptionsStart); diff --git a/enterprise/j2ee.sun.appsrv/src/org/netbeans/modules/j2ee/sun/ide/sunresources/wizards/Util.java b/enterprise/j2ee.sun.appsrv/src/org/netbeans/modules/j2ee/sun/ide/sunresources/wizards/Util.java index 6e58eab6112c..285b1f36e242 100644 --- a/enterprise/j2ee.sun.appsrv/src/org/netbeans/modules/j2ee/sun/ide/sunresources/wizards/Util.java +++ b/enterprise/j2ee.sun.appsrv/src/org/netbeans/modules/j2ee/sun/ide/sunresources/wizards/Util.java @@ -75,7 +75,7 @@ public static String getCorrectedLabel(ResourceBundle bundle, String key){ // some locales do not have mnemonics? if (i > -1) { result = val.substring(0, i); - result = result.concat(val.substring(i+1, val.length())); + result = result.concat(val.substring(i+1)); } else { result = val; } diff --git a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/WildflyIncrementalDeployment.java b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/WildflyIncrementalDeployment.java index 11e43b49d704..619bf9806fd2 100644 --- a/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/WildflyIncrementalDeployment.java +++ b/enterprise/javaee.wildfly/src/org/netbeans/modules/javaee/wildfly/ide/WildflyIncrementalDeployment.java @@ -80,7 +80,7 @@ public boolean canFileDeploy(Target target, J2eeModule deployable) { public File getDirectoryForNewApplication(Target target, J2eeModule app, ModuleConfiguration configuration) { String baseName = app.getUrl(); if(baseName.indexOf(File.separatorChar) >= 0) { - baseName = baseName.substring(baseName.lastIndexOf(File.separatorChar) +1, baseName.length()); + baseName = baseName.substring(baseName.lastIndexOf(File.separatorChar) +1); } String extension = getExtension(app.getType()); try { diff --git a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ear/EarImpl.java b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ear/EarImpl.java index 0d6a9db2dfbe..95406d9d1f08 100644 --- a/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ear/EarImpl.java +++ b/enterprise/maven.j2ee/src/org/netbeans/modules/maven/j2ee/ear/EarImpl.java @@ -799,7 +799,7 @@ String resolveBundleDir() { // Remove '/' prefix if any so that directory is a relative path if (toRet.startsWith("/")) { //NOI18N - toRet = toRet.substring(1, toRet.length()); + toRet = toRet.substring(1); } if (toRet.length() > 0 && !toRet.endsWith("/")) { //NOI18N diff --git a/enterprise/web.el/src/org/netbeans/modules/web/el/refactoring/RefactoringUtil.java b/enterprise/web.el/src/org/netbeans/modules/web/el/refactoring/RefactoringUtil.java index d3702d41860d..ffe831d4b1e7 100644 --- a/enterprise/web.el/src/org/netbeans/modules/web/el/refactoring/RefactoringUtil.java +++ b/enterprise/web.el/src/org/netbeans/modules/web/el/refactoring/RefactoringUtil.java @@ -54,7 +54,7 @@ static String encodeAndHighlight(String text, OffsetRange expressionOffset, Offs String expression = text.substring(expressionOffset.getStart(), expressionOffset.getEnd()); result.append(encodeAngleBrackets(text.substring(0, expressionOffset.getStart()))); result.append(highlight(expression, nodeOffset)); - result.append(encodeAngleBrackets(text.substring(expressionOffset.getEnd(), text.length()))); + result.append(encodeAngleBrackets(text.substring(expressionOffset.getEnd()))); return result.toString(); } @@ -68,7 +68,7 @@ private static String highlight(String text, OffsetRange offsetRange) { result.append(""); result.append(encodeAngleBrackets(text.subSequence(offsetRange.getStart(), offsetRange.getEnd()).toString())); result.append(""); - result.append(text.substring(offsetRange.getEnd(), text.length())); + result.append(text.substring(offsetRange.getEnd())); return result.toString(); } diff --git a/enterprise/web.monitor/src/org/netbeans/modules/web/monitor/data/RequestData.java b/enterprise/web.monitor/src/org/netbeans/modules/web/monitor/data/RequestData.java index 59104eaf0913..05aa3bce5d74 100644 --- a/enterprise/web.monitor/src/org/netbeans/modules/web/monitor/data/RequestData.java +++ b/enterprise/web.monitor/src/org/netbeans/modules/web/monitor/data/RequestData.java @@ -251,7 +251,7 @@ public static String findSessionID(String cookieStr) { String name = token.substring(0, i).trim(); if(name.equals(JSESSIONID)) { - String value = token.substring(i+1, token.length()).trim(); + String value = token.substring(i+1).trim(); return value=stripQuote(value); } } @@ -285,7 +285,7 @@ public Param[] getCookiesAsParams() { if (i > -1) { String name = token.substring(0, i).trim(); - String value = token.substring(i+1, token.length()).trim(); + String value = token.substring(i+1).trim(); value=stripQuote(value); cookies.addElement(new Param(name, value)); if(debug) log(name + "=" + value); @@ -437,7 +437,7 @@ public void deleteCookie(String ckname, String ckvalue) { if (j > -1) { String name = token.substring(0, j).trim(); - String value = token.substring(j+1, token.length()).trim(); + String value = token.substring(j+1).trim(); value=stripQuote(value); if(debug) log("Processing cookie: " + //NOI18N @@ -505,7 +505,7 @@ public void deleteCookie(String ckname) { else { if(debug) log("Keep this cookie");//NOI18N String value = - token.substring(j+1, token.length()).trim(); + token.substring(j+1).trim(); value=stripQuote(value); buf.append(name); buf.append("=");//NOI18N diff --git a/enterprise/web.refactoring/src/org/netbeans/modules/web/refactoring/RefactoringUtil.java b/enterprise/web.refactoring/src/org/netbeans/modules/web/refactoring/RefactoringUtil.java index ddb73590a6ff..f39af733d372 100644 --- a/enterprise/web.refactoring/src/org/netbeans/modules/web/refactoring/RefactoringUtil.java +++ b/enterprise/web.refactoring/src/org/netbeans/modules/web/refactoring/RefactoringUtil.java @@ -183,7 +183,7 @@ public static String constructNewName(FileObject javaFile, RenameRefactoring ren final String newName = buildName(prefix, rename.getNewName()); final int oldNameIndex = fqn.lastIndexOf(oldName) + oldName.length(); - return newName + fqn.substring(oldNameIndex, fqn.length()); + return newName + fqn.substring(oldNameIndex); } diff --git a/enterprise/web.struts/src/org/netbeans/modules/web/struts/editor/StrutsConfigHyperlinkProvider.java b/enterprise/web.struts/src/org/netbeans/modules/web/struts/editor/StrutsConfigHyperlinkProvider.java index 34c593b171f9..a0b59c05ceeb 100644 --- a/enterprise/web.struts/src/org/netbeans/modules/web/struts/editor/StrutsConfigHyperlinkProvider.java +++ b/enterprise/web.struts/src/org/netbeans/modules/web/struts/editor/StrutsConfigHyperlinkProvider.java @@ -266,7 +266,7 @@ private void findResourcePath(String path, BaseDocument doc){ servletMapping = servletMapping.trim(); String prefix = servletMapping.substring(0, servletMapping.length()-2); if (path.startsWith(prefix)) - actionPath = path.substring(prefix.length(), path.length()); + actionPath = path.substring(prefix.length()); else actionPath = path; } diff --git a/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/codegen/ResourceJavaScript.java b/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/codegen/ResourceJavaScript.java index e2241db3a243..3b94f3a0daec 100644 --- a/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/codegen/ResourceJavaScript.java +++ b/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/codegen/ResourceJavaScript.java @@ -208,7 +208,7 @@ private String capitalize(String str ){ return str; } char first = str.charAt(0); - return Character.toUpperCase(first) + str.substring(1 , str.length()); + return Character.toUpperCase(first) + str.substring(1); } private String getPostfix( String path ) { diff --git a/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/wizard/Util.java b/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/wizard/Util.java index bf103b193773..5c749554de96 100644 --- a/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/wizard/Util.java +++ b/enterprise/websvc.rest/src/org/netbeans/modules/websvc/rest/wizard/Util.java @@ -864,7 +864,7 @@ public void run( final WorkingCopy working ) } private static String capitalizeFirstLetter(String str) { - return str.substring(0, 1).toUpperCase() + str.substring(1, str.length()); + return str.substring(0, 1).toUpperCase() + str.substring(1); } private static void addXmlTransientAnnotation(WorkingCopy workingCopy, diff --git a/extide/o.apache.tools.ant.module/src/org/apache/tools/ant/module/spi/AntOutputStream.java b/extide/o.apache.tools.ant.module/src/org/apache/tools/ant/module/spi/AntOutputStream.java index f0ec064c5c97..c5ea70be6b0e 100644 --- a/extide/o.apache.tools.ant.module/src/org/apache/tools/ant/module/spi/AntOutputStream.java +++ b/extide/o.apache.tools.ant.module/src/org/apache/tools/ant/module/spi/AntOutputStream.java @@ -102,7 +102,7 @@ private void flushLines (boolean flushEverything) throws IOException { break MAIN; } if (flushEverything) { - flushLine(buffer.substring (0, buffer.length())); + flushLine(buffer.substring(0)); buffer.delete(0, buffer.length()); } } diff --git a/groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/api/ASTUtils.java b/groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/api/ASTUtils.java index 04f0c7880750..e34c353d0b16 100644 --- a/groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/api/ASTUtils.java +++ b/groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/api/ASTUtils.java @@ -275,7 +275,7 @@ public static List children(ASTNode root) { if (fieldName.length() > 0 && !field.isStatic() && (field.getModifiers() & Opcodes.ACC_PRIVATE) != 0) { - fieldName = Character.toUpperCase(fieldName.charAt(0)) + fieldName.substring(1, fieldName.length()); + fieldName = Character.toUpperCase(fieldName.charAt(0)) + fieldName.substring(1); if (!field.isFinal()) { possibleMethods.add("set" + fieldName); // NOI18N } diff --git a/groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/api/parser/GroovyParser.java b/groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/api/parser/GroovyParser.java index 310d29993702..732e392d8f59 100644 --- a/groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/api/parser/GroovyParser.java +++ b/groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/api/parser/GroovyParser.java @@ -263,7 +263,7 @@ private boolean sanitizeSource(Context context, Sanitize sanitizing) { sb.append(doc.substring(0, removeStart)); sb.append(' '); if (removeEnd < doc.length()) { - sb.append(doc.substring(removeEnd, doc.length())); + sb.append(doc.substring(removeEnd)); } assert sb.length() == doc.length(); context.sanitizedRange = new OffsetRange(removeStart, removeEnd); @@ -286,7 +286,7 @@ private boolean sanitizeSource(Context context, Sanitize sanitizing) { sb.append("//"); int rest = lineStart + 2; if (rest < doc.length()) { - sb.append(doc.substring(rest, doc.length())); + sb.append(doc.substring(rest)); } } else { // A line with just one character - can't replace with a comment @@ -295,7 +295,7 @@ private boolean sanitizeSource(Context context, Sanitize sanitizing) { sb.append(" "); int rest = lineStart + 1; if (rest < doc.length()) { - sb.append(doc.substring(rest, doc.length())); + sb.append(doc.substring(rest)); } } @@ -320,7 +320,7 @@ private boolean sanitizeSource(Context context, Sanitize sanitizing) { sb.append("//"); int rest = lineStart + 2; if (rest < doc.length()) { - sb.append(doc.substring(rest, doc.length())); + sb.append(doc.substring(rest)); } } else { // A line with just one character - can't replace with a comment @@ -329,7 +329,7 @@ private boolean sanitizeSource(Context context, Sanitize sanitizing) { sb.append(" "); int rest = lineStart + 1; if (rest < doc.length()) { - sb.append(doc.substring(rest, doc.length())); + sb.append(doc.substring(rest)); } } @@ -401,7 +401,7 @@ private boolean sanitizeSource(Context context, Sanitize sanitizing) { } if (removeEnd < doc.length()) { - sb.append(doc.substring(removeEnd, doc.length())); + sb.append(doc.substring(removeEnd)); } assert sb.length() == doc.length(); diff --git a/groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/utils/GroovyUtils.java b/groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/utils/GroovyUtils.java index 092602e60b90..cb832c4c4801 100644 --- a/groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/utils/GroovyUtils.java +++ b/groovy/groovy.editor/src/org/netbeans/modules/groovy/editor/utils/GroovyUtils.java @@ -56,7 +56,7 @@ public static String stripPackage(String fqn) { if (last > first) { return stripPackage(fqn.substring(0, first)) + "<" + stripPackageFromTypeParams(fqn.substring(first + 1, last)) + ">" + - fqn.substring(last + 1, fqn.length()); + fqn.substring(last + 1); } } if (fqn.contains(".")) { diff --git a/groovy/groovy.editor/test/unit/src/org/netbeans/modules/groovy/editor/api/completion/GroovyCCTestBase.java b/groovy/groovy.editor/test/unit/src/org/netbeans/modules/groovy/editor/api/completion/GroovyCCTestBase.java index 27e5d7402216..71ea5b4e85bd 100644 --- a/groovy/groovy.editor/test/unit/src/org/netbeans/modules/groovy/editor/api/completion/GroovyCCTestBase.java +++ b/groovy/groovy.editor/test/unit/src/org/netbeans/modules/groovy/editor/api/completion/GroovyCCTestBase.java @@ -80,7 +80,7 @@ private String getExpandedSourcePath() { } private String firstLetterToLowerCase(String className) { - return Character.toLowerCase(className.charAt(0)) + className.substring(1, className.length()); + return Character.toLowerCase(className.charAt(0)) + className.substring(1); } protected String getBasicSourcePath() { diff --git a/groovy/groovy.refactoring/src/org/netbeans/modules/groovy/refactoring/findusages/FindUsagesPainter.java b/groovy/groovy.refactoring/src/org/netbeans/modules/groovy/refactoring/findusages/FindUsagesPainter.java index ba5b959d84e3..aa5350156b53 100644 --- a/groovy/groovy.refactoring/src/org/netbeans/modules/groovy/refactoring/findusages/FindUsagesPainter.java +++ b/groovy/groovy.refactoring/src/org/netbeans/modules/groovy/refactoring/findusages/FindUsagesPainter.java @@ -112,7 +112,7 @@ private static String trimStart(String s) { if (Character.isWhitespace(s.charAt(x))) { continue; } else { - return s.substring(x, s.length()); + return s.substring(x); } } return ""; diff --git a/groovy/groovy.refactoring/src/org/netbeans/modules/groovy/refactoring/utils/IdentifiersUtil.java b/groovy/groovy.refactoring/src/org/netbeans/modules/groovy/refactoring/utils/IdentifiersUtil.java index 6f4e6ee35525..45581968e1ab 100644 --- a/groovy/groovy.refactoring/src/org/netbeans/modules/groovy/refactoring/utils/IdentifiersUtil.java +++ b/groovy/groovy.refactoring/src/org/netbeans/modules/groovy/refactoring/utils/IdentifiersUtil.java @@ -70,7 +70,7 @@ public static String constructNewName(FileObject file, RenameRefactoring rename) String oldName = buildName(prefix, folder.getName()); String newName = buildName(prefix, rename.getNewName()); int oldNameIndex = fqn.lastIndexOf(oldName) + oldName.length(); - return newName + fqn.substring(oldNameIndex, fqn.length()); + return newName + fqn.substring(oldNameIndex); } diff --git a/harness/jellytools.platform/src/org/netbeans/jellytools/util/StringFilter.java b/harness/jellytools.platform/src/org/netbeans/jellytools/util/StringFilter.java index 7eb6d75df882..ce339d43ad64 100644 --- a/harness/jellytools.platform/src/org/netbeans/jellytools/util/StringFilter.java +++ b/harness/jellytools.platform/src/org/netbeans/jellytools/util/StringFilter.java @@ -119,7 +119,7 @@ public static String replaceString(String original, String begin, String end, St break; to += end.length(); } - original = original.substring(0, from) + replace + original.substring(to, original.length()); + original = original.substring(0, from) + replace + original.substring(to); offset = from + replace.length(); } while (replaceAll); diff --git a/ide/bugtracking.commons/src/org/netbeans/modules/bugtracking/issuetable/QueryTableCellRenderer.java b/ide/bugtracking.commons/src/org/netbeans/modules/bugtracking/issuetable/QueryTableCellRenderer.java index be7b5ed764bd..1b610f8c7ab6 100644 --- a/ide/bugtracking.commons/src/org/netbeans/modules/bugtracking/issuetable/QueryTableCellRenderer.java +++ b/ide/bugtracking.commons/src/org/netbeans/modules/bugtracking/issuetable/QueryTableCellRenderer.java @@ -212,7 +212,7 @@ private static String highLight(String s, Pattern pattern) { idx = matcher.end(); } if(sb.length() > 0) { - sb.append(idx < s.length() ? s.substring(idx, s.length()) : ""); + sb.append(idx < s.length() ? s.substring(idx) : ""); s = sb.toString(); } return s; diff --git a/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/search/PopupItem.java b/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/search/PopupItem.java index 9cd56d637269..18a2b2fb7df9 100644 --- a/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/search/PopupItem.java +++ b/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/search/PopupItem.java @@ -77,7 +77,7 @@ public String highlite(String text, String displayText) { idx = displayTextLower.indexOf(displayTextLower, lastIdx); } if(lastIdx < displayText.length()) { - sb.append(displayText.substring(lastIdx, displayText.length())); + sb.append(displayText.substring(lastIdx)); } sb.append(""); // NOI18N return sb.toString(); diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/IssuePanel.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/IssuePanel.java index 9890ce20f851..d6ee2ed2b63e 100644 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/IssuePanel.java +++ b/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/IssuePanel.java @@ -3391,7 +3391,7 @@ private void submitButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN- idx = comment.indexOf(s); if(idx > 0) { idx += s.length() + 1; - comment = comment.substring(0, idx) + "\n\n" + repro + comment.substring(idx, comment.length()); // NOI18N + comment = comment.substring(0, idx) + "\n\n" + repro + comment.substring(idx); // NOI18N } else { comment = repro + "\n\n" + comment; // NOI18N } diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryController.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryController.java index f0afab566de8..ef9ef64cf53d 100644 --- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryController.java +++ b/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryController.java @@ -947,7 +947,7 @@ private void setParameters(String urlParameters) { int idx = p.indexOf("="); // NOI18N if(idx > -1) { String parameter = p.substring(0, idx); - String value = p.substring(idx + 1, p.length()); + String value = p.substring(idx + 1); ParameterValue pv = new ParameterValue(value, value); List values = normalizedParams.get(parameter); diff --git a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/query/ControllerTest.java b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/query/ControllerTest.java index 2defdc035233..9a9502c38021 100644 --- a/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/query/ControllerTest.java +++ b/ide/bugzilla/test/unit/src/org/netbeans/modules/bugzilla/query/ControllerTest.java @@ -91,7 +91,7 @@ private void assertParameters(LogHandler h, String parametersUrl, QueryControlle String[] parametersGiven = parametersUrl.split("&"); String params = c.getUrlParameters(true); assertTrue(params.startsWith("&")); - params = params.substring(1, params.length()); + params = params.substring(1); String[] parametersReturned = params.split("&"); // assertEquals(parametersGiven.length, parametersReturned.length); diff --git a/ide/css.lib/src/org/netbeans/modules/css/lib/api/NodeUtil.java b/ide/css.lib/src/org/netbeans/modules/css/lib/api/NodeUtil.java index ebd1b011a910..2c65d133899b 100644 --- a/ide/css.lib/src/org/netbeans/modules/css/lib/api/NodeUtil.java +++ b/ide/css.lib/src/org/netbeans/modules/css/lib/api/NodeUtil.java @@ -283,7 +283,7 @@ public static Node query(Node base, String path, boolean caseInsensitive) { if (caseInsensitive) { nodeName = nodeName.toLowerCase(Locale.ENGLISH); } - String sindex = indexDelim >= 0 ? token.substring(indexDelim + 1, token.length()) : "0"; + String sindex = indexDelim >= 0 ? token.substring(indexDelim + 1) : "0"; int index = Integer.parseInt(sindex); int count = 0; diff --git a/ide/css.model/src/org/netbeans/modules/css/model/impl/ElementHandleImpl.java b/ide/css.model/src/org/netbeans/modules/css/model/impl/ElementHandleImpl.java index 17ce66aab23b..ff812bc0340e 100644 --- a/ide/css.model/src/org/netbeans/modules/css/model/impl/ElementHandleImpl.java +++ b/ide/css.model/src/org/netbeans/modules/css/model/impl/ElementHandleImpl.java @@ -62,7 +62,7 @@ public void run(StyleSheet styleSheet) { String lightId = indexDelim >= 0 ? token.substring(0, indexDelim) : token; - String sindex = indexDelim >= 0 ? token.substring(indexDelim + 1, token.length()) : "1"; + String sindex = indexDelim >= 0 ? token.substring(indexDelim + 1) : "1"; int index = Integer.parseInt(sindex); int count = 0; diff --git a/ide/db.sql.visualeditor/src/org/netbeans/modules/db/sql/visualeditor/querybuilder/QueryBuilderSqlTextArea.java b/ide/db.sql.visualeditor/src/org/netbeans/modules/db/sql/visualeditor/querybuilder/QueryBuilderSqlTextArea.java index 95e7056ac12d..b9f98b3a8ee1 100644 --- a/ide/db.sql.visualeditor/src/org/netbeans/modules/db/sql/visualeditor/querybuilder/QueryBuilderSqlTextArea.java +++ b/ide/db.sql.visualeditor/src/org/netbeans/modules/db/sql/visualeditor/querybuilder/QueryBuilderSqlTextArea.java @@ -336,7 +336,7 @@ public void keyPressed(KeyEvent e) { // keywordString.substring(1, keywordString.length()-1); // } else if (keywordString.length() > 2 && ( keywordString.startsWith("\"") || keywordString.startsWith("\'") ) ) { // db_element_wo_quotes = -// keywordString.substring(1, keywordString.length()); +// keywordString.substring(1); // } else // db_element_wo_quotes = keywordString; // // check if it is schema name @@ -437,7 +437,7 @@ public void keyPressed(KeyEvent e) { // } else if ( str.length() > 2 && // ( str.startsWith("\"") || // str.startsWith("\'") ) ) { -// db_element_wo_quotes = str.substring(1, str.length()); +// db_element_wo_quotes = str.substring(1); // position = position+1; // } else { // db_element_wo_quotes = str; diff --git a/ide/db/src/org/netbeans/modules/db/explorer/driver/JDBCDriverConvertor.java b/ide/db/src/org/netbeans/modules/db/explorer/driver/JDBCDriverConvertor.java index 481b77df33dc..76038cc2d1a0 100644 --- a/ide/db/src/org/netbeans/modules/db/explorer/driver/JDBCDriverConvertor.java +++ b/ide/db/src/org/netbeans/modules/db/explorer/driver/JDBCDriverConvertor.java @@ -246,7 +246,7 @@ static URL encodeURL(URL url) throws MalformedURLException, URISyntaxException { String part = urlString.substring(colon + 1, pound != -1 ? pound : urlString.length()); if (pound != -1) { - fragment = urlString.substring(pound + 1, urlString.length()); + fragment = urlString.substring(pound + 1); } return new URI(url.getProtocol(), part, fragment).toURL(); } diff --git a/ide/diff/src/org/netbeans/modules/diff/cmdline/CmdlineDiffProvider.java b/ide/diff/src/org/netbeans/modules/diff/cmdline/CmdlineDiffProvider.java index 8e6d38075076..16b928e95bac 100644 --- a/ide/diff/src/org/netbeans/modules/diff/cmdline/CmdlineDiffProvider.java +++ b/ide/diff/src/org/netbeans/modules/diff/cmdline/CmdlineDiffProvider.java @@ -301,7 +301,7 @@ public static void outputLine(String elements, Pattern pattern, List index++; commaIndex = elements.indexOf(',', index); if (commaIndex < 0) { - nStr = elements.substring(index, elements.length()); + nStr = elements.substring(index); if (checkEmpty(nStr, elements)) return; n3 = Integer.parseInt(nStr); n4 = n3; @@ -309,7 +309,7 @@ public static void outputLine(String elements, Pattern pattern, List nStr = elements.substring(index, commaIndex); if (checkEmpty(nStr, elements)) return; n3 = Integer.parseInt(nStr); - nStr = elements.substring(commaIndex+1, elements.length()); + nStr = elements.substring(commaIndex+1); if (nStr == null || nStr.length() == 0) n4 = n3; else n4 = Integer.parseInt(nStr); } @@ -341,7 +341,7 @@ public static void outputLine(String elements, Pattern pattern, List if (checkEmpty(nStr, elements)) return; n2 = Integer.parseInt(nStr); } - nStr = elements.substring(index+1, elements.length()); + nStr = elements.substring(index+1); if (checkEmpty(nStr, elements)) return; n3 = Integer.parseInt(nStr); } catch (NumberFormatException e) { @@ -375,7 +375,7 @@ public static void outputLine(String elements, Pattern pattern, List index++; commaIndex = elements.indexOf(',', index); if (commaIndex < 0) { - nStr = elements.substring(index, elements.length()); + nStr = elements.substring(index); if (checkEmpty(nStr, elements)) return; n3 = Integer.parseInt(nStr); n4 = n3; @@ -383,7 +383,7 @@ public static void outputLine(String elements, Pattern pattern, List nStr = elements.substring(index, commaIndex); if (checkEmpty(nStr, elements)) return; n3 = Integer.parseInt(nStr); - nStr = elements.substring(commaIndex+1, elements.length()); + nStr = elements.substring(commaIndex+1); if (nStr == null || nStr.length() == 0) n4 = n3; else n4 = Integer.parseInt(nStr); } diff --git a/ide/editor.completion/src/org/netbeans/modules/editor/completion/CompletionImpl.java b/ide/editor.completion/src/org/netbeans/modules/editor/completion/CompletionImpl.java index 109a6151eb23..e1925e196998 100644 --- a/ide/editor.completion/src/org/netbeans/modules/editor/completion/CompletionImpl.java +++ b/ide/editor.completion/src/org/netbeans/modules/editor/completion/CompletionImpl.java @@ -721,7 +721,7 @@ public void run() { // true as providers are registered using classnames. int lastSlash = id.lastIndexOf('/'); // NOI18N if (lastSlash > 0) { - String fname = id.substring(lastSlash + 1, id.length()); + String fname = id.substring(lastSlash + 1); if (!seenProviders.add(fname)) { // the provider has been already seen in this list; do not add it. continue; diff --git a/ide/editor.lib/src/org/netbeans/editor/BaseKit.java b/ide/editor.lib/src/org/netbeans/editor/BaseKit.java index 289b3aeb4f1c..52e634d5b708 100644 --- a/ide/editor.lib/src/org/netbeans/editor/BaseKit.java +++ b/ide/editor.lib/src/org/netbeans/editor/BaseKit.java @@ -2506,7 +2506,7 @@ public void run () { // p0 = p+1; // } // } -// if (p0 < str.length()) v.add(str.substring(p0, str.length())); else v.add(""); +// if (p0 < str.length()) v.add(str.substring(p0)); else v.add(""); // // return (String [])v.toArray(new String [0]); // } diff --git a/ide/editor.lib2/src/org/netbeans/modules/editor/lib2/actions/EditorActionUtilities.java b/ide/editor.lib2/src/org/netbeans/modules/editor/lib2/actions/EditorActionUtilities.java index 68c9b2c77815..ff142413d796 100644 --- a/ide/editor.lib2/src/org/netbeans/modules/editor/lib2/actions/EditorActionUtilities.java +++ b/ide/editor.lib2/src/org/netbeans/modules/editor/lib2/actions/EditorActionUtilities.java @@ -127,7 +127,7 @@ static void updateButtonIcons(AbstractButton button, Icon icon, boolean useLarge String suffix = ""; int dotIndex; if ((dotIndex = iconResource.lastIndexOf('.')) >= 0) { - suffix = iconResource.substring(dotIndex, iconResource.length()); + suffix = iconResource.substring(dotIndex); base = iconResource.substring(0, dotIndex); } if (useLargeIcon) { @@ -166,7 +166,7 @@ static void updateButtonIcons(AbstractButton button, Icon icon, boolean useLarge static String insertBeforeSuffix(String path, String toInsert) { int dotIndex; if ((dotIndex = path.lastIndexOf('.')) >= 0) { - path = path.substring(0, dotIndex) + toInsert + path.substring(dotIndex, path.length()); + path = path.substring(0, dotIndex) + toInsert + path.substring(dotIndex); } else { path += toInsert; } diff --git a/ide/editor.util/src/org/netbeans/lib/editor/util/StringEscapeUtils.java b/ide/editor.util/src/org/netbeans/lib/editor/util/StringEscapeUtils.java index 22993df64258..dcf8e6a7c38c 100644 --- a/ide/editor.util/src/org/netbeans/lib/editor/util/StringEscapeUtils.java +++ b/ide/editor.util/src/org/netbeans/lib/editor/util/StringEscapeUtils.java @@ -82,7 +82,7 @@ public static String escapeHtml(String text) { if (builder == null) { return text; } else { - builder.append(text.substring(lastChange, text.length())); + builder.append(text.substring(lastChange)); return builder.toString(); } } diff --git a/ide/git/src/org/netbeans/modules/git/options/GitOptionsPanelController.java b/ide/git/src/org/netbeans/modules/git/options/GitOptionsPanelController.java index fb68a8ed0e9a..24a721b610f2 100644 --- a/ide/git/src/org/netbeans/modules/git/options/GitOptionsPanelController.java +++ b/ide/git/src/org/netbeans/modules/git/options/GitOptionsPanelController.java @@ -238,7 +238,7 @@ public void mouseClicked (MouseEvent e) { sb.append(annotation.substring(0, pos)); sb.append(variable); if (pos < annotation.length()) { - sb.append(annotation.substring(pos, annotation.length())); + sb.append(annotation.substring(pos)); } panel.txtProjectAnnotation.setText(sb.toString()); panel.txtProjectAnnotation.requestFocus(); diff --git a/ide/git/test/qa-functional/src/org/netbeans/test/git/utils/RepositoryMaintenance.java b/ide/git/test/qa-functional/src/org/netbeans/test/git/utils/RepositoryMaintenance.java index 835130e5e5a2..b79e7c505184 100644 --- a/ide/git/test/qa-functional/src/org/netbeans/test/git/utils/RepositoryMaintenance.java +++ b/ide/git/test/qa-functional/src/org/netbeans/test/git/utils/RepositoryMaintenance.java @@ -115,7 +115,7 @@ public static String changeFileSeparator(String path, boolean backed) { } } if (changedPath.startsWith("/")) { - changedPath = changedPath.substring(1, changedPath.length()); + changedPath = changedPath.substring(1); } return changedPath; } diff --git a/ide/html.editor.lib/src/org/netbeans/modules/html/editor/lib/api/elements/ElementUtils.java b/ide/html.editor.lib/src/org/netbeans/modules/html/editor/lib/api/elements/ElementUtils.java index 8b7b4c954b13..bb69b006f7ce 100644 --- a/ide/html.editor.lib/src/org/netbeans/modules/html/editor/lib/api/elements/ElementUtils.java +++ b/ide/html.editor.lib/src/org/netbeans/modules/html/editor/lib/api/elements/ElementUtils.java @@ -390,7 +390,7 @@ public static OpenTag query(Node base, String path, boolean caseInsensitive) { if (caseInsensitive) { nodeName = nodeName.toLowerCase(Locale.ENGLISH); } - String sindex = indexDelim >= 0 ? token.substring(indexDelim + 1, token.length()) : "0"; + String sindex = indexDelim >= 0 ? token.substring(indexDelim + 1) : "0"; int index = Integer.parseInt(sindex); int count = 0; diff --git a/ide/html.editor/src/org/netbeans/modules/html/editor/completion/HtmlPaletteCompletionProvider.java b/ide/html.editor/src/org/netbeans/modules/html/editor/completion/HtmlPaletteCompletionProvider.java index 16a151fa11da..0ea71a6d3aa8 100644 --- a/ide/html.editor/src/org/netbeans/modules/html/editor/completion/HtmlPaletteCompletionProvider.java +++ b/ide/html.editor/src/org/netbeans/modules/html/editor/completion/HtmlPaletteCompletionProvider.java @@ -135,7 +135,7 @@ public void run() { } } if (i > 0) { - prefix = prefix.substring(i, prefix.length()); + prefix = prefix.substring(i); } completionExpressionStartOffset = offset - prefix.length(); diff --git a/ide/mercurial/src/org/netbeans/modules/mercurial/options/MercurialOptionsPanelController.java b/ide/mercurial/src/org/netbeans/modules/mercurial/options/MercurialOptionsPanelController.java index 3ad5e4036d06..48874586d856 100644 --- a/ide/mercurial/src/org/netbeans/modules/mercurial/options/MercurialOptionsPanelController.java +++ b/ide/mercurial/src/org/netbeans/modules/mercurial/options/MercurialOptionsPanelController.java @@ -299,7 +299,7 @@ public void mouseClicked(MouseEvent e) { sb.append(annotation.substring(0, pos)); sb.append(variable); if(pos < annotation.length()) { - sb.append(annotation.substring(pos, annotation.length())); + sb.append(annotation.substring(pos)); } panel.annotationTextField.setText(sb.toString()); panel.annotationTextField.requestFocus(); diff --git a/ide/mercurial/test/qa-functional/src/org/netbeans/test/mercurial/utils/RepositoryMaintenance.java b/ide/mercurial/test/qa-functional/src/org/netbeans/test/mercurial/utils/RepositoryMaintenance.java index 15212aa4e94a..dac29ec516d0 100644 --- a/ide/mercurial/test/qa-functional/src/org/netbeans/test/mercurial/utils/RepositoryMaintenance.java +++ b/ide/mercurial/test/qa-functional/src/org/netbeans/test/mercurial/utils/RepositoryMaintenance.java @@ -117,7 +117,7 @@ public static String changeFileSeparator(String path, boolean backed) { } } if (changedPath.startsWith("/")) - changedPath = changedPath.substring(1, changedPath.length()); + changedPath = changedPath.substring(1); return changedPath; } } diff --git a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/MylynUtils.java b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/MylynUtils.java index eab43184abf4..687e4c1028de 100644 --- a/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/MylynUtils.java +++ b/ide/mylyn.util/src/org/netbeans/modules/mylyn/util/MylynUtils.java @@ -145,7 +145,7 @@ private static boolean dontUseHostName (String nonProxyHosts, String host) { dontUseProxy = host.startsWith(start) && host.endsWith(end); if(!dontUseProxy) { if(end.length() > 1 && end.charAt(0) == '.') { // NOI18N - end = end.substring(1, end.length()); + end = end.substring(1); } if(start.length() > 1 && start.charAt(start.length() - 1) == '.') { // NOI18N start = start.substring(0, start.length() - 1); diff --git a/ide/properties/src/org/netbeans/modules/properties/PropertiesParser.java b/ide/properties/src/org/netbeans/modules/properties/PropertiesParser.java index 9c7624aeea7a..7f073f6cd911 100644 --- a/ide/properties/src/org/netbeans/modules/properties/PropertiesParser.java +++ b/ide/properties/src/org/netbeans/modules/properties/PropertiesParser.java @@ -239,7 +239,7 @@ private Element.ItemElem readNextElem(PropertiesReader in) throws IOException { for(startIndex=0; startIndex < fl.line.length(); startIndex++) if(UtilConvert.whiteSpaceChars.indexOf(fl.line.charAt(startIndex)) == -1) break; - fl.stringValue = fl.line.substring(startIndex, fl.line.length()); + fl.stringValue = fl.line.substring(startIndex); fl.startPosition = nowPos + startIndex; lines.add(fl); } diff --git a/ide/schema2beans/src/org/netbeans/modules/schema2beans/DDRegistryParser.java b/ide/schema2beans/src/org/netbeans/modules/schema2beans/DDRegistryParser.java index 64178af1d252..4d8b79bf9daa 100644 --- a/ide/schema2beans/src/org/netbeans/modules/schema2beans/DDRegistryParser.java +++ b/ide/schema2beans/src/org/netbeans/modules/schema2beans/DDRegistryParser.java @@ -117,7 +117,7 @@ Object resolvePathVar(DDCursor cur, String path) { } if (path.indexOf('#') == 0 ) { - path = path.substring(1, path.length()); + path = path.substring(1); String remSuffix = null; int idx = path.indexOf('-'); @@ -427,7 +427,7 @@ void initialize(String path, DDRegistryParser regParser, DDCursor cursor) { graphName = path.substring(1, idx); if (path.length() > idx+1) - path = path.substring(idx+1, path.length()); + path = path.substring(idx+1); else path = "."; // NOI18N diff --git a/ide/schema2beans/src/org/netbeans/modules/schema2beans/DOMBinding.java b/ide/schema2beans/src/org/netbeans/modules/schema2beans/DOMBinding.java index 22e99cac139a..6639a7acd328 100644 --- a/ide/schema2beans/src/org/netbeans/modules/schema2beans/DOMBinding.java +++ b/ide/schema2beans/src/org/netbeans/modules/schema2beans/DOMBinding.java @@ -419,7 +419,7 @@ Object getValue(BeanProp prop) { localPart = ret; } else { prefix = ret.substring(0, colonPos); - localPart = ret.substring(colonPos+1, ret.length()); + localPart = ret.substring(colonPos+1); ns = findNamespace(prefix); } //System.out.println("localPart="+localPart+" ns="+ns+" prefix="+prefix); diff --git a/ide/schema2beans/src/org/netbeans/modules/schema2beans/QName.java b/ide/schema2beans/src/org/netbeans/modules/schema2beans/QName.java index 7567a29a5bd2..53a796aae8fe 100644 --- a/ide/schema2beans/src/org/netbeans/modules/schema2beans/QName.java +++ b/ide/schema2beans/src/org/netbeans/modules/schema2beans/QName.java @@ -96,7 +96,7 @@ public static QName valueOf(String asString) { return new QName(asString); } else { String ns = asString.substring(1, pos-1); - String localPart = asString.substring(pos+1, asString.length()); + String localPart = asString.substring(pos+1); return new QName(ns, localPart); } } diff --git a/ide/schema2beans/src/org/netbeans/modules/schema2beans/XMLUtil.java b/ide/schema2beans/src/org/netbeans/modules/schema2beans/XMLUtil.java index e8812342c028..a253f44dafe3 100644 --- a/ide/schema2beans/src/org/netbeans/modules/schema2beans/XMLUtil.java +++ b/ide/schema2beans/src/org/netbeans/modules/schema2beans/XMLUtil.java @@ -404,7 +404,7 @@ protected void write(Comment comment) throws java.io.IOException { while (pos >= 0) { out.write(text.substring(0, pos)); out.write("--"); - text = text.substring(pos+2, text.length()); + text = text.substring(pos+2); pos = text.indexOf("--"); } out.write(text); @@ -692,7 +692,7 @@ private static class XPathLocator public XPathLocator(String xpathExpr) { xpathExpr = xpathExpr.trim(); if (xpathExpr.startsWith("/")) - xpathExpr = xpathExpr.substring(1, xpathExpr.length()); + xpathExpr = xpathExpr.substring(1); this.xpathExpr = xpathExpr; xpathParts = xpathExpr.split("/"); // This is a bit too simple. partNum = 0; @@ -714,7 +714,7 @@ private void setElementName() { desiredElementName = desiredElementName.substring(0, startPos); //System.out.println("subExpr="+subExpr); if (subExpr.startsWith("position()=")) { - desiredPosition = Integer.parseInt(subExpr.substring(11, subExpr.length())); + desiredPosition = Integer.parseInt(subExpr.substring(11)); } else { boolean allDigits = subExpr.length() > 0; for (int i = 0; i < subExpr.length(); ++i) { @@ -731,7 +731,7 @@ private void setElementName() { } } else if (desiredElementName.startsWith("@")) { isAttribute = true; - desiredElementName = desiredElementName.substring(1, desiredElementName.length()); + desiredElementName = desiredElementName.substring(1); } //System.out.println("desiredElementName="+desiredElementName); } diff --git a/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/BeanBuilder.java b/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/BeanBuilder.java index e3dc8fcc19fd..f90706d25a0a 100644 --- a/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/BeanBuilder.java +++ b/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/BeanBuilder.java @@ -1093,9 +1093,9 @@ else if (token == "find") { throw new IllegalArgumentException(Common.getMessage("MSG_MissingOnExpression", finderExpr)); if (onExpr.startsWith("/"+rootName)) { - onExpr = onExpr.substring(rootName.length()+1, onExpr.length()); + onExpr = onExpr.substring(rootName.length()+1); if (onExpr.startsWith("/")) - onExpr = onExpr.substring(1, onExpr.length()); + onExpr = onExpr.substring(1); } //System.out.println("onExpr="+onExpr); GraphNode onNode = null; @@ -1403,7 +1403,7 @@ private void addToImplements(MetaElement e, String interfce) { impl = impl.trim(); if (impl.equals(interfce)) return; - implList = implList.substring(pos+1, implList.length()); + implList = implList.substring(pos+1); implList = implList.trim(); pos = implList.indexOf(','); } @@ -1432,7 +1432,7 @@ private void addToBeanInterfaceExtends(MetaElement e, String interfce) { impl = impl.trim(); if (impl.equals(interfce)) return; - implList = implList.substring(pos+1, implList.length()); + implList = implList.substring(pos+1); implList = implList.trim(); pos = implList.indexOf(','); } diff --git a/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/GraphLink.java b/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/GraphLink.java index 3f50361155d4..9374468b66ea 100644 --- a/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/GraphLink.java +++ b/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/GraphLink.java @@ -424,7 +424,7 @@ public Object next() { // Don't deal with namespaces int colonPos = step.indexOf(':'); if (colonPos >= 0) - step = step.substring(colonPos+1, step.length()); + step = step.substring(colonPos+1); //System.out.println("step="+step); // Now go look for step result = result.lookForChild(step); diff --git a/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/GraphNode.java b/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/GraphNode.java index e83cda92fc6e..86a23259097c 100644 --- a/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/GraphNode.java +++ b/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/GraphNode.java @@ -213,7 +213,7 @@ void setName(String name) { // separate out the namespace if (name.charAt(0) == '{') { int closingBracket = name.indexOf('}'); - this.name = name.substring(closingBracket+1, name.length()); + this.name = name.substring(closingBracket+1); this.namespace = name.substring(1, closingBracket); } else { this.name = name; diff --git a/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/JavaBeanClass.java b/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/JavaBeanClass.java index 702c75c5c893..343ceb3eabb3 100644 --- a/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/JavaBeanClass.java +++ b/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/JavaBeanClass.java @@ -3091,7 +3091,7 @@ protected void genUpdateNamespaces(String namespaceMapName, jw.writeEol("(", namespaceMapName, ")"); jw.end(); } - jw.writeEol("String attrNSPrefix = attrName.substring(6, attrName.length())"); + jw.writeEol("String attrNSPrefix = attrName.substring(6)"); jw.writeEol(namespaceMapName, ".put(attrNSPrefix, attr.getValue())"); jw.end(); jw.end(); diff --git a/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/S2bConfig.java b/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/S2bConfig.java index 88ab8f3f31ad..688e4b65f06f 100644 --- a/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/S2bConfig.java +++ b/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/S2bConfig.java @@ -2103,7 +2103,7 @@ public void readNode(org.w3c.dom.Node node, java.util.Map namespacePrefixes) { // Dup prefix map, so as to not write over previous values, and to make it easy to clear out our entries. namespacePrefixes = new java.util.HashMap(namespacePrefixes); } - String attrNSPrefix = attrName.substring(6, attrName.length()); + String attrNSPrefix = attrName.substring(6); namespacePrefixes.put(attrNSPrefix, attr.getValue()); } } diff --git a/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/SchemaRep.java b/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/SchemaRep.java index c1550fbb47c2..3f665649f925 100644 --- a/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/SchemaRep.java +++ b/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/SchemaRep.java @@ -5347,7 +5347,7 @@ public static String guessPrefix(String namespaceURI) { String prefix; int pos = namespaceURI.lastIndexOf('/'); if (pos >= 0) - prefix = namespaceURI.substring(pos+1, namespaceURI.length()); + prefix = namespaceURI.substring(pos+1); else prefix = namespaceURI; prefix = prefix.replace('#', '_').replace('\'', '_').replace('"', '_'). diff --git a/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/beangraph/BeanGraph.java b/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/beangraph/BeanGraph.java index a871e7d97c9c..d4d140e238e7 100644 --- a/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/beangraph/BeanGraph.java +++ b/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/beangraph/BeanGraph.java @@ -309,7 +309,7 @@ public void readNode(org.w3c.dom.Node node, java.util.Map namespacePrefixes) { // Dup prefix map, so as to not write over previous values, and to make it easy to clear out our entries. namespacePrefixes = new java.util.HashMap(namespacePrefixes); } - String attrNSPrefix = attrName.substring(6, attrName.length()); + String attrNSPrefix = attrName.substring(6); namespacePrefixes.put(attrNSPrefix, attr.getValue()); } } diff --git a/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/beangraph/SchemaTypeMappingType.java b/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/beangraph/SchemaTypeMappingType.java index a852ef0d0d41..f22c70df4c3b 100644 --- a/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/beangraph/SchemaTypeMappingType.java +++ b/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/beangraph/SchemaTypeMappingType.java @@ -248,7 +248,7 @@ public void readNode(org.w3c.dom.Node node, java.util.Map namespacePrefixes) { // Dup prefix map, so as to not write over previous values, and to make it easy to clear out our entries. namespacePrefixes = new java.util.HashMap(namespacePrefixes); } - String attrNSPrefix = attrName.substring(6, attrName.length()); + String attrNSPrefix = attrName.substring(6); namespacePrefixes.put(attrNSPrefix, attr.getValue()); } } diff --git a/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/gen/JavaUtil.java b/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/gen/JavaUtil.java index 69348345cb2f..9dcecf51a501 100644 --- a/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/gen/JavaUtil.java +++ b/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/gen/JavaUtil.java @@ -821,7 +821,7 @@ public static String baseName(String fullClassName) { int pos = fullClassName.lastIndexOf('.'); if (pos == -1) return fullClassName; - return fullClassName.substring(pos+1, fullClassName.length()); + return fullClassName.substring(pos+1); } private static final Class charArrayClass = diff --git a/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/metadd/MetaDD.java b/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/metadd/MetaDD.java index 2a35c397fc33..5a2624e9c0a4 100644 --- a/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/metadd/MetaDD.java +++ b/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/metadd/MetaDD.java @@ -576,7 +576,7 @@ public void readNode(org.w3c.dom.Node node, java.util.Map namespacePrefixes) { // Dup prefix map, so as to not write over previous values, and to make it easy to clear out our entries. namespacePrefixes = new java.util.HashMap(namespacePrefixes); } - String attrNSPrefix = attrName.substring(6, attrName.length()); + String attrNSPrefix = attrName.substring(6); namespacePrefixes.put(attrNSPrefix, attr.getValue()); } } diff --git a/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/metadd/MetaElement.java b/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/metadd/MetaElement.java index 259b8356e557..701768b1d5c7 100644 --- a/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/metadd/MetaElement.java +++ b/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/metadd/MetaElement.java @@ -744,7 +744,7 @@ public void readNode(org.w3c.dom.Node node, java.util.Map namespacePrefixes) { // Dup prefix map, so as to not write over previous values, and to make it easy to clear out our entries. namespacePrefixes = new java.util.HashMap(namespacePrefixes); } - String attrNSPrefix = attrName.substring(6, attrName.length()); + String attrNSPrefix = attrName.substring(6); namespacePrefixes.put(attrNSPrefix, attr.getValue()); } } diff --git a/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/metadd/MetaProperty.java b/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/metadd/MetaProperty.java index b74a3b8c2860..b3007735de2c 100644 --- a/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/metadd/MetaProperty.java +++ b/ide/schema2beans/src/org/netbeans/modules/schema2beansdev/metadd/MetaProperty.java @@ -317,7 +317,7 @@ public void readNode(org.w3c.dom.Node node, java.util.Map namespacePrefixes) { // Dup prefix map, so as to not write over previous values, and to make it easy to clear out our entries. namespacePrefixes = new java.util.HashMap(namespacePrefixes); } - String attrNSPrefix = attrName.substring(6, attrName.length()); + String attrNSPrefix = attrName.substring(6); namespacePrefixes.put(attrNSPrefix, attr.getValue()); } } diff --git a/ide/subversion/src/org/netbeans/modules/subversion/options/SvnOptionsController.java b/ide/subversion/src/org/netbeans/modules/subversion/options/SvnOptionsController.java index 4f871b62c64e..2d36291df2fd 100644 --- a/ide/subversion/src/org/netbeans/modules/subversion/options/SvnOptionsController.java +++ b/ide/subversion/src/org/netbeans/modules/subversion/options/SvnOptionsController.java @@ -450,7 +450,7 @@ public void mouseClicked(MouseEvent e) { sb.append(annotation.substring(0, pos)); sb.append(variable); if(pos < annotation.length()) { - sb.append(annotation.substring(pos, annotation.length())); + sb.append(annotation.substring(pos)); } panel.annotationTextField.setText(sb.toString()); panel.annotationTextField.requestFocus(); diff --git a/ide/subversion/src/org/netbeans/modules/subversion/ui/history/RepositoryRevision.java b/ide/subversion/src/org/netbeans/modules/subversion/ui/history/RepositoryRevision.java index 8f7c78aa6c88..5c6d6637cb4a 100644 --- a/ide/subversion/src/org/netbeans/modules/subversion/ui/history/RepositoryRevision.java +++ b/ide/subversion/src/org/netbeans/modules/subversion/ui/history/RepositoryRevision.java @@ -439,7 +439,7 @@ protected void perform () { for (File f : selectionRoots) { String p = SvnUtils.getRelativePath(f); if (p != null && p.startsWith("/")) { //NOI18N - p = p.substring(1, p.length()); + p = p.substring(1); } messages = client.getLogMessages(repositoryRootUrl.appendPath(p), pegRevisions.get(p), message.getRevision(), message.getRevision(), false, true, 0); diff --git a/ide/subversion/src/org/netbeans/modules/subversion/ui/history/SearchExecutor.java b/ide/subversion/src/org/netbeans/modules/subversion/ui/history/SearchExecutor.java index aa5f1a8a40e1..720548e5f111 100644 --- a/ide/subversion/src/org/netbeans/modules/subversion/ui/history/SearchExecutor.java +++ b/ide/subversion/src/org/netbeans/modules/subversion/ui/history/SearchExecutor.java @@ -211,7 +211,7 @@ private void search(SVNUrl rootUrl, Set files, SVNRevision fromRevision, S ISVNInfo info = client.getInfoFromWorkingCopy(file); String p = SvnUtils.getRelativePath(file); if(p != null && p.startsWith("/")) { - p = p.substring(1, p.length()); + p = p.substring(1); } paths[idx++] = p; if (info != null && info.getRevision() != null) { diff --git a/ide/subversion/test/qa-functional/src/org/netbeans/test/subversion/utils/RepositoryMaintenance.java b/ide/subversion/test/qa-functional/src/org/netbeans/test/subversion/utils/RepositoryMaintenance.java index a7e8cc639b47..336234955d67 100644 --- a/ide/subversion/test/qa-functional/src/org/netbeans/test/subversion/utils/RepositoryMaintenance.java +++ b/ide/subversion/test/qa-functional/src/org/netbeans/test/subversion/utils/RepositoryMaintenance.java @@ -129,7 +129,7 @@ public static String changeFileSeparator(String path, boolean backed) { } } if (changedPath.startsWith("/")) - changedPath = changedPath.substring(1, changedPath.length()); + changedPath = changedPath.substring(1); return changedPath; } diff --git a/ide/subversion/test/unit/src/org/netbeans/modules/subversion/AbstractSvnTestCase.java b/ide/subversion/test/unit/src/org/netbeans/modules/subversion/AbstractSvnTestCase.java index b15b8b4d9731..5007c31c6e97 100644 --- a/ide/subversion/test/unit/src/org/netbeans/modules/subversion/AbstractSvnTestCase.java +++ b/ide/subversion/test/unit/src/org/netbeans/modules/subversion/AbstractSvnTestCase.java @@ -76,7 +76,7 @@ public AbstractSvnTestCase(String testName) throws MalformedURLException, SVNCli repoDir = new File(getDataDir().getAbsolutePath() + "/repo"); repoPath = repoDir.getAbsolutePath(); if(repoPath.startsWith("/")) { - //repoPath = repoPath.substring(1, repoPath.length()); + //repoPath = repoPath.substring(1); } wc = new File(workDir, getName() + "_wc"); diff --git a/ide/subversion/test/unit/src/org/netbeans/modules/subversion/InteceptorTest.java b/ide/subversion/test/unit/src/org/netbeans/modules/subversion/InteceptorTest.java index 0cdff922cb74..0e70438b4e2b 100644 --- a/ide/subversion/test/unit/src/org/netbeans/modules/subversion/InteceptorTest.java +++ b/ide/subversion/test/unit/src/org/netbeans/modules/subversion/InteceptorTest.java @@ -91,7 +91,7 @@ protected void setUp() throws Exception { wc2 = new File(dataRootDir, getName() + "_wc2"); repoDir = new File(dataRootDir, "repo"); String repoPath = repoDir.getAbsolutePath(); - if(repoPath.startsWith("/")) repoPath = repoPath.substring(1, repoPath.length()); + if(repoPath.startsWith("/")) repoPath = repoPath.substring(1); repoUrl = new SVNUrl("file:///" + repoPath); repo2Dir = new File(dataRootDir, "repo2"); diff --git a/ide/subversion/test/unit/src/org/netbeans/modules/subversion/api/SearchHistoryTest.java b/ide/subversion/test/unit/src/org/netbeans/modules/subversion/api/SearchHistoryTest.java index 074b07fec6de..f8bf9195312a 100644 --- a/ide/subversion/test/unit/src/org/netbeans/modules/subversion/api/SearchHistoryTest.java +++ b/ide/subversion/test/unit/src/org/netbeans/modules/subversion/api/SearchHistoryTest.java @@ -61,7 +61,7 @@ protected void setUp() throws Exception { wc = new File(dataRootDir, getName() + "_wc"); repoDir = new File(dataRootDir, "repo"); String repoPath = repoDir.getAbsolutePath(); - if(repoPath.startsWith("/")) repoPath = repoPath.substring(1, repoPath.length()); + if(repoPath.startsWith("/")) repoPath = repoPath.substring(1); repoUrl = new SVNUrl("file:///" + repoPath); System.setProperty("netbeans.user", System.getProperty("data.root.dir") + "/cache"); diff --git a/ide/subversion/test/unit/src/org/netbeans/modules/subversion/ui/diff/RevisionSetupSupportTest.java b/ide/subversion/test/unit/src/org/netbeans/modules/subversion/ui/diff/RevisionSetupSupportTest.java index 2b3bcdd66d00..84214d5bc078 100644 --- a/ide/subversion/test/unit/src/org/netbeans/modules/subversion/ui/diff/RevisionSetupSupportTest.java +++ b/ide/subversion/test/unit/src/org/netbeans/modules/subversion/ui/diff/RevisionSetupSupportTest.java @@ -63,7 +63,7 @@ protected void setUp () throws Exception { wc = new File(workDir, getName() + "_wc"); repoDir = new File(workDir, "repo"); String repoPath = repoDir.getAbsolutePath(); - if(repoPath.startsWith("/")) repoPath = repoPath.substring(1, repoPath.length()); + if(repoPath.startsWith("/")) repoPath = repoPath.substring(1); repoUrl = new SVNUrl("file:///" + repoPath); System.setProperty("netbeans.user", getDataDir() + "/userdir"); diff --git a/ide/versioning.core/test/unit/src/org/netbeans/modules/versioning/VCSInterceptorTestCase.java b/ide/versioning.core/test/unit/src/org/netbeans/modules/versioning/VCSInterceptorTestCase.java index 54076ee57973..13b82928c33f 100644 --- a/ide/versioning.core/test/unit/src/org/netbeans/modules/versioning/VCSInterceptorTestCase.java +++ b/ide/versioning.core/test/unit/src/org/netbeans/modules/versioning/VCSInterceptorTestCase.java @@ -642,7 +642,7 @@ private String getRelativePath(VCSFileProxy proxy) throws IOException { if(rootPath != null) { path = path.substring(rootPath.length()); if(path.startsWith("/")) { - path = path.substring(1, path.length()); + path = path.substring(1); } return path; } else { @@ -652,7 +652,7 @@ private String getRelativePath(VCSFileProxy proxy) throws IOException { // String path = proxy.getPath(); // path = path.substring(factory.getRootPath().length()); // if(path.startsWith("/")) { -// path = path.substring(1, path.length()); +// path = path.substring(1); // } // return path; } @@ -664,7 +664,7 @@ private String getWorkdirRelativePath(VCSFileProxy proxy) throws IOException { rootPath = rootPath + "/" + workDirPath; path = path.substring(rootPath.length()); if(path.startsWith("/")) { - path = path.substring(1, path.length()); + path = path.substring(1); } return path; } else { diff --git a/ide/versioning.ui/src/org/netbeans/modules/versioning/ui/history/HistoryComponent.java b/ide/versioning.ui/src/org/netbeans/modules/versioning/ui/history/HistoryComponent.java index 845eb494715b..73fac946576c 100644 --- a/ide/versioning.ui/src/org/netbeans/modules/versioning/ui/history/HistoryComponent.java +++ b/ide/versioning.ui/src/org/netbeans/modules/versioning/ui/history/HistoryComponent.java @@ -1053,7 +1053,7 @@ private String getFilteredRendererValue(String value) { endIdx = value.indexOf(contains, startIdx); } if(startIdx < value.length()) { - String t = value.substring(startIdx, value.length()); + String t = value.substring(startIdx); sb.append(HistoryUtils.escapeForHTMLLabel(t)); } return sb.toString(); diff --git a/ide/versioning.ui/src/org/netbeans/modules/versioning/ui/history/HistoryFileView.java b/ide/versioning.ui/src/org/netbeans/modules/versioning/ui/history/HistoryFileView.java index 6611cb4c26d2..d608888a623a 100644 --- a/ide/versioning.ui/src/org/netbeans/modules/versioning/ui/history/HistoryFileView.java +++ b/ide/versioning.ui/src/org/netbeans/modules/versioning/ui/history/HistoryFileView.java @@ -1033,7 +1033,7 @@ private String addHyperlink(String s, int[] spans) { sb.append(s.substring(start, end)); if(i == spans.length) { sb.append(""); // NOI18N - sb.append(s.substring(end, s.length())); + sb.append(s.substring(end)); } } return sb.toString(); diff --git a/ide/versioning.util/src/org/netbeans/modules/versioning/history/SummaryCellRenderer.java b/ide/versioning.util/src/org/netbeans/modules/versioning/history/SummaryCellRenderer.java index 7ec665c273ca..71ffe92ca8ba 100644 --- a/ide/versioning.util/src/org/netbeans/modules/versioning/history/SummaryCellRenderer.java +++ b/ide/versioning.util/src/org/netbeans/modules/versioning/history/SummaryCellRenderer.java @@ -787,7 +787,7 @@ public Component getListCellRendererComponent (JList list, Object value, int ind } else { ++idx; sb.append("").append(path.substring(0, idx)).append(""); //NOI18N - sb.append(path.substring(idx, path.length())); + sb.append(path.substring(idx)); } } pathLabel.setText(sb.append("").toString()); //NOI18N diff --git a/ide/versioning.util/src/org/netbeans/modules/versioning/util/VCSNotificationDisplayer.java b/ide/versioning.util/src/org/netbeans/modules/versioning/util/VCSNotificationDisplayer.java index 1acf4e49eb61..23507970bc92 100644 --- a/ide/versioning.util/src/org/netbeans/modules/versioning/util/VCSNotificationDisplayer.java +++ b/ide/versioning.util/src/org/netbeans/modules/versioning/util/VCSNotificationDisplayer.java @@ -52,7 +52,7 @@ public abstract class VCSNotificationDisplayer { */ protected String trim(String str) { if (str.startsWith("/")) { - str = str.substring(1, str.length()); + str = str.substring(1); } if (str.endsWith("/")) { str = str.substring(0, str.length() - 1); diff --git a/ide/xml.schema.completion/src/org/netbeans/modules/xml/schema/completion/util/CompletionUtil.java b/ide/xml.schema.completion/src/org/netbeans/modules/xml/schema/completion/util/CompletionUtil.java index 69218b83c22b..d266aa35a12d 100644 --- a/ide/xml.schema.completion/src/org/netbeans/modules/xml/schema/completion/util/CompletionUtil.java +++ b/ide/xml.schema.completion/src/org/netbeans/modules/xml/schema/completion/util/CompletionUtil.java @@ -865,7 +865,7 @@ public static DocRoot getDocRoot(Document document) { if(nextToken.id() == XMLTokenId.TAG) { String tagName = nextToken.text().toString(); if(name == null && tagName.startsWith("<")) - name = tagName.substring(1, tagName.length()); + name = tagName.substring(1); String lastAttrName = null; while(ts.moveNext() ) { Token t = ts.token(); diff --git a/ide/xml.text/src/org/netbeans/modules/xml/text/completion/XMLCompletionQuery.java b/ide/xml.text/src/org/netbeans/modules/xml/text/completion/XMLCompletionQuery.java index d8ed132e2bfd..e3135696011c 100644 --- a/ide/xml.text/src/org/netbeans/modules/xml/text/completion/XMLCompletionQuery.java +++ b/ide/xml.text/src/org/netbeans/modules/xml/text/completion/XMLCompletionQuery.java @@ -444,7 +444,7 @@ private static String shouldCloseTagLocked(TokenSequence ts) { return null; } // tag name does not include end sharp brace - tagName = tagName.substring(1, tagName.length()).trim(); + tagName = tagName.substring(1).trim(); if (isClosingEndTagFoundAfter(offset, ts, tagName)) { // I know, there may be multiple levels of the same tag name, and the innermost may // be missing... diff --git a/ide/xml.text/src/org/netbeans/modules/xml/text/navigator/TreeNodeAdapter.java b/ide/xml.text/src/org/netbeans/modules/xml/text/navigator/TreeNodeAdapter.java index bc8c5acac541..9a4a43e54cbb 100644 --- a/ide/xml.text/src/org/netbeans/modules/xml/text/navigator/TreeNodeAdapter.java +++ b/ide/xml.text/src/org/netbeans/modules/xml/text/navigator/TreeNodeAdapter.java @@ -259,7 +259,7 @@ private String getCDATAText() { String cdataStart = " 0 && documentText.contains(cdataStart)) - documentText = documentText.substring(cdataStart.length(), documentText.length()).trim(); + documentText = documentText.substring(cdataStart.length()).trim(); if(documentText.length() > 0 && documentText.contains(cdataEnd)) documentText = documentText.substring(0, documentText.indexOf(cdataEnd)).trim(); } catch(Exception e) { diff --git a/ide/xml.text/src/org/netbeans/modules/xml/text/syntax/javacc/ParseException.java b/ide/xml.text/src/org/netbeans/modules/xml/text/syntax/javacc/ParseException.java index ae7de2210e40..cf7eb7c62dfd 100644 --- a/ide/xml.text/src/org/netbeans/modules/xml/text/syntax/javacc/ParseException.java +++ b/ide/xml.text/src/org/netbeans/modules/xml/text/syntax/javacc/ParseException.java @@ -198,7 +198,7 @@ protected String add_escapes(String str) { default: if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); + retval.append("\\u" + s.substring(s.length() - 4)); } else { retval.append(ch); } diff --git a/ide/xml.text/src/org/netbeans/modules/xml/text/syntax/javacc/TokenMgrError.java b/ide/xml.text/src/org/netbeans/modules/xml/text/syntax/javacc/TokenMgrError.java index 7a2cfad3f23e..229af639222e 100644 --- a/ide/xml.text/src/org/netbeans/modules/xml/text/syntax/javacc/TokenMgrError.java +++ b/ide/xml.text/src/org/netbeans/modules/xml/text/syntax/javacc/TokenMgrError.java @@ -91,7 +91,7 @@ protected static final String addEscapes(String str) { default: if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); + retval.append("\\u" + s.substring(s.length() - 4)); } else { retval.append(ch); } diff --git a/ide/xml.text/src/org/netbeans/modules/xml/text/syntax/javacc/lib/CharStream.java b/ide/xml.text/src/org/netbeans/modules/xml/text/syntax/javacc/lib/CharStream.java index 2a16389a4dac..c34468e63956 100644 --- a/ide/xml.text/src/org/netbeans/modules/xml/text/syntax/javacc/lib/CharStream.java +++ b/ide/xml.text/src/org/netbeans/modules/xml/text/syntax/javacc/lib/CharStream.java @@ -113,7 +113,7 @@ public interface CharStream { * * { * String t = GetImage(); - * return t.substring(t.length() - len, t.length()).toCharArray(); + * return t.substring(t.length() - len).toCharArray(); * } */ public abstract char[] GetSuffix(int len); diff --git a/ide/xml.text/src/org/netbeans/modules/xml/text/syntax/javacc/lib/StringParserInput.java b/ide/xml.text/src/org/netbeans/modules/xml/text/syntax/javacc/lib/StringParserInput.java index 212a4dc8ed96..46c9bdd78f99 100644 --- a/ide/xml.text/src/org/netbeans/modules/xml/text/syntax/javacc/lib/StringParserInput.java +++ b/ide/xml.text/src/org/netbeans/modules/xml/text/syntax/javacc/lib/StringParserInput.java @@ -169,7 +169,7 @@ public int getLength() { * * { * String t = GetImage(); - * return t.substring(t.length() - len, t.length()).toCharArray(); + * return t.substring(t.length() - len).toCharArray(); * } */ public char[] GetSuffix(int l) { diff --git a/ide/xml.wsdl.model/src/org/netbeans/modules/xml/wsdl/model/extensions/http/validation/HTTPComponentValidator.java b/ide/xml.wsdl.model/src/org/netbeans/modules/xml/wsdl/model/extensions/http/validation/HTTPComponentValidator.java index 01f96bcd9cf9..2f3947e96272 100644 --- a/ide/xml.wsdl.model/src/org/netbeans/modules/xml/wsdl/model/extensions/http/validation/HTTPComponentValidator.java +++ b/ide/xml.wsdl.model/src/org/netbeans/modules/xml/wsdl/model/extensions/http/validation/HTTPComponentValidator.java @@ -418,12 +418,12 @@ private boolean isValidAddressToken(String tokenString) { boolean isValidToken = true; if(tokenString.startsWith("http://")) { //strip off the protocol stuff - tokenString = tokenString.substring(7, tokenString.length()); + tokenString = tokenString.substring(7); containsProtocolInfo = true; } if(tokenString.startsWith("https://")) { //strip off the protocol stuff - tokenString = tokenString.substring(8, tokenString.length()); + tokenString = tokenString.substring(8); containsProtocolInfo = true; } //No protocol info, it better be of the format ${URL} @@ -443,7 +443,7 @@ private boolean isValidAddressToken(String tokenString) { //Context separator / exists. if(indexOfContextSeparator != -1) { //The token is in the context. - String context = tokenString.substring(indexOfContextSeparator+1, tokenString.length()); + String context = tokenString.substring(indexOfContextSeparator+1); int indexOfContextTokenStart = context.indexOf("${"); if(indexOfContextTokenStart == 0) { int indexOfTokenEnd = context.indexOf("}"); diff --git a/ide/xml.wsdl.model/src/org/netbeans/modules/xml/wsdl/model/extensions/soap/validation/SOAPComponentVisitor.java b/ide/xml.wsdl.model/src/org/netbeans/modules/xml/wsdl/model/extensions/soap/validation/SOAPComponentVisitor.java index e78f4a24ede5..fd091dc900a0 100644 --- a/ide/xml.wsdl.model/src/org/netbeans/modules/xml/wsdl/model/extensions/soap/validation/SOAPComponentVisitor.java +++ b/ide/xml.wsdl.model/src/org/netbeans/modules/xml/wsdl/model/extensions/soap/validation/SOAPComponentVisitor.java @@ -690,12 +690,12 @@ private boolean isValidSoapAddressToken(String tokenString) { boolean isValidToken = true; if(tokenString.startsWith("http://")) { //strip off the protocol stuff - tokenString = tokenString.substring(7, tokenString.length()); + tokenString = tokenString.substring(7); containsProtocolInfo = true; } if(tokenString.startsWith("https://")) { //strip off the protocol stuff - tokenString = tokenString.substring(8, tokenString.length()); + tokenString = tokenString.substring(8); containsProtocolInfo = true; } //No protocol info, it better be of the format ${URL} @@ -715,7 +715,7 @@ private boolean isValidSoapAddressToken(String tokenString) { //Context separator / exists. if(indexOfContextSeparator != -1) { //The token is in the context. - String context = tokenString.substring(indexOfContextSeparator+1, tokenString.length()); + String context = tokenString.substring(indexOfContextSeparator+1); int indexOfContextTokenStart = context.indexOf("${"); if(indexOfContextTokenStart == 0) { int indexOfTokenEnd = context.indexOf("}"); diff --git a/ide/xml.wsdl.model/src/org/netbeans/modules/xml/wsdl/model/extensions/soap12/validation/SOAP12ComponentVisitor.java b/ide/xml.wsdl.model/src/org/netbeans/modules/xml/wsdl/model/extensions/soap12/validation/SOAP12ComponentVisitor.java index 49a13c22ef6d..ff68fa6d915b 100644 --- a/ide/xml.wsdl.model/src/org/netbeans/modules/xml/wsdl/model/extensions/soap12/validation/SOAP12ComponentVisitor.java +++ b/ide/xml.wsdl.model/src/org/netbeans/modules/xml/wsdl/model/extensions/soap12/validation/SOAP12ComponentVisitor.java @@ -718,12 +718,12 @@ private boolean isValidSoapAddressToken(String tokenString) { boolean isValidToken = true; if(tokenString.startsWith("http://")) { //strip off the protocol stuff - tokenString = tokenString.substring(7, tokenString.length()); + tokenString = tokenString.substring(7); containsProtocolInfo = true; } if(tokenString.startsWith("https://")) { //strip off the protocol stuff - tokenString = tokenString.substring(8, tokenString.length()); + tokenString = tokenString.substring(8); containsProtocolInfo = true; } //No protocol info, it better be of the format ${URL} @@ -743,7 +743,7 @@ private boolean isValidSoapAddressToken(String tokenString) { //Context separator / exists. if(indexOfContextSeparator != -1) { //The token is in the context. - String context = tokenString.substring(indexOfContextSeparator+1, tokenString.length()); + String context = tokenString.substring(indexOfContextSeparator+1); int indexOfContextTokenStart = context.indexOf("${"); if(indexOfContextTokenStart == 0) { int indexOfTokenEnd = context.indexOf("}"); diff --git a/ide/xml/test/qa-lib/src/org/netbeans/tests/xml/AbstractTestUtil.java b/ide/xml/test/qa-lib/src/org/netbeans/tests/xml/AbstractTestUtil.java index ae957efc1a10..bfa20ab24acc 100644 --- a/ide/xml/test/qa-lib/src/org/netbeans/tests/xml/AbstractTestUtil.java +++ b/ide/xml/test/qa-lib/src/org/netbeans/tests/xml/AbstractTestUtil.java @@ -102,7 +102,7 @@ public static String replaceString(String original, String begin, String end, St if (bi < 0 || ei < 0) { return original; } else { - return original.substring(0, bi) + replaceTo + original.substring(ei, original.length()); + return original.substring(0, bi) + replaceTo + original.substring(ei); } } diff --git a/java/dbschema/src/org/netbeans/modules/dbschema/migration/archiver/MapClassName.java b/java/dbschema/src/org/netbeans/modules/dbschema/migration/archiver/MapClassName.java index 826cef4e0e92..d7947032940c 100644 --- a/java/dbschema/src/org/netbeans/modules/dbschema/migration/archiver/MapClassName.java +++ b/java/dbschema/src/org/netbeans/modules/dbschema/migration/archiver/MapClassName.java @@ -29,7 +29,7 @@ public class MapClassName { public static String getClassNameToken(String realClassName){ if (realClassName.startsWith(CURRENTPREFIX)){ - realClassName = LEGACYPREFIX + realClassName.substring(CURRENTPREFIX.length(),realClassName.length()); + realClassName = LEGACYPREFIX + realClassName.substring(CURRENTPREFIX.length()); } return realClassName; @@ -37,7 +37,7 @@ public static String getClassNameToken(String realClassName){ public static String getRealClassName(String token){ if (token.startsWith(LEGACYPREFIX)){ - token = CURRENTPREFIX + token.substring(LEGACYPREFIX.length(),token.length()); + token = CURRENTPREFIX + token.substring(LEGACYPREFIX.length()); } return token; } diff --git a/java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/models/NumericDisplayFilter.java b/java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/models/NumericDisplayFilter.java index db88383a205b..d48481799c5a 100644 --- a/java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/models/NumericDisplayFilter.java +++ b/java/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/models/NumericDisplayFilter.java @@ -220,11 +220,11 @@ private Object getValue (Variable var, NumericDisplaySettings settings) { else if ("short".equals (type)) { String rv = Integer.toHexString(Short.parseShort(var.getValue())); - if (rv.length() > 4) rv = rv.substring(rv.length() - 4, rv.length()); + if (rv.length() > 4) rv = rv.substring(rv.length() - 4); return "0x" + rv; } else if ("byte".equals(type)) { String rv = Integer.toHexString(Byte.parseByte(var.getValue())); - if (rv.length() > 2) rv = rv.substring(rv.length() - 2, rv.length()); + if (rv.length() > 2) rv = rv.substring(rv.length() - 2); return "0x" + rv; } else if ("char".equals(type)) { int c = getChar(var.getValue()); @@ -264,11 +264,11 @@ private Object getValue (Variable var, NumericDisplaySettings settings) { return Integer.toBinaryString(Integer.parseInt(var.getValue())); else if ("short".equals(type)) { String rv = Integer.toBinaryString(Short.parseShort(var.getValue())); - if (rv.length() > 16) rv = rv.substring(rv.length() - 16, rv.length()); + if (rv.length() > 16) rv = rv.substring(rv.length() - 16); return rv; } else if ("byte".equals(type)) { String rv = Integer.toBinaryString(Byte.parseByte(var.getValue())); - if (rv.length() > 8) rv = rv.substring(rv.length() - 8, rv.length()); + if (rv.length() > 8) rv = rv.substring(rv.length() - 8); return rv; } else if ("char".equals(type)) { int c = getChar(var.getValue()); diff --git a/java/form/src/org/netbeans/modules/form/editors/MnemonicEditor.java b/java/form/src/org/netbeans/modules/form/editors/MnemonicEditor.java index bea656398c94..fbcd943b302a 100644 --- a/java/form/src/org/netbeans/modules/form/editors/MnemonicEditor.java +++ b/java/form/src/org/netbeans/modules/form/editors/MnemonicEditor.java @@ -94,7 +94,7 @@ public void setAsText(String text) throws IllegalArgumentException { case 'r': value = '\r'; break; case '\\': value = '\\' ; break; case 'u' : - String num = text.substring(2,text.length()); + String num = text.substring(2); if (num.length () > 4) { // ignore longer strings return; diff --git a/java/form/src/org/netbeans/modules/form/editors2/CustomTableModelEditor.java b/java/form/src/org/netbeans/modules/form/editors2/CustomTableModelEditor.java index 561889fd8a63..dd8c3e2891f4 100644 --- a/java/form/src/org/netbeans/modules/form/editors2/CustomTableModelEditor.java +++ b/java/form/src/org/netbeans/modules/form/editors2/CustomTableModelEditor.java @@ -956,7 +956,7 @@ void updateSettingsTable() { String type = model.getColumnClass(i).getName(); int lastDot = type.lastIndexOf('.'); if (lastDot >= 0) - type = type.substring(lastDot+1, type.length()); + type = type.substring(lastDot+1); titleModel.setValueAt(type, i,2); titleModel.setValueAt(model.isColumnEditable(i) ? Boolean.TRUE : Boolean.FALSE, i,3); } diff --git a/java/java.editor/src/org/netbeans/modules/java/editor/javadoc/JavadocCompletionTask.java b/java/java.editor/src/org/netbeans/modules/java/editor/javadoc/JavadocCompletionTask.java index 3e0e5c4c9385..17ea983d34d4 100644 --- a/java/java.editor/src/org/netbeans/modules/java/editor/javadoc/JavadocCompletionTask.java +++ b/java/java.editor/src/org/netbeans/modules/java/editor/javadoc/JavadocCompletionTask.java @@ -569,7 +569,7 @@ private boolean containsParam(List blockTags, String name) { private void completeTypeVarName(Element forElement, String prefix, int substitutionOffset) { if (prefix.length() > 0) { if (prefix.charAt(0) == '<') { - prefix = prefix.substring(1, prefix.length()); + prefix = prefix.substring(1); } else { // not type param return; diff --git a/java/java.hints.declarative/test/unit/src/org/netbeans/modules/java/hints/declarative/debugging/EvaluationSpanTaskTest.java b/java/java.hints.declarative/test/unit/src/org/netbeans/modules/java/hints/declarative/debugging/EvaluationSpanTaskTest.java index cc42c0ff2bc2..a635e27fb034 100644 --- a/java/java.hints.declarative/test/unit/src/org/netbeans/modules/java/hints/declarative/debugging/EvaluationSpanTaskTest.java +++ b/java/java.hints.declarative/test/unit/src/org/netbeans/modules/java/hints/declarative/debugging/EvaluationSpanTaskTest.java @@ -133,7 +133,7 @@ private void performTest(String code, String hintSpec) throws Exception { lastStart = m.end(); } - sb.append(hintSpec.substring(lastStart, hintSpec.length())); + sb.append(hintSpec.substring(lastStart)); String[] codeSplit = code.split("\\|"); diff --git a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/Utils.java b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/Utils.java index 84b39700be35..08c637304ac9 100644 --- a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/Utils.java +++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/Utils.java @@ -374,7 +374,7 @@ public static String escapeCompletionSnippetSpecialChars(String text) { i += 1; } if (replaced != null) { - replaced.append(text.substring(lastPos, text.length())); + replaced.append(text.substring(lastPos)); text = replaced.toString(); } replaced = null; diff --git a/java/javadoc/src/org/netbeans/modules/javadoc/search/IndexBuilder.java b/java/javadoc/src/org/netbeans/modules/javadoc/search/IndexBuilder.java index 110e740396df..175ff5883335 100644 --- a/java/javadoc/src/org/netbeans/modules/javadoc/search/IndexBuilder.java +++ b/java/javadoc/src/org/netbeans/modules/javadoc/search/IndexBuilder.java @@ -215,7 +215,7 @@ private void refreshIndex() { if (filename.length() > 54) { // trim to display 54 chars filename = filename.substring(0, 10) + "[...]" // NOI18N - + filename.substring(filename.length() - 40, filename.length()); + + filename.substring(filename.length() - 40); } title = NbBundle.getMessage(IndexBuilder.class, "FMT_NoOverviewTitle", new Object[] { filename }); // NOI18N diff --git a/java/javadoc/src/org/netbeans/modules/javadoc/search/SearchThreadJdk12.java b/java/javadoc/src/org/netbeans/modules/javadoc/search/SearchThreadJdk12.java index 723207650ad1..78c472619852 100644 --- a/java/javadoc/src/org/netbeans/modules/javadoc/search/SearchThreadJdk12.java +++ b/java/javadoc/src/org/netbeans/modules/javadoc/search/SearchThreadJdk12.java @@ -324,7 +324,7 @@ else if ( where == IN_DESCRIPTION ) { /* // Stop suffering if we are behind the searched words - if ( text.substring( 0, Math.min(toFind.length(), text.length()) ).compareTo( toFind ) > 0 ) { + if ( text.substring( 0, Math.min(toFind.length()) ).compareTo( toFind ) > 0 ) { try { System.out.println("Stoping suffering"); in.close(); diff --git a/java/javadoc/src/org/netbeans/modules/javadoc/search/SearchThreadJdk12_japan.java b/java/javadoc/src/org/netbeans/modules/javadoc/search/SearchThreadJdk12_japan.java index 98753c6c89ae..3a39db23c41d 100644 --- a/java/javadoc/src/org/netbeans/modules/javadoc/search/SearchThreadJdk12_japan.java +++ b/java/javadoc/src/org/netbeans/modules/javadoc/search/SearchThreadJdk12_japan.java @@ -336,7 +336,7 @@ else if ( where == IN_DESCRIPTION ) { String text = new String( data ); /* // Stop suffering if we are behind the searched words - if ( text.substring( 0, Math.min(toFind.length(), text.length()) ).compareTo( toFind ) > 0 ) { + if ( text.substring( 0, Math.min(toFind.length()) ).compareTo( toFind ) > 0 ) { try { System.out.println("Stoping suffering"); in.close(); diff --git a/java/jshell.support/src/org/netbeans/modules/jshell/tool/JShellTool.java b/java/jshell.support/src/org/netbeans/modules/jshell/tool/JShellTool.java index c800d914816e..7ad71a2f97e7 100644 --- a/java/jshell.support/src/org/netbeans/modules/jshell/tool/JShellTool.java +++ b/java/jshell.support/src/org/netbeans/modules/jshell/tool/JShellTool.java @@ -363,7 +363,7 @@ String prefix(String s, String leading) { } return leading + s.substring(0, s.length() - 1).replaceAll("\\R", System.getProperty("line.separator") + feedback.getPre()) - + s.substring(s.length() - 1, s.length()); + + s.substring(s.length() - 1); } /** diff --git a/java/maven.grammar/src/org/netbeans/modules/maven/grammar/MavenProjectGrammar.java b/java/maven.grammar/src/org/netbeans/modules/maven/grammar/MavenProjectGrammar.java index 7d31ab7ebd7f..b5076c34747f 100644 --- a/java/maven.grammar/src/org/netbeans/modules/maven/grammar/MavenProjectGrammar.java +++ b/java/maven.grammar/src/org/netbeans/modules/maven/grammar/MavenProjectGrammar.java @@ -212,7 +212,7 @@ static String getNodeValue(String value, NbMavenProject prj) { if(idxLeft > idxRight) { sb.append(value.substring(idxRight + 1, idxLeft)); } else { - sb.append(value.substring(idxRight + 1, value.length())); + sb.append(value.substring(idxRight + 1)); } } idxRight++; diff --git a/java/maven.grammar/src/org/netbeans/modules/maven/hyperlinks/HyperlinkProviderImpl.java b/java/maven.grammar/src/org/netbeans/modules/maven/hyperlinks/HyperlinkProviderImpl.java index 279a45cd101e..729b85b8633c 100644 --- a/java/maven.grammar/src/org/netbeans/modules/maven/hyperlinks/HyperlinkProviderImpl.java +++ b/java/maven.grammar/src/org/netbeans/modules/maven/hyperlinks/HyperlinkProviderImpl.java @@ -167,7 +167,7 @@ private Tuple findProperty(String textToken, int tokenOffset, int currentOffset) if (ff > -1 && ff < textToken.length()) { String before = textToken.substring(0, ff); - String after = textToken.substring(ff, textToken.length()); + String after = textToken.substring(ff); int bo = before.lastIndexOf("${"); int bc = before.lastIndexOf("}"); int ao = after.indexOf("${"); @@ -291,7 +291,7 @@ boolean isMavenProperty() { int ff = documentOffset - ftokenOff; if (ff > -1 && ff < ftext.length()) { String before = ftext.substring(0, ff); - String after = ftext.substring(ff, ftext.length()); + String after = ftext.substring(ff); int bo = before.lastIndexOf("${");//NOI18N int bc = before.lastIndexOf("}");//NOI18N int ao = after.indexOf("${");//NOI18N diff --git a/java/performance/sparrow/src/org/netbeans/performance/impl/logparsing/Gc.java b/java/performance/sparrow/src/org/netbeans/performance/impl/logparsing/Gc.java index 5b47c79e6c9c..fb4c4298109d 100644 --- a/java/performance/sparrow/src/org/netbeans/performance/impl/logparsing/Gc.java +++ b/java/performance/sparrow/src/org/netbeans/performance/impl/logparsing/Gc.java @@ -83,7 +83,7 @@ protected void parse () throws ParseException { seconds = Float.parseFloat(timepart); - beforePart = beforePart.substring (3, beforePart.length()); + beforePart = beforePart.substring (3); initialMemory = Long.parseLong(beforePart); resultingMemory = Long.parseLong(afterPart); diff --git a/java/performance/sparrow/src/org/netbeans/performance/impl/logparsing/JavaLineswitch.java b/java/performance/sparrow/src/org/netbeans/performance/impl/logparsing/JavaLineswitch.java index d1053783eac8..efe8158c0d69 100644 --- a/java/performance/sparrow/src/org/netbeans/performance/impl/logparsing/JavaLineswitch.java +++ b/java/performance/sparrow/src/org/netbeans/performance/impl/logparsing/JavaLineswitch.java @@ -84,7 +84,7 @@ protected void parse() { if (identifier.startsWith("+") || identifier.startsWith("-")) { Boolean val = Boolean.valueOf(identifier.startsWith("+")); value = val; - identifier = identifier.substring(1, identifier.length()); + identifier = identifier.substring(1); } else { value = new Integer(intValue); } diff --git a/java/performance/sparrow/src/org/netbeans/performance/impl/logparsing/ModulesLog.java b/java/performance/sparrow/src/org/netbeans/performance/impl/logparsing/ModulesLog.java index 49c5c06ca60f..7baac38e8312 100644 --- a/java/performance/sparrow/src/org/netbeans/performance/impl/logparsing/ModulesLog.java +++ b/java/performance/sparrow/src/org/netbeans/performance/impl/logparsing/ModulesLog.java @@ -80,7 +80,7 @@ protected void parse() throws ParseException { int startidx = s.indexOf(lookfor + lookfor.length()); startidx = s.indexOf('\n', startidx); - String moduleSection = s.substring(startidx, s.length()); + String moduleSection = s.substring(startidx); StringTokenizer sk = new StringTokenizer(moduleSection, "\n"); String curr; diff --git a/java/refactoring.java/src/org/netbeans/modules/refactoring/java/WhereUsedElement.java b/java/refactoring.java/src/org/netbeans/modules/refactoring/java/WhereUsedElement.java index 43be78ee74f9..3580145a9277 100644 --- a/java/refactoring.java/src/org/netbeans/modules/refactoring/java/WhereUsedElement.java +++ b/java/refactoring.java/src/org/netbeans/modules/refactoring/java/WhereUsedElement.java @@ -327,7 +327,7 @@ public static WhereUsedElement create(CompilationInfo compiler, TreePath tree, J private static String trimStart(String s) { for (int x = 0; x < s.length(); x++) { if (!Character.isWhitespace(s.charAt(x))) { - return s.substring(x, s.length()); + return s.substring(x); } } return ""; diff --git a/java/spring.beans/src/org/netbeans/modules/spring/beans/completion/CompletorRegistry.java b/java/spring.beans/src/org/netbeans/modules/spring/beans/completion/CompletorRegistry.java index 659ead7b491e..53bd20e99a51 100644 --- a/java/spring.beans/src/org/netbeans/modules/spring/beans/completion/CompletorRegistry.java +++ b/java/spring.beans/src/org/netbeans/modules/spring/beans/completion/CompletorRegistry.java @@ -175,7 +175,7 @@ private Completor getAttributeCompletor(final CompletionContext context) { private static String extractVanilaTagName(String tagNameWithNs) { int offset = tagNameWithNs.indexOf(":"); //NOI18N - return offset == -1 ? tagNameWithNs : tagNameWithNs.substring(offset + 1, tagNameWithNs.length()); + return offset == -1 ? tagNameWithNs : tagNameWithNs.substring(offset + 1); } private Completor getElementCompletor(CompletionContext context) { diff --git a/java/spring.beans/src/org/netbeans/modules/spring/beans/refactoring/JavaElementRefFinder.java b/java/spring.beans/src/org/netbeans/modules/spring/beans/refactoring/JavaElementRefFinder.java index 2c31fcc018c2..d1afa1180916 100644 --- a/java/spring.beans/src/org/netbeans/modules/spring/beans/refactoring/JavaElementRefFinder.java +++ b/java/spring.beans/src/org/netbeans/modules/spring/beans/refactoring/JavaElementRefFinder.java @@ -104,7 +104,7 @@ private String createClassDisplayText(AttributeValueFinder finder, String classA } String beforeMatch = escapeAttrValue(classAttrValue.substring(0, matchIndex)); String match = escapeAttrValue(classAttrValue.substring(matchIndex, matchIndex + matchLength)); - String afterMatch = escapeAttrValue(classAttrValue.substring(matchIndex + matchLength, classAttrValue.length())); + String afterMatch = escapeAttrValue(classAttrValue.substring(matchIndex + matchLength)); if (beforeMatch != null && match != null && afterMatch != null) { builder.append(" class="); // NOI18N builder.append(beforeMatch).append("").append(match).append("").append(afterMatch); // NOI18N diff --git a/java/spring.beans/src/org/netbeans/modules/spring/beans/refactoring/PropertyRefFinder.java b/java/spring.beans/src/org/netbeans/modules/spring/beans/refactoring/PropertyRefFinder.java index 715ab9d9d1d9..05d2ce7b3a22 100644 --- a/java/spring.beans/src/org/netbeans/modules/spring/beans/refactoring/PropertyRefFinder.java +++ b/java/spring.beans/src/org/netbeans/modules/spring/beans/refactoring/PropertyRefFinder.java @@ -311,7 +311,7 @@ private String createPropertyChildDisplayText(String attrValue, int matchIndex, builder.append("<property"); // NOI18N String beforeMatch = escapeAttrValue(attrValue.substring(0, matchIndex)); String match = escapeAttrValue(attrValue.substring(matchIndex, matchIndex + matchLength)); - String afterMatch = escapeAttrValue(attrValue.substring(matchIndex + matchLength, attrValue.length())); + String afterMatch = escapeAttrValue(attrValue.substring(matchIndex + matchLength)); if (beforeMatch != null && match != null && afterMatch != null) { builder.append(" name="); // NOI18N builder.append(beforeMatch).append("").append(match).append("").append(afterMatch); // NOI18N @@ -323,7 +323,7 @@ private String createPropertyAttributeDisplayText(String attr, int matchIndex, i StringBuilder builder = new StringBuilder(); String beforeMatch = attr.substring(0, matchIndex); String match = attr.substring(matchIndex, matchIndex + matchLength); - String afterMatch = escapeAttrValue(attr.substring(matchIndex + matchLength, attr.length())); + String afterMatch = escapeAttrValue(attr.substring(matchIndex + matchLength)); if (beforeMatch != null && match != null && afterMatch != null) { builder.append(beforeMatch).append("").append(match).append("").append(afterMatch); // NOI18N } diff --git a/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/Binding.java b/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/Binding.java index 0c007f980978..6a11a31d5220 100644 --- a/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/Binding.java +++ b/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/Binding.java @@ -138,7 +138,7 @@ public void readNode(org.w3c.dom.Node node, java.util.Map namespacePrefixes) { // Dup prefix map, so as to not write over previous values, and to make it easy to clear out our entries. namespacePrefixes = new java.util.HashMap(namespacePrefixes); } - String attrNSPrefix = attrName.substring(6, attrName.length()); + String attrNSPrefix = attrName.substring(6); namespacePrefixes.put(attrNSPrefix, attr.getValue()); } } diff --git a/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/Bindings.java b/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/Bindings.java index d112ed99a6a8..4cd8245b4ca0 100644 --- a/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/Bindings.java +++ b/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/Bindings.java @@ -189,7 +189,7 @@ public void readNode(org.w3c.dom.Node node, java.util.Map namespacePrefixes) { // Dup prefix map, so as to not write over previous values, and to make it easy to clear out our entries. namespacePrefixes = new java.util.HashMap(namespacePrefixes); } - String attrNSPrefix = attrName.substring(6, attrName.length()); + String attrNSPrefix = attrName.substring(6); namespacePrefixes.put(attrNSPrefix, attr.getValue()); } } diff --git a/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/Catalog.java b/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/Catalog.java index 5e0891b87946..ff1fcc442f53 100644 --- a/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/Catalog.java +++ b/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/Catalog.java @@ -137,7 +137,7 @@ public void readNode(org.w3c.dom.Node node, java.util.Map namespacePrefixes) { // Dup prefix map, so as to not write over previous values, and to make it easy to clear out our entries. namespacePrefixes = new java.util.HashMap(namespacePrefixes); } - String attrNSPrefix = attrName.substring(6, attrName.length()); + String attrNSPrefix = attrName.substring(6); namespacePrefixes.put(attrNSPrefix, attr.getValue()); } } diff --git a/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/Schema.java b/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/Schema.java index 804e778e521c..d1d79b28bdf9 100644 --- a/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/Schema.java +++ b/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/Schema.java @@ -296,7 +296,7 @@ public void readNode(org.w3c.dom.Node node, java.util.Map namespacePrefixes) { // Dup prefix map, so as to not write over previous values, and to make it easy to clear out our entries. namespacePrefixes = new java.util.HashMap(namespacePrefixes); } - String attrNSPrefix = attrName.substring(6, attrName.length()); + String attrNSPrefix = attrName.substring(6); namespacePrefixes.put(attrNSPrefix, attr.getValue()); } } diff --git a/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/SchemaSource.java b/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/SchemaSource.java index 1ee1a8a1d434..4262c4f24570 100644 --- a/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/SchemaSource.java +++ b/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/SchemaSource.java @@ -155,7 +155,7 @@ public void readNode(org.w3c.dom.Node node, java.util.Map namespacePrefixes) { // Dup prefix map, so as to not write over previous values, and to make it easy to clear out our entries. namespacePrefixes = new java.util.HashMap(namespacePrefixes); } - String attrNSPrefix = attrName.substring(6, attrName.length()); + String attrNSPrefix = attrName.substring(6); namespacePrefixes.put(attrNSPrefix, attr.getValue()); } } diff --git a/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/SchemaSources.java b/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/SchemaSources.java index 03c3b6c5ff0a..ca1d2bec64d7 100644 --- a/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/SchemaSources.java +++ b/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/SchemaSources.java @@ -190,7 +190,7 @@ public void readNode(org.w3c.dom.Node node, java.util.Map namespacePrefixes) { // Dup prefix map, so as to not write over previous values, and to make it easy to clear out our entries. namespacePrefixes = new java.util.HashMap(namespacePrefixes); } - String attrNSPrefix = attrName.substring(6, attrName.length()); + String attrNSPrefix = attrName.substring(6); namespacePrefixes.put(attrNSPrefix, attr.getValue()); } } diff --git a/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/Schemas.java b/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/Schemas.java index cf17913db70f..53632a66239e 100644 --- a/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/Schemas.java +++ b/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/Schemas.java @@ -404,7 +404,7 @@ public void readNode(org.w3c.dom.Node node, java.util.Map namespacePrefixes) { // Dup prefix map, so as to not write over previous values, and to make it easy to clear out our entries. namespacePrefixes = new java.util.HashMap(namespacePrefixes); } - String attrNSPrefix = attrName.substring(6, attrName.length()); + String attrNSPrefix = attrName.substring(6); namespacePrefixes.put(attrNSPrefix, attr.getValue()); } } diff --git a/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/XjcOption.java b/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/XjcOption.java index 196371d79e47..d104091da962 100644 --- a/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/XjcOption.java +++ b/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/XjcOption.java @@ -137,7 +137,7 @@ public void readNode(org.w3c.dom.Node node, java.util.Map namespacePrefixes) { // Dup prefix map, so as to not write over previous values, and to make it easy to clear out our entries. namespacePrefixes = new java.util.HashMap(namespacePrefixes); } - String attrNSPrefix = attrName.substring(6, attrName.length()); + String attrNSPrefix = attrName.substring(6); namespacePrefixes.put(attrNSPrefix, attr.getValue()); } } diff --git a/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/XjcOptions.java b/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/XjcOptions.java index b77cd98cf766..3bcfde3041e2 100644 --- a/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/XjcOptions.java +++ b/java/xml.jaxb/src/org/netbeans/modules/xml/jaxb/cfg/schema/XjcOptions.java @@ -190,7 +190,7 @@ public void readNode(org.w3c.dom.Node node, java.util.Map namespacePrefixes) { // Dup prefix map, so as to not write over previous values, and to make it easy to clear out our entries. namespacePrefixes = new java.util.HashMap(namespacePrefixes); } - String attrNSPrefix = attrName.substring(6, attrName.length()); + String attrNSPrefix = attrName.substring(6); namespacePrefixes.put(attrNSPrefix, attr.getValue()); } } diff --git a/javafx/javafx2.project/test/unit/src/org/netbeans/modules/javafx2/project/UpdateJFXImplTest.java b/javafx/javafx2.project/test/unit/src/org/netbeans/modules/javafx2/project/UpdateJFXImplTest.java index b7dcd4fa749c..e4c87e508a52 100644 --- a/javafx/javafx2.project/test/unit/src/org/netbeans/modules/javafx2/project/UpdateJFXImplTest.java +++ b/javafx/javafx2.project/test/unit/src/org/netbeans/modules/javafx2/project/UpdateJFXImplTest.java @@ -413,7 +413,7 @@ public boolean accept(File file, String string) { public boolean accept(File file, String string) { return string.length() >= JFXIMPL_BACKUP_NAME.length() + 4 && string.substring(0,JFXIMPL_BACKUP_NAME.length()).equalsIgnoreCase(JFXIMPL_BACKUP_NAME) - && string.substring(string.length() - 4, string.length()).equalsIgnoreCase(".xml"); + && string.substring(string.length() - 4).equalsIgnoreCase(".xml"); } }); if(fBackups != null) { diff --git a/nb/o.n.upgrader/src/org/netbeans/upgrade/systemoptions/SerParser.java b/nb/o.n.upgrader/src/org/netbeans/upgrade/systemoptions/SerParser.java index 61ef63c0767e..0d0cecf63dab 100644 --- a/nb/o.n.upgrader/src/org/netbeans/upgrade/systemoptions/SerParser.java +++ b/nb/o.n.upgrader/src/org/netbeans/upgrade/systemoptions/SerParser.java @@ -456,7 +456,7 @@ private FieldDesc readFieldDesc() throws IOException { /* if (((ObjFieldDesc)fd).array) { if (! clazz.startsWith("[")) throw new CorruptException("Field type: " + clazz); // NOI18N - clazz = clazz.substring(1, clazz.length()); + clazz = clazz.substring(1); } if (! (clazz.startsWith("L") && clazz.endsWith(";"))) throw new CorruptException("Field type: " + clazz); // NOI18N fd.type = clazz.substring(1, clazz.length() - 1).replace('/', '.'); // NOI18N diff --git a/nbbuild/antsrc/org/netbeans/nbbuild/CheckLinks.java b/nbbuild/antsrc/org/netbeans/nbbuild/CheckLinks.java index 5b7c7665118b..297ceeed27ed 100644 --- a/nbbuild/antsrc/org/netbeans/nbbuild/CheckLinks.java +++ b/nbbuild/antsrc/org/netbeans/nbbuild/CheckLinks.java @@ -201,7 +201,7 @@ public void execute () throws BuildException { int pos = referrer.indexOf("!"); if (pos != -1) { String base = referrer.substring(0,pos+1); - String path1 = referrer.substring(pos+1,referrer.length()); + String path1 = referrer.substring(pos+1); //System.out.println("base:" + base); //System.out.println("path1:" + path1); File f1 = new File(path1); @@ -307,7 +307,7 @@ public void execute () throws BuildException { String name = u.getPath(); //Strip leading "/" as findResource does not work when leading slash is present if (name.startsWith("/")) { - name = name.substring(1,name.length()); + name = name.substring(1); //System.out.println("name:" + name); } URL res; @@ -344,7 +344,7 @@ public void execute () throws BuildException { String name = u.getPath(); //Strip leading "/" as findResource does not work when leading slash is present if (name.startsWith("/")) { - name = name.substring(1,name.length()); + name = name.substring(1); //System.out.println("name:" + name); } URL res = null; diff --git a/nbbuild/antsrc/org/netbeans/nbbuild/FixTestDependencies.java b/nbbuild/antsrc/org/netbeans/nbbuild/FixTestDependencies.java index 03b7a3eba44a..c6113ca1694c 100644 --- a/nbbuild/antsrc/org/netbeans/nbbuild/FixTestDependencies.java +++ b/nbbuild/antsrc/org/netbeans/nbbuild/FixTestDependencies.java @@ -87,7 +87,7 @@ public void execute() throws BuildException { if (xsdIndex != -1 || testFix) { // increase schema version String part1 = xml.substring(0,xsdIndex + oldXsd.length() - 1); - String part2 = xml.substring(xsdIndex + oldXsd.length(), xml.length()); + String part2 = xml.substring(xsdIndex + oldXsd.length()); xml = part1 + "3" + part2; ModuleType projectType = ModuleType.NB_ORG; @@ -200,7 +200,7 @@ public void execute() throws BuildException { if (xml.charAt(moduleDepEnd) == '\r') { moduleDepEnd++; } - resultXml.append(xml.substring(moduleDepEnd + 1, xml.length())); + resultXml.append(xml.substring(moduleDepEnd + 1)); if (!testFix) { try (PrintStream ps = new PrintStream(projectXmlFile)) { ps.print(fixOpenideUtil( @@ -273,7 +273,7 @@ boolean readCodeNameBases(Set compileCNB, compileCNB.add(codeBaseName); found = true; } else { - String name = token.substring(lastSlash + 1, token.length()); + String name = token.substring(lastSlash + 1); // check if the file is wrapped library String wrapCNB = null; for (ModuleListParser.Entry entry : entries) { diff --git a/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/VerifyLibsAndLicenses.java b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/VerifyLibsAndLicenses.java index 79d1259504cd..7e6ea1eaa7eb 100644 --- a/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/VerifyLibsAndLicenses.java +++ b/nbbuild/antsrc/org/netbeans/nbbuild/extlibs/VerifyLibsAndLicenses.java @@ -540,7 +540,7 @@ private static String mismatch(String actual, String expected, boolean useHead) } private static String headOrTail(String text, boolean useHead) { int context = 20; - return text.length() > context ? (useHead ? text.substring(0, context) : text.substring(text.length() - context, text.length())) : text; + return text.length() > context ? (useHead ? text.substring(0, context) : text.substring(text.length() - context)) : text; } static List loadPatterns(String resource) throws IOException { diff --git a/nbbuild/test/unit/src/org/netbeans/nbbuild/MakeJNLPTest.java b/nbbuild/test/unit/src/org/netbeans/nbbuild/MakeJNLPTest.java index 10d8bdfa3ec3..9537ab7b88e2 100644 --- a/nbbuild/test/unit/src/org/netbeans/nbbuild/MakeJNLPTest.java +++ b/nbbuild/test/unit/src/org/netbeans/nbbuild/MakeJNLPTest.java @@ -1053,7 +1053,7 @@ private File createNewJarFile(String prefix) throws IOException { if (prefix == null) { prefix = "modules"; } - String ss = prefix.substring(prefix.length()-1, prefix.length()); + String ss = prefix.substring(prefix.length()-1); File dir = new File(this.getWorkDir(), prefix); dir.mkdirs(); diff --git a/nbbuild/test/unit/src/org/netbeans/nbbuild/MakeNBMTest.java b/nbbuild/test/unit/src/org/netbeans/nbbuild/MakeNBMTest.java index ffdfd06b5386..3230483b07a4 100644 --- a/nbbuild/test/unit/src/org/netbeans/nbbuild/MakeNBMTest.java +++ b/nbbuild/test/unit/src/org/netbeans/nbbuild/MakeNBMTest.java @@ -136,7 +136,7 @@ private File createNewJarFile(String prefix) throws IOException { if (prefix == null) { prefix = "modules"; } - String ss = prefix.substring(prefix.length()-1, prefix.length()); + String ss = prefix.substring(prefix.length()-1); File dir = new File(this.getWorkDir(), prefix); dir.mkdirs(); diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/VariousUtils.java b/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/VariousUtils.java index 65bb41e7a5f4..911c7cd17f36 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/VariousUtils.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/VariousUtils.java @@ -1968,7 +1968,7 @@ private static String qualifyUnionOrIntersectionTypeNames(String typeNames, int int indexOfArrayDelim = typeName.indexOf('['); if (indexOfArrayDelim != -1) { typeRawPart = typeName.substring(0, indexOfArrayDelim); - typeArrayPart = typeName.substring(indexOfArrayDelim, typeName.length()); + typeArrayPart = typeName.substring(indexOfArrayDelim); } if ("$this".equals(typeName)) { //NOI18N // #239987 diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/parser/PHPDocCommentParser.java b/php/php.editor/src/org/netbeans/modules/php/editor/parser/PHPDocCommentParser.java index 3d611c892540..3f3a7c91c2e9 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/parser/PHPDocCommentParser.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/parser/PHPDocCommentParser.java @@ -150,7 +150,7 @@ public PHPDocBlock parse(final int startOffset, final int endOffset, final Strin if (index == 0) { // there is only one line comment line = removeStarAndTrim(comment); } else { - line = comment.substring(index, comment.length()).trim(); + line = comment.substring(index).trim(); } AnnotationParsedLine tagType = findTagOnLine(line); if (tagType != null) { // is defined a tag on the last line @@ -277,7 +277,7 @@ private List findTypes(String description, int startDescription, docType = new PHPDocTypeNode(startDocNode, startDocNode + stype.length(), stype, isArray); } else { String className = stype.substring(0, index); - String constantName = stype.substring(index + 2, stype.length()); + String constantName = stype.substring(index + 2); PHPDocNode classNameNode = new PHPDocNode(startDocNode, startDocNode + className.length(), className); PHPDocNode constantNode = new PHPDocNode(startDocNode + className.length() + 2, startDocNode + stype.length(), constantName); docType = new PHPDocStaticAccessType(startDocNode, startDocNode + stype.length(), stype, classNameNode, constantNode); diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/parser/PHPVarCommentParser.java b/php/php.editor/src/org/netbeans/modules/php/editor/parser/PHPVarCommentParser.java index d75935ed2c07..3ed38005b002 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/parser/PHPVarCommentParser.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/parser/PHPVarCommentParser.java @@ -76,7 +76,7 @@ PHPVarComment parse(final int startOffset, final int endOffset, final String com docType = new PHPDocTypeNode(startDocNode, endPosition, type, isArray); } else { String className = type.substring(0, index); - String constantName = type.substring(index + 2, type.length()); + String constantName = type.substring(index + 2); PHPDocNode classNameNode = new PHPDocNode(startDocNode, startDocNode + className.length(), className); PHPDocNode constantNode = new PHPDocNode(startDocNode + className.length() + 2, startDocNode + type.length(), constantName); docType = new PHPDocStaticAccessType(startDocNode, startDocNode + type.length(), type, classNameNode, constantNode); diff --git a/php/php.project/src/org/netbeans/modules/php/project/connections/ui/NewRemoteConnectionPanel.java b/php/php.project/src/org/netbeans/modules/php/project/connections/ui/NewRemoteConnectionPanel.java index a9c0b0351a2c..17e913566d36 100644 --- a/php/php.project/src/org/netbeans/modules/php/project/connections/ui/NewRemoteConnectionPanel.java +++ b/php/php.project/src/org/netbeans/modules/php/project/connections/ui/NewRemoteConnectionPanel.java @@ -109,7 +109,7 @@ public String getConfigName() { byte[] digest = md.digest(); BigInteger hash = new BigInteger(1, digest); String hashWord = hash.toString(16); - String postfix = hashWord.substring(hashWord.length() - 6, hashWord.length()); + String postfix = hashWord.substring(hashWord.length() - 6); return getOldConfigName() + "-" + postfix; // NOI18N } diff --git a/php/websvc.saas.codegen.php/src/org/netbeans/modules/websvc/saas/codegen/php/SoapClientPhpCodeGenerator.java b/php/websvc.saas.codegen.php/src/org/netbeans/modules/websvc/saas/codegen/php/SoapClientPhpCodeGenerator.java index a762ae944a60..346c8e6ab8df 100644 --- a/php/websvc.saas.codegen.php/src/org/netbeans/modules/websvc/saas/codegen/php/SoapClientPhpCodeGenerator.java +++ b/php/websvc.saas.codegen.php/src/org/netbeans/modules/websvc/saas/codegen/php/SoapClientPhpCodeGenerator.java @@ -104,7 +104,7 @@ protected String getCustomMethodBody() throws IOException { methodName = infos[0].getOperationName(); } if ( wsdlUrl.startsWith(FILE.substring(0, FILE.length() -1)) && - !wsdlUrl.startsWith(FILE.substring(0, FILE.length()))) + !wsdlUrl.startsWith(FILE)) { wsdlUrl = FILE + wsdlUrl.substring( FILE.length()-1); } diff --git a/platform/api.search/src/org/netbeans/api/search/provider/FileNameMatcher.java b/platform/api.search/src/org/netbeans/api/search/provider/FileNameMatcher.java index 4d5eccfaf369..ebb6776d5f75 100644 --- a/platform/api.search/src/org/netbeans/api/search/provider/FileNameMatcher.java +++ b/platform/api.search/src/org/netbeans/api/search/provider/FileNameMatcher.java @@ -125,8 +125,7 @@ private boolean pathMatches(String fileName) { if (fileName == null || fileName.length() <= extWithDotLen) { return false; } - return fileName.substring(fileName.length() - extWithDotLen, - fileName.length()).equalsIgnoreCase(extWithDot); + return fileName.substring(fileName.length() - extWithDotLen).equalsIgnoreCase(extWithDot); } @Override @@ -216,7 +215,7 @@ public boolean pathMatches(URI uri) { if (lastSeparator == -1) { return false; } else { - String name = path.substring(lastSeparator + 1, path.length()); + String name = path.substring(lastSeparator + 1); return pattern.matcher(name).matches(); } } diff --git a/platform/api.search/src/org/netbeans/modules/search/ui/ResultsOutlineCellRenderer.java b/platform/api.search/src/org/netbeans/modules/search/ui/ResultsOutlineCellRenderer.java index 9ea398183aac..717d204bf6f6 100644 --- a/platform/api.search/src/org/netbeans/modules/search/ui/ResultsOutlineCellRenderer.java +++ b/platform/api.search/src/org/netbeans/modules/search/ui/ResultsOutlineCellRenderer.java @@ -123,7 +123,7 @@ private String computeFitText(JTable table, int rowIdx, int columnIdx, } for (int i = 1; i <= text.length() - 1; i++) { - String part = text.substring(text.length() - i, text.length()); + String part = text.substring(text.length() - i); int swidth = fm.stringWidth(part); if (swidth >= desired) { return part.length() > 0 ? prefix + part + " " : text; //NOI18N diff --git a/platform/core.network/src/org/netbeans/core/network/proxy/NetworkProxySettings.java b/platform/core.network/src/org/netbeans/core/network/proxy/NetworkProxySettings.java index ca3f4705e49c..27db61f36020 100644 --- a/platform/core.network/src/org/netbeans/core/network/proxy/NetworkProxySettings.java +++ b/platform/core.network/src/org/netbeans/core/network/proxy/NetworkProxySettings.java @@ -174,7 +174,7 @@ private String getPort(String string) { return EMPTY_STRING; } else { if (string.endsWith(SLASH)) { - string = string.substring(string.length() - 1, string.length()); + string = string.substring(string.length() - 1); } if (string.contains(COLON)) { return string.substring(string.lastIndexOf(COLON) + 1); diff --git a/platform/o.n.core/src/org/netbeans/beaninfo/editors/CharEditor.java b/platform/o.n.core/src/org/netbeans/beaninfo/editors/CharEditor.java index 7ee77f395187..c3e19f87e2a5 100644 --- a/platform/o.n.core/src/org/netbeans/beaninfo/editors/CharEditor.java +++ b/platform/o.n.core/src/org/netbeans/beaninfo/editors/CharEditor.java @@ -78,7 +78,7 @@ public void setAsText(String text) throws IllegalArgumentException { case 'r': value = '\r'; break; case '\\': value = '\\' ; break; case 'u' : - String num = text.substring(2,text.length()); + String num = text.substring(2); if (num.length () > 4) { // ignore longer strings return; diff --git a/platform/openide.filesystems/src/org/openide/filesystems/URLMapper.java b/platform/openide.filesystems/src/org/openide/filesystems/URLMapper.java index 2dbf30f93db3..d295a4d5357d 100644 --- a/platform/openide.filesystems/src/org/openide/filesystems/URLMapper.java +++ b/platform/openide.filesystems/src/org/openide/filesystems/URLMapper.java @@ -540,7 +540,7 @@ void parse(URL originalURL) { if (++separator != spec.length()) { try { // XXX new URI("substring").getPath() might be better? - entryName = URLDecoder.decode(spec.substring(separator, spec.length()),"UTF-8"); + entryName = URLDecoder.decode(spec.substring(separator),"UTF-8"); } catch (UnsupportedEncodingException ex) { return; } diff --git a/platform/openide.loaders/src/org/openide/loaders/DefaultDataObject.java b/platform/openide.loaders/src/org/openide/loaders/DefaultDataObject.java index f1e5f2a674f6..d94680e6c203 100644 --- a/platform/openide.loaders/src/org/openide/loaders/DefaultDataObject.java +++ b/platform/openide.loaders/src/org/openide/loaders/DefaultDataObject.java @@ -115,8 +115,7 @@ protected FileObject handleRename (String name) throws IOException { getPrimaryFile ().rename (lock, name, null); } else { if (!name.equals(getPrimaryFile ().getNameExt())){ - getPrimaryFile ().rename (lock, name.substring(0, pos), - name.substring(pos+1, name.length())); + getPrimaryFile ().rename (lock, name.substring(0, pos), name.substring(pos+1)); DataObjectPool.getPOOL().revalidate( new HashSet (java.util.Collections.singleton(getPrimaryFile ())) ); diff --git a/platform/openide.util/src/org/openide/util/BaseUtilities.java b/platform/openide.util/src/org/openide/util/BaseUtilities.java index 045cdf8a5ffd..faf4d0f21248 100644 --- a/platform/openide.util/src/org/openide/util/BaseUtilities.java +++ b/platform/openide.util/src/org/openide/util/BaseUtilities.java @@ -461,7 +461,7 @@ public static String pureClassName(final String fullName) { final int index = fullName.indexOf('$'); if ((index >= 0) && (index < fullName.length())) { - return fullName.substring(index + 1, fullName.length()); + return fullName.substring(index + 1); } return fullName; diff --git a/platform/openide.util/src/org/openide/util/MapFormat.java b/platform/openide.util/src/org/openide/util/MapFormat.java index 056bd674b554..d6b91774774c 100644 --- a/platform/openide.util/src/org/openide/util/MapFormat.java +++ b/platform/openide.util/src/org/openide/util/MapFormat.java @@ -291,7 +291,7 @@ public StringBuffer format(Object pat, StringBuffer result, FieldPosition fpos) result.append(obj); } - result.append(pattern.substring(lastOffset, pattern.length())); + result.append(pattern.substring(lastOffset)); return result; } diff --git a/platform/print/src/org/netbeans/modules/print/ui/Attribute.java b/platform/print/src/org/netbeans/modules/print/ui/Attribute.java index 04e89d60abe4..b47b04201098 100644 --- a/platform/print/src/org/netbeans/modules/print/ui/Attribute.java +++ b/platform/print/src/org/netbeans/modules/print/ui/Attribute.java @@ -435,7 +435,7 @@ public void pressed(Macro macro) { //out(" select: " + myLastField.getSelectionStart() + " " + myLastField.getSelectionEnd()); String text = myLastField.getText(); String head = text.substring(0, myLastField.getSelectionStart()); - String tail = text.substring(myLastField.getSelectionEnd(), text.length()); + String tail = text.substring(myLastField.getSelectionEnd()); myLastField.setText(head + macro.getName() + tail); } diff --git a/platform/settings/src/org/netbeans/modules/settings/Env.java b/platform/settings/src/org/netbeans/modules/settings/Env.java index 61192c774321..d09a57ef9c4c 100644 --- a/platform/settings/src/org/netbeans/modules/settings/Env.java +++ b/platform/settings/src/org/netbeans/modules/settings/Env.java @@ -166,7 +166,7 @@ public static FileObject findEntityRegistration(FileObject provider) { filename = filename.substring(0, i); } String resource = xmlEntitiesPrefix + - filename.substring(xmlLookupsPrefix.length(), filename.length()); + filename.substring(xmlLookupsPrefix.length()); return FileUtil.getConfigFile(resource); } diff --git a/platform/spi.quicksearch/src/org/netbeans/modules/quicksearch/ResultsModel.java b/platform/spi.quicksearch/src/org/netbeans/modules/quicksearch/ResultsModel.java index f8f80bfc5f6d..6e50d43f7704 100644 --- a/platform/spi.quicksearch/src/org/netbeans/modules/quicksearch/ResultsModel.java +++ b/platform/spi.quicksearch/src/org/netbeans/modules/quicksearch/ResultsModel.java @@ -195,7 +195,7 @@ private String highlightSubstring (String text, SearchRequest sRequest) { sb.append(safeEscape(text.substring(index, endIndex))); sb.append(""); if (endIndex < text.length()) { - sb.append(safeEscape(text.substring(endIndex, text.length()))); + sb.append(safeEscape(text.substring(endIndex))); } return sb.toString(); } diff --git a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/components/HTMLTextArea.java b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/components/HTMLTextArea.java index 98e6cb5bf3f1..62be4f3a15e8 100644 --- a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/components/HTMLTextArea.java +++ b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/components/HTMLTextArea.java @@ -156,7 +156,7 @@ public static String decode(String str) { i1 = str.indexOf('&', i2); //NOI18N if (i1 == -1) { - ostr.append(str.substring(i2, str.length())); + ostr.append(str.substring(i2)); break; } @@ -165,7 +165,7 @@ public static String decode(String str) { i2 = str.indexOf(';', i1); //NOI18N if (i2 == -1) { - ostr.append(str.substring(i1, str.length())); + ostr.append(str.substring(i1)); break; } @@ -184,7 +184,7 @@ public static String decode(String str) { if (tok.trim().charAt(0) == 'x') { //NOI18N radix = 16; - tok = tok.substring(1, tok.length()); + tok = tok.substring(1); } ostr.append((char) Integer.parseInt(tok, radix)); diff --git a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/jdbc/SQLFormatter.java b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/jdbc/SQLFormatter.java index e97e7bcc9971..df8be8ac3834 100644 --- a/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/jdbc/SQLFormatter.java +++ b/profiler/lib.profiler.ui/src/org/netbeans/lib/profiler/ui/jdbc/SQLFormatter.java @@ -129,7 +129,7 @@ static String format(String command) { } offset = m.end(); } - s.append(command.substring(offset,command.length())); + s.append(command.substring(offset)); s.append(checkPingSQL(command)); s.append(""); // NOI18N diff --git a/profiler/lib.profiler/src-jdk15/org/netbeans/lib/profiler/server/ProfilerActivate15.java b/profiler/lib.profiler/src-jdk15/org/netbeans/lib/profiler/server/ProfilerActivate15.java index dfc42ce16e1f..d50a6ef52a75 100644 --- a/profiler/lib.profiler/src-jdk15/org/netbeans/lib/profiler/server/ProfilerActivate15.java +++ b/profiler/lib.profiler/src-jdk15/org/netbeans/lib/profiler/server/ProfilerActivate15.java @@ -86,7 +86,7 @@ private static void activate(String agentArgs, Instrumentation inst, int activat if (commaPos != -1) { // optional timeout is specified - String timeOutStr = agentArgs.substring(commaPos + 1, agentArgs.length()); + String timeOutStr = agentArgs.substring(commaPos + 1); try { timeOut = Integer.parseInt(timeOutStr); diff --git a/webcommon/cordova/cordovaprojectupdate/src/org/netbeans/modules/cordova/updatetask/XMLFile.java b/webcommon/cordova/cordovaprojectupdate/src/org/netbeans/modules/cordova/updatetask/XMLFile.java index 83d0caa0ecf9..cb58310ba6bf 100644 --- a/webcommon/cordova/cordovaprojectupdate/src/org/netbeans/modules/cordova/updatetask/XMLFile.java +++ b/webcommon/cordova/cordovaprojectupdate/src/org/netbeans/modules/cordova/updatetask/XMLFile.java @@ -143,7 +143,7 @@ private Node createXpath(String xpath) { node = indexOf <0 ? null : getNode(xpath.substring(0, indexOf)); } - String rest = xpath.substring(lastIndexOf + 1, xpath.length()); + String rest = xpath.substring(lastIndexOf + 1); for (String newTag:rest.split("/")) { // NOI18N lastNode = lastNode.appendChild(doc.createElement(newTag)); } diff --git a/webcommon/extbrowser.chrome/src/org/netbeans/modules/extbrowser/plugins/Utils.java b/webcommon/extbrowser.chrome/src/org/netbeans/modules/extbrowser/plugins/Utils.java index bfc82bbf4253..d1e13490d2b9 100644 --- a/webcommon/extbrowser.chrome/src/org/netbeans/modules/extbrowser/plugins/Utils.java +++ b/webcommon/extbrowser.chrome/src/org/netbeans/modules/extbrowser/plugins/Utils.java @@ -332,8 +332,7 @@ public static List getVersionParts(String version) { int index = nextToken.indexOf("a"); String first = nextToken.substring(0, index); - String second = nextToken.substring(index + 1, - nextToken.length()); + String second = nextToken.substring(index + 1); // version xxbyy is greater than any version xx-1 without a beta // but less than version xx without a beta @@ -344,8 +343,7 @@ public static List getVersionParts(String version) { int index = nextToken.indexOf("b"); String first = nextToken.substring(0, index); - String second = nextToken.substring(index + 1, - nextToken.length()); + String second = nextToken.substring(index + 1); // version xxbyy is greater than any version xx-1 without a beta // but less than version xx without a beta diff --git a/webcommon/javascript.jstestdriver/src/org/netbeans/modules/javascript/jstestdriver/JSTestDriverSupport.java b/webcommon/javascript.jstestdriver/src/org/netbeans/modules/javascript/jstestdriver/JSTestDriverSupport.java index 809b8eaeb50d..6a774b1409e6 100644 --- a/webcommon/javascript.jstestdriver/src/org/netbeans/modules/javascript/jstestdriver/JSTestDriverSupport.java +++ b/webcommon/javascript.jstestdriver/src/org/netbeans/modules/javascript/jstestdriver/JSTestDriverSupport.java @@ -408,7 +408,7 @@ public List convert(String line) { //res.add(ConvertedLine.forText(line.substring(0, start), null)); ListenerImpl l = new ListenerImpl(fo, lineNumber, columnNumber); res.add(ConvertedLine.forText(/*line.substring(start, line.length()-1)*/line, l.isValidHyperlink() ? l : null)); - //res.add(ConvertedLine.forText(line.substring(line.length()-1, line.length()), null)); + //res.add(ConvertedLine.forText(line.substring(line.length()-1), null)); return res; } @@ -475,7 +475,7 @@ private List convertLineURL(String line) { //res.add(ConvertedLine.forText(line.substring(0, start), null)); ListenerImpl l = new ListenerImpl(fo, lineNumber, columnNumber); res.add(ConvertedLine.forText(/*line.substring(start, line.length()-1)*/line, l.isValidHyperlink() ? l : null)); - //res.add(ConvertedLine.forText(line.substring(line.length()-1, line.length()), null)); + //res.add(ConvertedLine.forText(line.substring(line.length()-1), null)); return res; } diff --git a/webcommon/javascript2.requirejs/src/org/netbeans/modules/javascript2/requirejs/editor/FSCompletionUtils.java b/webcommon/javascript2.requirejs/src/org/netbeans/modules/javascript2/requirejs/editor/FSCompletionUtils.java index 8135acbee98a..01ce7fd285f7 100644 --- a/webcommon/javascript2.requirejs/src/org/netbeans/modules/javascript2/requirejs/editor/FSCompletionUtils.java +++ b/webcommon/javascript2.requirejs/src/org/netbeans/modules/javascript2/requirejs/editor/FSCompletionUtils.java @@ -353,7 +353,7 @@ private static List findFileObjects(final Project project, final Str if (!packages.isEmpty()) { String requiredPath = path; if (path.startsWith("./")) { //NOI18N - requiredPath = path.substring(2, path.length()); + requiredPath = path.substring(2); } if (requiredPath.contains("/")) { //NOI18N final int slashIndex = requiredPath.indexOf("/"); // NOI18N @@ -361,7 +361,7 @@ private static List findFileObjects(final Project project, final Str if (packages.get(pkgName) != null) { requiredPath = packages.get(pkgName) + File.separator - + requiredPath.substring(slashIndex + 1, requiredPath.length()); + + requiredPath.substring(slashIndex + 1); } } if (!basePaths.isEmpty() && !requiredPath.startsWith("/")) { //NOI18N diff --git a/webcommon/web.webkit.tooling/src/org/netbeans/modules/web/webkit/tooling/console/BrowserConsoleLogger.java b/webcommon/web.webkit.tooling/src/org/netbeans/modules/web/webkit/tooling/console/BrowserConsoleLogger.java index 4eea70b45181..38dd7a9d06da 100644 --- a/webcommon/web.webkit.tooling/src/org/netbeans/modules/web/webkit/tooling/console/BrowserConsoleLogger.java +++ b/webcommon/web.webkit.tooling/src/org/netbeans/modules/web/webkit/tooling/console/BrowserConsoleLogger.java @@ -380,7 +380,7 @@ private Object[] tryToConvertLineToHyperlink(Project project, String line) { String s1 = line.substring(0, start); String s2 = "(" + // NOI18N getProjectPath(project, file) + - line.substring(fileEnd, line.length()); + line.substring(fileEnd); MyListener l = new MyListener(project, file, lineNumber, columnNumber); return new Object[]{l,s1,s2}; } @@ -425,7 +425,7 @@ private Object[] tryToConvertLineURLToHyperlink(Project project, String line) { return null; } String s1 = line.substring(0, u1); - String s2 = line.substring(u1, line.length()); + String s2 = line.substring(u1); MyListener l = new MyListener(project, file, lineNumber, columnNumber); return new Object[]{l,s1,s2}; }