[jira] [Assigned] (NETBEANS-3070) Netbeans unable to copy context XML file from Temp folder to Catalina/localhost
[ https://issues.apache.org/jira/browse/NETBEANS-3070?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pramod Chandra reassigned NETBEANS-3070: Assignee: Alex Lumpov > Netbeans unable to copy context XML file from Temp folder to > Catalina/localhost > --- > > Key: NETBEANS-3070 > URL: https://issues.apache.org/jira/browse/NETBEANS-3070 > Project: NetBeans > Issue Type: Bug > Components: javaee - Maven >Affects Versions: 11.1 > Environment: Windows 10, 64 bit, Apache Netbeans 11.1, JDK 11, JRE > 8u221 >Reporter: Pramod Chandra >Assignee: Alex Lumpov >Priority: Major > Labels: beginner, newbie > Fix For: 11.1 > > Attachments: Catalina log.JPG, Maven.JPG > > > Steps to reproduce: > > Create a new web application using maven on Apache Netbeans 11.1 > Choose the Server as Tomcat 9.0 > Right Click on the project and select Clean and Build > After the message "Build Successful" run the project > Error in Netbeans: > In-place deployment at C:\Users\Pramod > Chandra\Documents\NetBeansProjects\mavenTest\target\mavenTest-1 > Deployment is in progress... > deploy?config=file%3A%2FC%3A%2FUsers%2FPramod%2520Chandra%2FAppData%2FLocal%2FTemp%2Fcontext11250002610202739917.xml&path=/mavenTest > FAIL - Failed to deploy application at context path [/mavenTest] > > Error in server.log > > 06-Sep-2019 09:41:51.080 SEVERE [http-nio-8080-exec-158] > org.apache.catalina.startup.ExpandWar.copy Error copying > [C:\Users\Pramod%20Chandra\AppData\Local\Temp\context11250002610202739917.xml] > to [C:\Program Files\Apache Software Foundation\Tomcat > 9.0\conf\Catalina\localhost\mavenTest.xml]06-Sep-2019 09:41:51.080 SEVERE > [http-nio-8080-exec-158] org.apache.catalina.startup.ExpandWar.copy Error > copying > [C:\Users\Pramod%20Chandra\AppData\Local\Temp\context11250002610202739917.xml] > to [C:\Program Files\Apache Software Foundation\Tomcat > 9.0\conf\Catalina\localhost\mavenTest.xml] java.io.FileNotFoundException: > C:\Users\Pramod%20Chandra\AppData\Local\Temp\context11250002610202739917.xml > (The system cannot find the path specified) at > java.base/java.io.FileInputStream.open0(Native Method) at > java.base/java.io.FileInputStream.open(FileInputStream.java:219) at > java.base/java.io.FileInputStream.(FileInputStream.java:157) at > org.apache.catalina.startup.ExpandWar.copy(ExpandWar.java:276) at > org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:1002) > at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:355) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) at > javax.servlet.http.HttpServlet.service(HttpServlet.java:741) at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) > at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) > at > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) > at > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) > at > org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:643) > at > org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:348) > at > org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:53) at > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) > at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) > at > org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678) > at > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) > at > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) > at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) > at > org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) > at > org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:860) > at > org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1587) > at > org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) > at > java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) > at > java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) > at > org.apache.tomcat.util.threads.Task
[netbeans] branch master updated: [NETBEANS-2653] Generate toString() with StringBuilder (#1288)
This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/netbeans.git The following commit(s) were added to refs/heads/master by this push: new 553ad23 [NETBEANS-2653] Generate toString() with StringBuilder (#1288) 553ad23 is described below commit 553ad23798e93b677b4fa8a054e275a8272dd75e Author: Junichi Yamamoto AuthorDate: Sun Sep 8 06:24:02 2019 +0900 [NETBEANS-2653] Generate toString() with StringBuilder (#1288) --- .../modules/java/editor/codegen/Bundle.properties | 1 + .../java/editor/codegen/ToStringGenerator.java | 148 ++-- .../java/editor/codegen/ui/ToStringPanel.java | 34 +- .../java/editor/codegen/ToStringGeneratorTest.java | 372 + 4 files changed, 525 insertions(+), 30 deletions(-) diff --git a/java/java.editor/src/org/netbeans/modules/java/editor/codegen/Bundle.properties b/java/java.editor/src/org/netbeans/modules/java/editor/codegen/Bundle.properties index 4f45a1b..4056430 100644 --- a/java/java.editor/src/org/netbeans/modules/java/editor/codegen/Bundle.properties +++ b/java/java.editor/src/org/netbeans/modules/java/editor/codegen/Bundle.properties @@ -42,6 +42,7 @@ LBL_hashcode_select=Select fields to be included in hashCode(): LBL_tostring=toString()... LBL_generate_tostring=Generate toString() LBL_tostring_select=Select fields to be included in toString(): +LBL_tostring_use_stringbuilder=&Use StringBuilder LBL_implement_method=Implement Method... LBL_generate_implement=Generate Implement Methods LBL_implement_method_select=Select methods to implement: diff --git a/java/java.editor/src/org/netbeans/modules/java/editor/codegen/ToStringGenerator.java b/java/java.editor/src/org/netbeans/modules/java/editor/codegen/ToStringGenerator.java index 718b749..e0ccca1 100644 --- a/java/java.editor/src/org/netbeans/modules/java/editor/codegen/ToStringGenerator.java +++ b/java/java.editor/src/org/netbeans/modules/java/editor/codegen/ToStringGenerator.java @@ -22,8 +22,11 @@ import com.sun.source.tree.AnnotationTree; import com.sun.source.tree.BlockTree; import com.sun.source.tree.ClassTree; import com.sun.source.tree.ExpressionTree; +import com.sun.source.tree.IdentifierTree; +import com.sun.source.tree.MethodInvocationTree; import com.sun.source.tree.MethodTree; import com.sun.source.tree.ModifiersTree; +import com.sun.source.tree.NewClassTree; import com.sun.source.tree.StatementTree; import com.sun.source.tree.Tree; import com.sun.source.tree.TypeParameterTree; @@ -37,17 +40,19 @@ import java.util.EnumSet; import java.util.LinkedList; import java.util.List; import java.util.Set; +import javax.lang.model.SourceVersion; import javax.lang.model.element.Element; import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.Modifier; import javax.lang.model.element.TypeElement; import javax.lang.model.element.VariableElement; import javax.swing.text.JTextComponent; -import org.netbeans.api.java.source.Task; +import org.netbeans.api.annotations.common.CheckForNull; import org.netbeans.api.java.source.CompilationController; import org.netbeans.api.java.source.ElementHandle; import org.netbeans.api.java.source.JavaSource; import org.netbeans.api.java.source.ModificationResult; +import org.netbeans.api.java.source.Task; import org.netbeans.api.java.source.TreeMaker; import org.netbeans.api.java.source.TreeUtilities; import org.netbeans.api.java.source.WorkingCopy; @@ -66,9 +71,9 @@ import org.openide.util.NbBundle; */ public class ToStringGenerator implements CodeGenerator { -public static class Factory implements CodeGenerator.Factory { +private static final String ERROR = ""; //NOI18N -private static final String ERROR = ""; //NOI18N +public static class Factory implements CodeGenerator.Factory { @Override public List create(Lookup context) { @@ -92,31 +97,65 @@ public class ToStringGenerator implements CodeGenerator { if (typeElement == null || !typeElement.getKind().isClass()) { return ret; } -List descriptions = new ArrayList<>(); -for (Element element : typeElement.getEnclosedElements()) { -switch (element.getKind()) { -case METHOD: -if (element.getSimpleName().contentEquals("toString") && ((ExecutableElement) element).getParameters().isEmpty()) { //NOI18N -return ret; -} -break; -case FIELD: -if (!ERROR.contentEquals(element.getSimpleName()) && !element.getModifiers().contains(Modifier.STATIC)) { - descriptions.add(ElementNode.Description.create(controller, element, null, true, true)); -} -} +ToStringGenerator g
[jira] [Resolved] (NETBEANS-2653) Generate toString() with StringBuilder
[ https://issues.apache.org/jira/browse/NETBEANS-2653?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Junichi Yamamoto resolved NETBEANS-2653. Fix Version/s: 11.2 Resolution: Fixed > Generate toString() with StringBuilder > -- > > Key: NETBEANS-2653 > URL: https://issues.apache.org/jira/browse/NETBEANS-2653 > Project: NetBeans > Issue Type: Improvement > Components: java - Editor >Affects Versions: 11.0 >Reporter: Junichi Yamamoto >Assignee: Junichi Yamamoto >Priority: Major > Labels: pull-request-available > Fix For: 11.2 > > Time Spent: 2h 40m > Remaining Estimate: 0h > > Currently, the following toString() is inserted using "insert code" feature: > {code:java} > public class NewClass { > private final String test = "test"; > private final String test2 = "test"; > private final String test3 = "test"; > @Override > public String toString() { > // generate toString() with "+" operator > return "NewClass{" + "test=" + test + ", test2=" + test2 + ", test3=" > + test3 + '}'; > } > } > {code} > Add a check box to the panel for using StringBuilder, then insert the > following toString(): > {code:java} > public class NewClass { > private final String test = "test"; > private final String test2 = "test"; > private final String test3 = "test"; > @Override > public String toString() { > StringBuilder sb = new StringBuilder(); > sb.append("NewClass{test=").append(test); > sb.append(", test2=").append(test2); > sb.append(", test3=").append(test3); > sb.append('}'); > return sb.toString(); > } > } > {code} -- This message was sent by Atlassian Jira (v8.3.2#803003) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[jira] [Assigned] (NETBEANS-3070) Netbeans unable to copy context XML file from Temp folder to Catalina/localhost
[ https://issues.apache.org/jira/browse/NETBEANS-3070?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pramod Chandra reassigned NETBEANS-3070: Assignee: Thurman Turner (was: Alex Lumpov) > Netbeans unable to copy context XML file from Temp folder to > Catalina/localhost > --- > > Key: NETBEANS-3070 > URL: https://issues.apache.org/jira/browse/NETBEANS-3070 > Project: NetBeans > Issue Type: Bug > Components: javaee - Maven >Affects Versions: 11.1 > Environment: Windows 10, 64 bit, Apache Netbeans 11.1, JDK 11, JRE > 8u221 >Reporter: Pramod Chandra >Assignee: Thurman Turner >Priority: Major > Labels: beginner, newbie > Fix For: 11.1 > > Attachments: Catalina log.JPG, Maven.JPG > > > Steps to reproduce: > > Create a new web application using maven on Apache Netbeans 11.1 > Choose the Server as Tomcat 9.0 > Right Click on the project and select Clean and Build > After the message "Build Successful" run the project > Error in Netbeans: > In-place deployment at C:\Users\Pramod > Chandra\Documents\NetBeansProjects\mavenTest\target\mavenTest-1 > Deployment is in progress... > deploy?config=file%3A%2FC%3A%2FUsers%2FPramod%2520Chandra%2FAppData%2FLocal%2FTemp%2Fcontext11250002610202739917.xml&path=/mavenTest > FAIL - Failed to deploy application at context path [/mavenTest] > > Error in server.log > > 06-Sep-2019 09:41:51.080 SEVERE [http-nio-8080-exec-158] > org.apache.catalina.startup.ExpandWar.copy Error copying > [C:\Users\Pramod%20Chandra\AppData\Local\Temp\context11250002610202739917.xml] > to [C:\Program Files\Apache Software Foundation\Tomcat > 9.0\conf\Catalina\localhost\mavenTest.xml]06-Sep-2019 09:41:51.080 SEVERE > [http-nio-8080-exec-158] org.apache.catalina.startup.ExpandWar.copy Error > copying > [C:\Users\Pramod%20Chandra\AppData\Local\Temp\context11250002610202739917.xml] > to [C:\Program Files\Apache Software Foundation\Tomcat > 9.0\conf\Catalina\localhost\mavenTest.xml] java.io.FileNotFoundException: > C:\Users\Pramod%20Chandra\AppData\Local\Temp\context11250002610202739917.xml > (The system cannot find the path specified) at > java.base/java.io.FileInputStream.open0(Native Method) at > java.base/java.io.FileInputStream.open(FileInputStream.java:219) at > java.base/java.io.FileInputStream.(FileInputStream.java:157) at > org.apache.catalina.startup.ExpandWar.copy(ExpandWar.java:276) at > org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:1002) > at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:355) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) at > javax.servlet.http.HttpServlet.service(HttpServlet.java:741) at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) > at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) > at > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) > at > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) > at > org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:643) > at > org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:348) > at > org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:53) at > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) > at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) > at > org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678) > at > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) > at > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) > at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) > at > org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) > at > org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:860) > at > org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1587) > at > org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) > at > java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) > at > java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) > at > org.apach