From robert.field at oracle.com Mon Mar 2 02:44:37 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Mon, 02 Mar 2015 02:44:37 +0000 Subject: hg: kulla/dev/langtools: Implement line number mapping. Correct line numbers in stack traces. Reenable line number check in assertStackTrace. Message-ID: <201503020244.t222ibb9000473@aojmv0008> Changeset: 86b93302d08b Author: rfield Date: 2015-03-01 18:44 -0800 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/86b93302d08b Implement line number mapping. Correct line numbers in stack traces. Reenable line number check in assertStackTrace. ! repl/src/impl/EvalStateImpl.java ! repl/src/impl/GeneralWrap.java ! repl/src/impl/OuterWrap.java ! repl/src/impl/ResolutionStatusImpl.java ! repl/src/impl/SourceCodeAnalysisImpl.java ! repl/src/impl/Wrap.java ! repl/testng/test/ExceptionsTest.java From robert.field at oracle.com Mon Mar 2 02:54:46 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Mon, 02 Mar 2015 02:54:46 +0000 Subject: hg: kulla/dev/langtools: Update TODO. Errors to zero. Message-ID: <201503020254.t222sk9v002604@aojmv0008> Changeset: 0f29d00e0bff Author: rfield Date: 2015-03-01 18:54 -0800 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/0f29d00e0bff Update TODO. Errors to zero. ! repl/TODO ! repl/testng/test/ExceptionsTest.java ! repl/testng/test/ReplaceTest.java From robert.field at oracle.com Mon Mar 2 06:43:06 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Mon, 02 Mar 2015 06:43:06 +0000 Subject: hg: kulla/dev/langtools: Handle nested classes within redefined (Modified) declaration. Fixes, for example, void f() { class A {} g(); } void g() {} Message-ID: <201503020643.t226h7U7013108@aojmv0008> Changeset: e5e55307b2d1 Author: rfield Date: 2015-03-01 22:42 -0800 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/e5e55307b2d1 Handle nested classes within redefined (Modified) declaration. Fixes, for example, void f() { class A {} g(); } void g() {} ! repl/TODO ! repl/src/impl/EvalStateImpl.java ! repl/src/impl/JDIExecution.java ! repl/testng/test/ReplaceTest.java From andrei.eremeev at oracle.com Mon Mar 2 09:50:01 2015 From: andrei.eremeev at oracle.com (andrei.eremeev) Date: Mon, 02 Mar 2015 12:50:01 +0300 Subject: Bug: Calling /vars or /v adds new snippets to /list. Message-ID: <54F43249.1020003@oracle.com> Hi REPL team, -> double a; | Added variable a of type double -> a + 10 | Expression value is: 10.0 | assigned to temporary variable $1 of type double -> /list 9 : double a; 10 : a + 10; -> /vars | double a = 0.0 | double $1 = 10.0 -> /list 9 : double a; 10 : a + 10; 11 : a; 12 : $1; Andrei Eremeev From andrei.eremeev at oracle.com Mon Mar 2 15:02:18 2015 From: andrei.eremeev at oracle.com (andrei.eremeev at oracle.com) Date: Mon, 02 Mar 2015 15:02:18 +0000 Subject: hg: kulla/dev/langtools: Tests for REPL shell commands: /list, /vars, /methods, /classes Message-ID: <201503021502.t22F2I0u027839@aojmv0008> Changeset: 67b52e07ccc9 Author: aeremeev Date: 2015-03-02 18:02 +0300 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/67b52e07ccc9 Tests for REPL shell commands: /list, /vars, /methods, /classes ! repl/testng/test/ReplToolTesting.java ! repl/testng/test/ToolBasicTest.java From robert.field at oracle.com Tue Mar 3 06:11:29 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Tue, 03 Mar 2015 06:11:29 +0000 Subject: hg: kulla/dev/langtools: Add Key for access to information about current declaration. Message-ID: <201503030611.t236BUJM010553@aojmv0008> Changeset: a5e7833dfe10 Author: rfield Date: 2015-03-02 22:11 -0800 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/a5e7833dfe10 Add Key for access to information about current declaration. + repl/src/api/Key.java ! repl/src/api/SnippetInfo.java ! repl/src/impl/EvalStateImpl.java ! repl/src/impl/SnippetImpl.java ! repl/src/impl/SnippetMaps.java ! repl/src/tool/Repl.java ! repl/testng/stress/DeclareStressTest.java ! repl/testng/test/ExceptionsTest.java ! repl/testng/test/KullaTesting.java From robert.field at oracle.com Tue Mar 3 06:54:04 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Tue, 03 Mar 2015 06:54:04 +0000 Subject: hg: kulla/dev/langtools: Retrieve ResolutionStatus by Key. Message-ID: <201503030654.t236s4o6018164@aojmv0008> Changeset: d28b39507ace Author: rfield Date: 2015-03-02 22:53 -0800 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/d28b39507ace Retrieve ResolutionStatus by Key. ! repl/src/api/EvalState.java ! repl/src/impl/EvalStateImpl.java ! repl/src/tool/Repl.java ! repl/testng/stress/DeclareStressTest.java ! repl/testng/test/KullaTesting.java ! repl/testng/test/ReplaceTest.java ! repl/testng/test/SimpleRegressionTest.java From andrei.eremeev at oracle.com Tue Mar 3 10:29:08 2015 From: andrei.eremeev at oracle.com (andrei.eremeev at oracle.com) Date: Tue, 03 Mar 2015 10:29:08 +0000 Subject: hg: kulla/dev/langtools: Added tests for classes, method and fields declared within a user class. Message-ID: <201503031029.t23AT8Q6004677@aojmv0008> Changeset: 0940123ab85d Author: aeremeev Date: 2015-03-03 13:28 +0300 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/0940123ab85d Added tests for classes, method and fields declared within a user class. Added a test for method to for forward class dependency. ! repl/TODO + repl/testng/test/ClassMembersTest.java ! repl/testng/test/ReplaceTest.java From andrei.eremeev at oracle.com Tue Mar 3 12:45:34 2015 From: andrei.eremeev at oracle.com (andrei.eremeev) Date: Tue, 03 Mar 2015 15:45:34 +0300 Subject: Bugs Message-ID: <54F5ACEE.3080901@oracle.com> Hi REPL team, Bugs: 1. Runtime visible annotations cannot be retrieved. (See test.ClassMembersTest#testAnnotation()) 2. IllegalArgumentException is not thrown by currentResolution when key is a snippet of another state: SnippetInfo info = assertEval1("class A { void f() {}}"); EvalProcessing evalProcessing = EvalProcessing.create(new TestingInputStream(), new PrintStream(new ByteArrayOutputStream()), new PrintStream(new ByteArrayOutputStream())); try (EvalState state = evalProcessing.evalState()) { List results = state.eval("class A { int f() { return 0; } }"); assertEquals(results.size(), 1, "Too much snippets"); EvalResult result = results.get(0); assertTrue(result.outcome.success, "Compilation failed"); state.currentResolution(info.key()); } Andrei Eremeev From robert.field at oracle.com Tue Mar 3 19:15:20 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Tue, 03 Mar 2015 19:15:20 +0000 Subject: hg: kulla/dev/langtools: Add varValue(Key) to API. Use in REPL tool. Fixes /vars adds to /list. Message-ID: <201503031915.t23JFLvv001441@aojmv0008> Changeset: f26e8d3b5163 Author: rfield Date: 2015-03-03 11:15 -0800 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/f26e8d3b5163 Add varValue(Key) to API. Use in REPL tool. Fixes /vars adds to /list. ! repl/TODO ! repl/src/api/EvalState.java ! repl/src/impl/EvalStateImpl.java ! repl/src/impl/JDIExecution.java ! repl/src/remote/RemoteAgent.java ! repl/src/remote/RemoteCodes.java ! repl/src/tool/Repl.java ! repl/testng/test/ClassMembersTest.java ! repl/testng/test/KullaTesting.java ! repl/testng/test/VariablesTest.java From andrei.eremeev at oracle.com Tue Mar 3 20:21:03 2015 From: andrei.eremeev at oracle.com (andrei.eremeev) Date: Tue, 03 Mar 2015 23:21:03 +0300 Subject: New bugs Message-ID: <54F617AF.8030204@oracle.com> Hi REPL team, 1. /c or /classes prints "class" for enums and annotations, while "interface" is printed for interfaces. -> @interface A {} | Added annotation interface A -> /c | class A -> enum A {} | Replaced enum A -> /c | class A -> interface A {} | Replaced interface A -> /c | interface A 2. IllegalArgumentException is not thrown when currentDeclaration is called on the snippet declared in another state. See the provided example (The appropriate test will be pushed soon). SnippetInfo info = assertEval1("class A { void f() {} }"); EvalProcessing evalProcessing = EvalProcessing.create(newTestingInputStream(), newPrintStream(newByteArrayOutputStream()), newPrintStream(newByteArrayOutputStream())); try(EvalState state = evalProcessing.evalState()) { List results = state.eval("class A { int f() { return 0; } }"); assertEquals(results.size(),1,"Too much snippets"); EvalResult result = results.get(0); assertTrue(result.outcome.success,"Compilation failed"); state.currentResolution(info.key()); } 3. It looks like addToClasspath is broken, REPL cannot find any classes added to classpath. Andrei Eremeev From andrei.eremeev at oracle.com Tue Mar 3 20:36:22 2015 From: andrei.eremeev at oracle.com (andrei.eremeev at oracle.com) Date: Tue, 03 Mar 2015 20:36:22 +0000 Subject: hg: kulla/dev/langtools: Exclude tests with failures. Bugs have been added to TODO. Message-ID: <201503032036.t23KaMmK019967@aojmv0008> Changeset: 3903a9dbded8 Author: aeremeev Date: 2015-03-03 23:35 +0300 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/3903a9dbded8 Exclude tests with failures. Bugs have been added to TODO. ! repl/TODO ! repl/testng/test/KullaTesting.java ! repl/testng/test/ReplaceTest.java ! repl/testng/test/ToolBasicTest.java From robert.field at oracle.com Tue Mar 3 20:53:07 2015 From: robert.field at oracle.com (Robert Field) Date: Tue, 03 Mar 2015 12:53:07 -0800 Subject: New bugs In-Reply-To: <54F617AF.8030204@oracle.com> References: <54F617AF.8030204@oracle.com> Message-ID: <54F61F33.6090003@oracle.com> On 03/03/15 12:21, andrei.eremeev wrote: > Hi REPL team, > > 1. /c or /classes prints "class" for enums and annotations, while > "interface" is printed for interfaces. > -> @interface A {} > | Added annotation interface A > > -> /c > | class A > > -> enum A {} > | Replaced enum A > > -> /c > | class A > > -> interface A {} > | Replaced interface A > > -> /c > | interface A Thanks for the test and TODO. Fortunately that will be easy to fix ;-) > > 2. IllegalArgumentException is not thrown when currentDeclaration is > called on the snippet declared in another state. > See the provided example (The appropriate test will be pushed soon). > > SnippetInfo info = assertEval1("class A { void f() {} }"); > EvalProcessing evalProcessing = > EvalProcessing.create(newTestingInputStream(), > newPrintStream(newByteArrayOutputStream()), > newPrintStream(newByteArrayOutputStream())); > try(EvalState state = evalProcessing.evalState()) { > List results = state.eval("class A { int f() { return > 0; } }"); > assertEquals(results.size(),1,"Too much snippets"); > EvalResult result = results.get(0); > assertTrue(result.outcome.success,"Compilation failed"); > state.currentResolution(info.key()); > } Thanks for the test and TODO. > > 3. It looks like addToClasspath is broken, REPL cannot find any > classes added to classpath. My ad hoc tests worked. Given that testing this needs side files, wasn't sure of the "right" way to add to the test framework. Can you add tests that show it failing? Thanks, Robert > > Andrei Eremeev From andrei.eremeev at oracle.com Tue Mar 3 20:59:57 2015 From: andrei.eremeev at oracle.com (andrei.eremeev) Date: Tue, 03 Mar 2015 23:59:57 +0300 Subject: New bugs In-Reply-To: <54F61F33.6090003@oracle.com> References: <54F617AF.8030204@oracle.com> <54F61F33.6090003@oracle.com> Message-ID: <54F620CD.5050409@oracle.com> I tried classpath manually. -> new Test(); | Error: | cannot find symbol | symbol: class Test | new Test(); | ^---^ -> /cp . | Path . added to classpath -> new Test(); | Error: | cannot find symbol | symbol: class Test | new Test(); | ^---^ -> | State engine terminated. Resetting... andrei-eremeev at aeremeev:/export/data/repositories/repl/langtools/repl$ ls Test* Test.class Test.java As you can see, current directory contains class Test, but REPL cannot find it. I will add a thorough test suite for classpath (API and shell) tomorrow. Andrei Eremeev On 03/03/2015 11:53 PM, Robert Field wrote: > > On 03/03/15 12:21, andrei.eremeev wrote: >> Hi REPL team, >> >> 1. /c or /classes prints "class" for enums and annotations, while >> "interface" is printed for interfaces. >> -> @interface A {} >> | Added annotation interface A >> >> -> /c >> | class A >> >> -> enum A {} >> | Replaced enum A >> >> -> /c >> | class A >> >> -> interface A {} >> | Replaced interface A >> >> -> /c >> | interface A > > Thanks for the test and TODO. Fortunately that will be easy to fix ;-) > >> >> 2. IllegalArgumentException is not thrown when currentDeclaration is >> called on the snippet declared in another state. >> See the provided example (The appropriate test will be pushed soon). >> >> SnippetInfo info = assertEval1("class A { void f() {} }"); >> EvalProcessing evalProcessing = >> EvalProcessing.create(newTestingInputStream(), >> newPrintStream(newByteArrayOutputStream()), >> newPrintStream(newByteArrayOutputStream())); >> try(EvalState state = evalProcessing.evalState()) { >> List results = state.eval("class A { int f() { return >> 0; } }"); >> assertEquals(results.size(),1,"Too much snippets"); >> EvalResult result = results.get(0); >> assertTrue(result.outcome.success,"Compilation failed"); >> state.currentResolution(info.key()); >> } > > Thanks for the test and TODO. > >> >> 3. It looks like addToClasspath is broken, REPL cannot find any >> classes added to classpath. > > My ad hoc tests worked. Given that testing this needs side files, > wasn't sure of the "right" way to add to the test framework. Can you > add tests that show it failing? > > Thanks, > Robert > >> >> Andrei Eremeev > From robert.field at oracle.com Tue Mar 3 21:19:15 2015 From: robert.field at oracle.com (Robert Field) Date: Tue, 03 Mar 2015 13:19:15 -0800 Subject: New bugs In-Reply-To: <54F620CD.5050409@oracle.com> References: <54F617AF.8030204@oracle.com> <54F61F33.6090003@oracle.com> <54F620CD.5050409@oracle.com> Message-ID: <54F62553.3020506@oracle.com> On 03/03/15 12:59, andrei.eremeev wrote: > I tried classpath manually. > > -> new Test(); > | Error: > | cannot find symbol > | symbol: class Test > | new Test(); > | ^---^ > > -> /cp . > | Path . added to classpath > > -> new Test(); > | Error: > | cannot find symbol > | symbol: class Test > | new Test(); > | ^---^ > > -> | State engine terminated. Resetting... > andrei-eremeev at aeremeev:/export/data/repositories/repl/langtools/repl$ > ls Test* > Test.class Test.java > > As you can see, current directory contains class Test, but REPL cannot > find it. The unnamed package is unique: http://docs.oracle.com/javase/specs/jls/se8/html/jls-7.html#jls-7.4.2 This works with named packages. > I will add a thorough test suite for classpath (API and shell) tomorrow. Thanks, Robert > > Andrei Eremeev > > On 03/03/2015 11:53 PM, Robert Field wrote: >> >> On 03/03/15 12:21, andrei.eremeev wrote: >>> Hi REPL team, >>> >>> 1. /c or /classes prints "class" for enums and annotations, while >>> "interface" is printed for interfaces. >>> -> @interface A {} >>> | Added annotation interface A >>> >>> -> /c >>> | class A >>> >>> -> enum A {} >>> | Replaced enum A >>> >>> -> /c >>> | class A >>> >>> -> interface A {} >>> | Replaced interface A >>> >>> -> /c >>> | interface A >> >> Thanks for the test and TODO. Fortunately that will be easy to fix >> ;-) >> >>> >>> 2. IllegalArgumentException is not thrown when currentDeclaration is >>> called on the snippet declared in another state. >>> See the provided example (The appropriate test will be pushed soon). >>> >>> SnippetInfo info = assertEval1("class A { void f() {} }"); >>> EvalProcessing evalProcessing = >>> EvalProcessing.create(newTestingInputStream(), >>> newPrintStream(newByteArrayOutputStream()), >>> newPrintStream(newByteArrayOutputStream())); >>> try(EvalState state = evalProcessing.evalState()) { >>> List results = state.eval("class A { int f() { >>> return 0; } }"); >>> assertEquals(results.size(),1,"Too much snippets"); >>> EvalResult result = results.get(0); >>> assertTrue(result.outcome.success,"Compilation failed"); >>> state.currentResolution(info.key()); >>> } >> >> Thanks for the test and TODO. >> >>> >>> 3. It looks like addToClasspath is broken, REPL cannot find any >>> classes added to classpath. >> >> My ad hoc tests worked. Given that testing this needs side files, >> wasn't sure of the "right" way to add to the test framework. Can you >> add tests that show it failing? >> >> Thanks, >> Robert >> >>> >>> Andrei Eremeev >> > From robert.field at oracle.com Wed Mar 4 02:19:28 2015 From: robert.field at oracle.com (Robert Field) Date: Tue, 03 Mar 2015 18:19:28 -0800 Subject: Bug: Calling /vars or /v adds new snippets to /list. In-Reply-To: <54F43249.1020003@oracle.com> References: <54F43249.1020003@oracle.com> Message-ID: <54F66BB0.10006@oracle.com> Fix pushed. -Robert On 03/02/15 01:50, andrei.eremeev wrote: > Hi REPL team, > > -> double a; > | Added variable a of type double > > -> a + 10 > | Expression value is: 10.0 > | assigned to temporary variable $1 of type double > > -> /list > > 9 : double a; > 10 : a + 10; > > > -> /vars > | double a = 0.0 > | double $1 = 10.0 > > -> /list > > 9 : double a; > 10 : a + 10; > 11 : a; > 12 : $1; > > Andrei Eremeev From robert.field at oracle.com Wed Mar 4 04:32:08 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Wed, 04 Mar 2015 04:32:08 +0000 Subject: hg: kulla/dev/langtools: Fix: REPL tool: /classes prints class for enums and annotation interfaces. Reenable test.ToolBasicTest#defineClasses(). Message-ID: <201503040432.t244W8QL026072@aojmv0008> Changeset: a37a1a03f813 Author: rfield Date: 2015-03-03 20:31 -0800 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/a37a1a03f813 Fix: REPL tool: /classes prints class for enums and annotation interfaces. Reenable test.ToolBasicTest#defineClasses(). ! repl/src/tool/Repl.java ! repl/testng/test/ReplToolTesting.java ! repl/testng/test/ToolBasicTest.java From andrei.eremeev at oracle.com Wed Mar 4 16:56:34 2015 From: andrei.eremeev at oracle.com (andrei.eremeev) Date: Wed, 04 Mar 2015 19:56:34 +0300 Subject: Bug Message-ID: <54F73942.70808@oracle.com> Hi REPL team, Classes added to class path should hide lib classes when they have the same name. See excluded tests in test.ClassPathTest. Andrei Eremeev From andrei.eremeev at oracle.com Wed Mar 4 16:59:02 2015 From: andrei.eremeev at oracle.com (andrei.eremeev at oracle.com) Date: Wed, 04 Mar 2015 16:59:02 +0000 Subject: hg: kulla/dev/langtools: Added missing copyright. Message-ID: <201503041659.t24Gx2I4024586@aojmv0008> Changeset: 13ff4a22aa88 Author: aeremeev Date: 2015-03-04 19:58 +0300 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/13ff4a22aa88 Added missing copyright. Added tests for class path API. Added convenience class for compile and jar tasks. ! repl/testng/test/ClassMembersTest.java + repl/testng/test/ClassPathTest.java + repl/testng/test/Compiler.java ! repl/testng/test/ImportTest.java ! repl/testng/test/KullaDeclareStressTest.java ! repl/testng/test/KullaTesting.java From robert.field at oracle.com Wed Mar 4 17:12:42 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Wed, 04 Mar 2015 17:12:42 +0000 Subject: hg: kulla/dev/langtools: Clarify classpath semantics. Message-ID: <201503041712.t24HCgpI026919@aojmv0008> Changeset: c1328331da0b Author: rfield Date: 2015-03-04 09:12 -0800 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/c1328331da0b Clarify classpath semantics. ! repl/TODO ! repl/src/api/EvalState.java From robert.field at oracle.com Thu Mar 5 02:46:51 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Thu, 05 Mar 2015 02:46:51 +0000 Subject: hg: kulla/dev/langtools: On compile error with multiline input, print only error line. Fix handling of bad unclsoed string literal terminating in backlash. Message-ID: <201503050246.t252kqGu022584@aojmv0008> Changeset: 7827f28e02ed Author: rfield Date: 2015-03-04 18:46 -0800 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/7827f28e02ed On compile error with multiline input, print only error line. Fix handling of bad unclsoed string literal terminating in backlash. ! repl/TODO ! repl/src/impl/SourceCodeAnalysisImpl.java ! repl/src/tool/Repl.java ! repl/testng/test/ClassPathTest.java ! repl/testng/test/Compiler.java ! repl/testng/test/CompletenessTest.java ! repl/testng/test/ToolBasicTest.java From robert.field at oracle.com Fri Mar 6 01:29:52 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Fri, 06 Mar 2015 01:29:52 +0000 Subject: hg: kulla/dev/langtools: At the API eval() level, for expressions, use the JLS expressions, no semicolon. While still allowing expression statements. Thus eliminating the awkward 'x' becoming 'x; '. Message-ID: <201503060129.t261TqFw021320@aojmv0008> Changeset: 1a63f75fb59e Author: rfield Date: 2015-03-05 17:29 -0800 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/1a63f75fb59e At the API eval() level, for expressions, use the JLS expressions, no semicolon. While still allowing expression statements. Thus eliminating the awkward 'x' becoming 'x;'. ! repl/TODO ! repl/src/impl/CompletenessAnalyzer.java ! repl/src/impl/EvalStateImpl.java ! repl/src/impl/ReplParser.java ! repl/src/impl/SourceCodeAnalysisImpl.java ! repl/testng/stress/CompletenessStressTest.java ! repl/testng/test/AnalysisTest.java ! repl/testng/test/CompletenessTest.java ! repl/testng/test/ReplToolTesting.java From andrei.eremeev at oracle.com Fri Mar 6 12:02:31 2015 From: andrei.eremeev at oracle.com (andrei.eremeev at oracle.com) Date: Fri, 06 Mar 2015 12:02:31 +0000 Subject: hg: kulla/dev/langtools: Tests for /classpath, EvalState#addToClasspath and start-up -classpath. Message-ID: <201503061202.t26C2V6H018884@aojmv0008> Changeset: 4ff476e9dee4 Author: aeremeev Date: 2015-03-06 15:01 +0300 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/4ff476e9dee4 Tests for /classpath, EvalState#addToClasspath and start-up -classpath. Moving all tests to default package. ! repl/TODO ! repl/scripts/stress.sh ! repl/scripts/test.sh ! repl/testng/stress.xml ! repl/testng/stress/CompletenessStressTest.java ! repl/testng/stress/DeclareStressTest.java ! repl/testng/stress/StressTestBase.java ! repl/testng/test/AnalysisTest.java ! repl/testng/test/ClassMembersTest.java ! repl/testng/test/ClassPathTest.java ! repl/testng/test/ClassesTest.java ! repl/testng/test/Compiler.java ! repl/testng/test/CompletenessTest.java ! repl/testng/test/CompletionTest.java ! repl/testng/test/EmptyTest.java ! repl/testng/test/ExceptionsTest.java ! repl/testng/test/IOTest.java ! repl/testng/test/IgnoreTest.java ! repl/testng/test/ImportTest.java ! repl/testng/test/KullaCompletenessStressTest.java ! repl/testng/test/KullaDeclareStressTest.java ! repl/testng/test/KullaTesting.java ! repl/testng/test/MethodsTest.java ! repl/testng/test/ModifiersTest.java ! repl/testng/test/NullTest.java ! repl/testng/test/ReplToolTesting.java ! repl/testng/test/ReplaceTest.java ! repl/testng/test/SanityTest.java ! repl/testng/test/ShutdownTest.java ! repl/testng/test/SimpleRegressionTest.java ! repl/testng/test/SnippetTest.java ! repl/testng/test/TestingInputStream.java ! repl/testng/test/ToolBasicTest.java ! repl/testng/test/TypeNameTest.java ! repl/testng/test/VariablesTest.java ! repl/testng/testng.xml From andrei.eremeev at oracle.com Fri Mar 6 12:06:42 2015 From: andrei.eremeev at oracle.com (andrei.eremeev) Date: Fri, 06 Mar 2015 15:06:42 +0300 Subject: NPE is thrown from VMConnection Message-ID: <54F99852.7010901@oracle.com> Hi REPL team, From times to times NPE is thrown from VMConnection, but none of tests fails. It looks like VMConnection is accessed from several threads. If is true, synchronization should be added. Exception in thread "event-handler" java.lang.NullPointerException at impl.VMConnection.disposeVM(VMConnection.java:379) at impl.JDIEnv.shutdown(JDIEnv.java:57) at impl.JDIEventHandler.handleExitEvent(JDIEventHandler.java:129) at impl.JDIEventHandler.handleEvent(JDIEventHandler.java:109) at impl.JDIEventHandler.run(JDIEventHandler.java:71) at java.lang.Thread.run(Thread.java:745) Andrei Eremeev From andrei.eremeev at oracle.com Fri Mar 6 16:02:51 2015 From: andrei.eremeev at oracle.com (andrei.eremeev at oracle.com) Date: Fri, 06 Mar 2015 16:02:51 +0000 Subject: hg: kulla/dev/langtools: Added tests for /reset, /save, /open commands. Message-ID: <201503061602.t26G2p1f015327@aojmv0008> Changeset: b5c359705d8a Author: aeremeev Date: 2015-03-06 19:01 +0300 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/b5c359705d8a Added tests for /reset, /save, /open commands. ! repl/TODO ! repl/testng/test/ReplToolTesting.java ! repl/testng/test/ToolBasicTest.java From robert.field at oracle.com Fri Mar 6 18:55:21 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Fri, 06 Mar 2015 18:55:21 +0000 Subject: hg: kulla/dev/langtools: Fix NPE in VM shutdown. Message-ID: <201503061855.t26ItL9s023249@aojmv0008> Changeset: fa41aff6d389 Author: rfield Date: 2015-03-06 10:55 -0800 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/fa41aff6d389 Fix NPE in VM shutdown. ! repl/src/impl/VMConnection.java From robert.field at oracle.com Fri Mar 6 18:58:41 2015 From: robert.field at oracle.com (Robert Field) Date: Fri, 06 Mar 2015 10:58:41 -0800 Subject: NPE is thrown from VMConnection In-Reply-To: <54F99852.7010901@oracle.com> References: <54F99852.7010901@oracle.com> Message-ID: <54F9F8E1.3060401@oracle.com> I am unable to reproduce this, which isn't surprising because synchronization is a very platform dependent area. I have just pushed a fix that should address this. If you see other cases of this, please, again, send a stack trace. Thanks, Robert On 03/06/15 04:06, andrei.eremeev wrote: > Hi REPL team, > > From times to times NPE is thrown from VMConnection, but none of tests > fails. > It looks like VMConnection is accessed from several threads. If is > true, synchronization should be added. > > Exception in thread "event-handler" java.lang.NullPointerException > at impl.VMConnection.disposeVM(VMConnection.java:379) > at impl.JDIEnv.shutdown(JDIEnv.java:57) > at impl.JDIEventHandler.handleExitEvent(JDIEventHandler.java:129) > at impl.JDIEventHandler.handleEvent(JDIEventHandler.java:109) > at impl.JDIEventHandler.run(JDIEventHandler.java:71) > at java.lang.Thread.run(Thread.java:745) > > Andrei Eremeev > From robert.field at oracle.com Sat Mar 7 05:23:52 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Sat, 07 Mar 2015 05:23:52 +0000 Subject: hg: kulla/dev/langtools: Handle labelled statements in completion analysis. Message-ID: <201503070523.t275Nq0P022341@aojmv0008> Changeset: 8515ce76bc2d Author: rfield Date: 2015-03-06 21:23 -0800 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/8515ce76bc2d Handle labelled statements in completion analysis. ! repl/TODO ! repl/src/impl/CompletenessAnalyzer.java ! repl/testng/test/CompletenessTest.java From robert.field at oracle.com Mon Mar 9 23:40:43 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Mon, 09 Mar 2015 23:40:43 +0000 Subject: hg: kulla/dev/langtools: Add command line -help and -version. Fix bad command-line crash. Message-ID: <201503092340.t29NehQc025234@aojmv0008> Changeset: 9113c63f504e Author: rfield Date: 2015-03-09 16:40 -0700 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/9113c63f504e Add command line -help and -version. Fix bad command-line crash. ! repl/TODO ! repl/src/tool/Repl.java From jan.lahoda at oracle.com Tue Mar 10 06:18:21 2015 From: jan.lahoda at oracle.com (jan.lahoda at oracle.com) Date: Tue, 10 Mar 2015 06:18:21 +0000 Subject: hg: kulla/dev/langtools: Check accessibility in all contexts. Message-ID: <201503100618.t2A6ILqW002668@aojmv0008> Changeset: 81e6833654e6 Author: jlahoda Date: 2015-03-10 07:18 +0100 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/81e6833654e6 Check accessibility in all contexts. ! repl/src/impl/SourceCodeAnalysisImpl.java ! repl/testng/test/CompletionTest.java ! repl/testng/test/KullaTesting.java From jan.lahoda at oracle.com Tue Mar 10 10:11:01 2015 From: jan.lahoda at oracle.com (jan.lahoda at oracle.com) Date: Tue, 10 Mar 2015 10:11:01 +0000 Subject: hg: kulla/dev/langtools: Detecting target type of a method call argument. Message-ID: <201503101011.t2AAB1gv016095@aojmv0008> Changeset: 1de6c19fa4bd Author: jlahoda Date: 2015-03-10 11:05 +0100 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/1de6c19fa4bd Detecting target type of a method call argument. ! repl/src/impl/SourceCodeAnalysisImpl.java ! repl/testng/test/CompletionTest.java ! repl/testng/test/KullaTesting.java From jan.lahoda at oracle.com Tue Mar 10 14:11:35 2015 From: jan.lahoda at oracle.com (jan.lahoda at oracle.com) Date: Tue, 10 Mar 2015 14:11:35 +0000 Subject: hg: kulla/dev/langtools: 3 new changesets Message-ID: <201503101411.t2AEBZmP003098@aojmv0008> Changeset: 649c9c523f6c Author: jlahoda Date: 2015-03-10 12:38 +0100 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/649c9c523f6c Detecting target types for new-class arguments ! repl/src/impl/SourceCodeAnalysisImpl.java ! repl/testng/test/CompletionTest.java Changeset: 3587a8031e52 Author: jlahoda Date: 2015-03-10 14:00 +0100 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/3587a8031e52 Append '(' or '()' after method completions ! repl/src/impl/SourceCodeAnalysisImpl.java ! repl/testng/test/CompletionTest.java Changeset: b35a457a645e Author: jlahoda Date: 2015-03-10 14:03 +0100 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/b35a457a645e Simplifying "press tab to see more" text as suggested by Robert. ! repl/src/tool/Repl.java From andrei.eremeev at oracle.com Wed Mar 11 09:20:21 2015 From: andrei.eremeev at oracle.com (andrei.eremeev at oracle.com) Date: Wed, 11 Mar 2015 09:20:21 +0000 Subject: hg: kulla/dev/langtools: Removed debug output. Message-ID: <201503110920.t2B9KLip011198@aojmv0008> Changeset: 21293fed3068 Author: aeremeev Date: 2015-03-11 12:20 +0300 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/21293fed3068 Removed debug output. ! repl/testng/test/KullaTesting.java From andrei.eremeev at oracle.com Wed Mar 11 15:25:50 2015 From: andrei.eremeev at oracle.com (andrei.eremeev) Date: Wed, 11 Mar 2015 18:25:50 +0300 Subject: Exception while reading non-existing start-up file Message-ID: <55005E7E.6080506@oracle.com> Hi, -> /startset aaa.txt | Exception while reading init file: java.nio.file.NoSuchFileException: aaa.txt I think the error message might be more attractive. Andrei Eremeev From andrei.eremeev at oracle.com Wed Mar 11 16:07:44 2015 From: andrei.eremeev at oracle.com (andrei.eremeev at oracle.com) Date: Wed, 11 Mar 2015 16:07:44 +0000 Subject: hg: kulla/dev/langtools: Tests for /startset, /startsave, file loading on REPL start. Message-ID: <201503111607.t2BG7i2t005977@aojmv0008> Changeset: 21c096dddf37 Author: aeremeev Date: 2015-03-11 19:06 +0300 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/21c096dddf37 Tests for /startset, /startsave, file loading on REPL start. ! repl/TODO ! repl/scripts/stress.sh ! repl/testng/test/ReplToolTesting.java ! repl/testng/test/ToolBasicTest.java From robert.field at oracle.com Thu Mar 12 17:47:59 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Thu, 12 Mar 2015 17:47:59 +0000 Subject: hg: kulla/dev/langtools: REPL tool: Fix missing argument handling. More consistent and friendly file errors. Command, welcome and feedback clean-ups. Tests: gold-file updates. TODO additions. Message-ID: <201503121747.t2CHlxHO020664@aojmv0008> Changeset: 77891ab4ca30 Author: rfield Date: 2015-03-12 10:47 -0700 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/77891ab4ca30 REPL tool: Fix missing argument handling. More consistent and friendly file errors. Command, welcome and feedback clean-ups. Tests: gold-file updates. TODO additions. ! repl/TODO ! repl/src/tool/Repl.java ! repl/testng/test/ToolBasicTest.java From robert.field at oracle.com Thu Mar 12 18:36:00 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Thu, 12 Mar 2015 18:36:00 +0000 Subject: hg: kulla/dev/langtools: Fix /prompt toggling to work with jline. Remove bad sample file. Message-ID: <201503121836.t2CIa09r001513@aojmv0008> Changeset: 85fa2f00a7d7 Author: rfield Date: 2015-03-12 11:35 -0700 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/85fa2f00a7d7 Fix /prompt toggling to work with jline. Remove bad sample file. ! repl/TODO - repl/samples/fib.repl ! repl/src/tool/Repl.java From robert.field at oracle.com Thu Mar 12 18:37:28 2015 From: robert.field at oracle.com (Robert Field) Date: Thu, 12 Mar 2015 11:37:28 -0700 Subject: Exception while reading non-existing start-up file In-Reply-To: <55005E7E.6080506@oracle.com> References: <55005E7E.6080506@oracle.com> Message-ID: <5501DCE8.6030902@oracle.com> Yep, that's ugly. I've revamped all the file error handling: /open /save /startsave /startset -Robert On 03/11/15 08:25, andrei.eremeev wrote: > Hi, > > -> /startset aaa.txt > | Exception while reading init file: > java.nio.file.NoSuchFileException: aaa.txt > > I think the error message might be more attractive. > > Andrei Eremeev From robert.field at oracle.com Fri Mar 13 04:53:56 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Fri, 13 Mar 2015 04:53:56 +0000 Subject: hg: kulla/dev/langtools: Implement dependency updates on import. For example: forward-reference resolution by import. Message-ID: <201503130453.t2D4rufn004314@aojmv0008> Changeset: f825ab2a64be Author: rfield Date: 2015-03-12 21:53 -0700 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/f825ab2a64be Implement dependency updates on import. For example: forward-reference resolution by import. ! repl/TODO ! repl/src/impl/EvalStateImpl.java ! repl/src/impl/SnippetImpl.java ! repl/src/impl/SnippetMaps.java ! repl/testng/test/SnippetTest.java From andrei.eremeev at oracle.com Fri Mar 13 15:22:41 2015 From: andrei.eremeev at oracle.com (andrei.eremeev) Date: Fri, 13 Mar 2015 18:22:41 +0300 Subject: Bugs Message-ID: <550300C1.60508@oracle.com> Hi REPL team, Found bugs: 1. In completion analysis possible packages are not suggested. "import java.ut|". 2. A user defined method/variable cannot hide a method/field which has been imported. (Maybe, a duplicate) See ReplaceTest#testForwardSingleImportFieldToMethod, ReplaceTest# testForwardSingleImportMethodToMethod 3. This may not be a bug. Anyway, eval() returns string in quotes for String type. Andrei Eremeev From andrei.eremeev at oracle.com Fri Mar 13 15:45:30 2015 From: andrei.eremeev at oracle.com (andrei.eremeev at oracle.com) Date: Fri, 13 Mar 2015 15:45:30 +0000 Subject: hg: kulla/dev/langtools: Added negative tests for /save, /open, /startset, /startsave. Message-ID: <201503131545.t2DFja3c020024@aojmv0008> Changeset: 42bd15fe5e18 Author: aeremeev Date: 2015-03-13 18:45 +0300 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/42bd15fe5e18 Added negative tests for /save, /open, /startset, /startsave. Added tests for import redefinition and imports which make forward-references valid. ! repl/TODO ! repl/testng/stress/CompletenessStressTest.java ! repl/testng/test/ClassPathTest.java ! repl/testng/test/ImportTest.java ! repl/testng/test/ReplaceTest.java ! repl/testng/test/ToolBasicTest.java From robert.field at oracle.com Fri Mar 13 18:01:44 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Fri, 13 Mar 2015 18:01:44 +0000 Subject: hg: kulla/dev/langtools: Defined classes, methods, and vars now trump star imports. Message-ID: <201503131801.t2DI1iph022080@aojmv0008> Changeset: 4a0368df1d69 Author: rfield Date: 2015-03-13 11:01 -0700 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/4a0368df1d69 Defined classes, methods, and vars now trump star imports. ! repl/TODO ! repl/src/impl/SnippetImpl.java ! repl/testng/test/ReplaceTest.java From robert.field at oracle.com Fri Mar 13 18:06:04 2015 From: robert.field at oracle.com (Robert Field) Date: Fri, 13 Mar 2015 11:06:04 -0700 Subject: Bugs In-Reply-To: <550300C1.60508@oracle.com> References: <550300C1.60508@oracle.com> Message-ID: <5503270C.4020906@oracle.com> On 03/13/15 08:22, andrei.eremeev wrote: > Hi REPL team, > > Found bugs: > > 1. In completion analysis possible packages are not suggested. "import > java.ut|". Jan? > 2. A user defined method/variable cannot hide a method/field which has > been imported. (Maybe, a duplicate) > See ReplaceTest#testForwardSingleImportFieldToMethod, ReplaceTest# > testForwardSingleImportMethodToMethod That is a duplicate, but I figured out a way to fix it. So far fixed for star imports. Still need to fix for named imports. Tests reenabled. > > 3. This may not be a bug. Anyway, eval() returns string in quotes for > String type. I sent a query about desired proper behavior here. Got no responses. So, I'm leaving it, for now. -Robert > > Andrei Eremeev From robert.field at oracle.com Fri Mar 13 18:21:44 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Fri, 13 Mar 2015 18:21:44 +0000 Subject: hg: kulla/dev/langtools: TODO update. Message-ID: <201503131821.t2DILjZU025632@aojmv0008> Changeset: 0c7ba6495f61 Author: rfield Date: 2015-03-13 11:21 -0700 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/0c7ba6495f61 TODO update. ! repl/TODO From jan.lahoda at oracle.com Sun Mar 15 16:20:38 2015 From: jan.lahoda at oracle.com (jan.lahoda at oracle.com) Date: Sun, 15 Mar 2015 16:20:38 +0000 Subject: hg: kulla/dev/langtools: Completion should be able to complete packages. Message-ID: <201503151620.t2FGKc58005137@aojmv0008> Changeset: c9b090dded9b Author: jlahoda Date: 2015-03-15 17:10 +0100 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/c9b090dded9b Completion should be able to complete packages. ! repl/src/impl/SourceCodeAnalysisImpl.java ! repl/testng/test/CompletionTest.java From jan.lahoda at oracle.com Sun Mar 15 18:22:08 2015 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Sun, 15 Mar 2015 19:22:08 +0100 Subject: Bugs In-Reply-To: <5503270C.4020906@oracle.com> References: <550300C1.60508@oracle.com> <5503270C.4020906@oracle.com> Message-ID: <5505CDD0.1000408@oracle.com> On 13.3.2015 19:06, Robert Field wrote: > > On 03/13/15 08:22, andrei.eremeev wrote: >> Hi REPL team, >> >> Found bugs: >> >> 1. In completion analysis possible packages are not suggested. "import >> java.ut|". > > Jan? Two problems here (thanks for report!): -the completion did not complete packages in any context. Should be fixed now (is a little bit tricky, as it is not easy to get the list of packages, so completion is listing classes using the JavaFileManager). -completion misbehaving for imports in some cases (in particular for import static). To fix this, I'd like to change the way AnalyzeTask sets AnalyzeTask.cut like this: diff -r c9b090dded9b repl/src/impl/TaskFactory.java --- a/repl/src/impl/TaskFactory.java Sun Mar 15 17:10:33 2015 +0100 +++ b/repl/src/impl/TaskFactory.java Sun Mar 15 19:16:09 2015 +0100 @@ -130,11 +130,9 @@ AnalyzeTask(OuterWrap wrap, String... extraOptions) { super(wrap, extraOptions); - Iterator eit = analyze().iterator(); - if (eit.hasNext()) { - Element e = eit.next(); - TreePath cutp = trees().getPath(e); - this.cut = cutp.getCompilationUnit(); + Iterator cuts = analyze().iterator(); + if (cuts.hasNext()) { + this.cut = cuts.next(); //proc.debug("AnalyzeTask element=%s cutp=%s cut=%s\n", e, cutp, cut); } else { this.cut = null; @@ -142,9 +140,11 @@ } } - private Iterable analyze() { + private Iterable analyze() { try { - return task.analyze(); + Iterable cuts = task.parse(); + task.analyze(); + return cuts; } catch (Exception ex) { throw new InternalError("Exception during analyze - " + ex.getMessage(), ex); } Does this seem OK? Thanks, Jan > >> 2. A user defined method/variable cannot hide a method/field which has >> been imported. (Maybe, a duplicate) >> See ReplaceTest#testForwardSingleImportFieldToMethod, ReplaceTest# >> testForwardSingleImportMethodToMethod > > That is a duplicate, but I figured out a way to fix it. So far fixed > for star imports. Still need to fix for named imports. > > Tests reenabled. > >> >> 3. This may not be a bug. Anyway, eval() returns string in quotes for >> String type. > > I sent a query about desired proper behavior here. Got no responses. > So, I'm leaving it, for now. > > -Robert > >> >> Andrei Eremeev > From robert.field at oracle.com Sun Mar 15 19:29:28 2015 From: robert.field at oracle.com (Robert Field) Date: Sun, 15 Mar 2015 12:29:28 -0700 Subject: Bugs In-Reply-To: <5505CDD0.1000408@oracle.com> References: <550300C1.60508@oracle.com> <5503270C.4020906@oracle.com> <5505CDD0.1000408@oracle.com> Message-ID: <14c1ee991f0.2784.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> That seems fine. It also suggests there might be ways for us to optimize the number of compiler tasks used. Thanks, Robert On March 15, 2015 11:22:13 AM Jan Lahoda wrote: > On 13.3.2015 19:06, Robert Field wrote: > > > > On 03/13/15 08:22, andrei.eremeev wrote: > >> Hi REPL team, > >> > >> Found bugs: > >> > >> 1. In completion analysis possible packages are not suggested. "import > >> java.ut|". > > > > Jan? > > Two problems here (thanks for report!): > -the completion did not complete packages in any context. Should be > fixed now (is a little bit tricky, as it is not easy to get the list of > packages, so completion is listing classes using the JavaFileManager). > -completion misbehaving for imports in some cases (in particular for > import static). To fix this, I'd like to change the way AnalyzeTask sets > AnalyzeTask.cut like this: > diff -r c9b090dded9b repl/src/impl/TaskFactory.java > --- a/repl/src/impl/TaskFactory.java Sun Mar 15 17:10:33 2015 +0100 > +++ b/repl/src/impl/TaskFactory.java Sun Mar 15 19:16:09 2015 +0100 > @@ -130,11 +130,9 @@ > > AnalyzeTask(OuterWrap wrap, String... extraOptions) { > super(wrap, extraOptions); > - Iterator eit = analyze().iterator(); > - if (eit.hasNext()) { > - Element e = eit.next(); > - TreePath cutp = trees().getPath(e); > - this.cut = cutp.getCompilationUnit(); > + Iterator cuts = > analyze().iterator(); > + if (cuts.hasNext()) { > + this.cut = cuts.next(); > //proc.debug("AnalyzeTask element=%s cutp=%s > cut=%s\n", e, cutp, cut); > } else { > this.cut = null; > @@ -142,9 +140,11 @@ > } > } > > - private Iterable analyze() { > + private Iterable analyze() { > try { > - return task.analyze(); > + Iterable cuts = > task.parse(); > + task.analyze(); > + return cuts; > } catch (Exception ex) { > throw new InternalError("Exception during analyze - " > + ex.getMessage(), ex); > } > > Does this seem OK? > > Thanks, > Jan > > > > >> 2. A user defined method/variable cannot hide a method/field which has > >> been imported. (Maybe, a duplicate) > >> See ReplaceTest#testForwardSingleImportFieldToMethod, ReplaceTest# > >> testForwardSingleImportMethodToMethod > > > > That is a duplicate, but I figured out a way to fix it. So far fixed > > for star imports. Still need to fix for named imports. > > > > Tests reenabled. > > > >> > >> 3. This may not be a bug. Anyway, eval() returns string in quotes for > >> String type. > > > > I sent a query about desired proper behavior here. Got no responses. > > So, I'm leaving it, for now. > > > > -Robert > > > >> > >> Andrei Eremeev > > From jan.lahoda at oracle.com Mon Mar 16 12:10:38 2015 From: jan.lahoda at oracle.com (jan.lahoda at oracle.com) Date: Mon, 16 Mar 2015 12:10:38 +0000 Subject: hg: kulla/dev/langtools: Completion for imports. Message-ID: <201503161210.t2GCAdC3016015@aojmv0008> Changeset: 1a4150be63b4 Author: jlahoda Date: 2015-03-16 12:46 +0100 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/1a4150be63b4 Completion for imports. ! repl/src/impl/SourceCodeAnalysisImpl.java ! repl/src/impl/TaskFactory.java ! repl/testng/test/CompletionTest.java From jan.lahoda at oracle.com Mon Mar 16 12:16:06 2015 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Mon, 16 Mar 2015 13:16:06 +0100 Subject: Bugs In-Reply-To: <14c1ee991f0.2784.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> References: <550300C1.60508@oracle.com> <5503270C.4020906@oracle.com> <5505CDD0.1000408@oracle.com> <14c1ee991f0.2784.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> Message-ID: <5506C986.9000309@oracle.com> On 15.3.2015 20:29, Robert Field wrote: > That seems fine. Thanks, completion for imports should work better now. Jan > It also suggests there might be ways for us to optimize the number of > compiler tasks used. > > Thanks, > Robert > > > > On March 15, 2015 11:22:13 AM Jan Lahoda wrote: > >> On 13.3.2015 19:06, Robert Field wrote: >> > >> > On 03/13/15 08:22, andrei.eremeev wrote: >> >> Hi REPL team, >> >> >> >> Found bugs: >> >> >> >> 1. In completion analysis possible packages are not suggested. "import >> >> java.ut|". >> > >> > Jan? >> >> Two problems here (thanks for report!): >> -the completion did not complete packages in any context. Should be >> fixed now (is a little bit tricky, as it is not easy to get the list of >> packages, so completion is listing classes using the JavaFileManager). >> -completion misbehaving for imports in some cases (in particular for >> import static). To fix this, I'd like to change the way AnalyzeTask sets >> AnalyzeTask.cut like this: >> diff -r c9b090dded9b repl/src/impl/TaskFactory.java >> --- a/repl/src/impl/TaskFactory.java Sun Mar 15 17:10:33 2015 +0100 >> +++ b/repl/src/impl/TaskFactory.java Sun Mar 15 19:16:09 2015 +0100 >> @@ -130,11 +130,9 @@ >> >> AnalyzeTask(OuterWrap wrap, String... extraOptions) { >> super(wrap, extraOptions); >> - Iterator eit = analyze().iterator(); >> - if (eit.hasNext()) { >> - Element e = eit.next(); >> - TreePath cutp = trees().getPath(e); >> - this.cut = cutp.getCompilationUnit(); >> + Iterator cuts = >> analyze().iterator(); >> + if (cuts.hasNext()) { >> + this.cut = cuts.next(); >> //proc.debug("AnalyzeTask element=%s cutp=%s >> cut=%s\n", e, cutp, cut); >> } else { >> this.cut = null; >> @@ -142,9 +140,11 @@ >> } >> } >> >> - private Iterable analyze() { >> + private Iterable analyze() { >> try { >> - return task.analyze(); >> + Iterable cuts = >> task.parse(); >> + task.analyze(); >> + return cuts; >> } catch (Exception ex) { >> throw new InternalError("Exception during analyze - " >> + ex.getMessage(), ex); >> } >> >> Does this seem OK? >> >> Thanks, >> Jan >> >> > >> >> 2. A user defined method/variable cannot hide a method/field which has >> >> been imported. (Maybe, a duplicate) >> >> See ReplaceTest#testForwardSingleImportFieldToMethod, ReplaceTest# >> >> testForwardSingleImportMethodToMethod >> > >> > That is a duplicate, but I figured out a way to fix it. So far fixed >> > for star imports. Still need to fix for named imports. >> > >> > Tests reenabled. >> > >> >> >> >> 3. This may not be a bug. Anyway, eval() returns string in quotes for >> >> String type. >> > >> > I sent a query about desired proper behavior here. Got no responses. >> > So, I'm leaving it, for now. >> > >> > -Robert >> > >> >> >> >> Andrei Eremeev >> > > > From andrei.eremeev at oracle.com Mon Mar 16 12:24:05 2015 From: andrei.eremeev at oracle.com (andrei.eremeev) Date: Mon, 16 Mar 2015 15:24:05 +0300 Subject: Bugs In-Reply-To: <5506C986.9000309@oracle.com> References: <550300C1.60508@oracle.com> <5503270C.4020906@oracle.com> <5505CDD0.1000408@oracle.com> <14c1ee991f0.2784.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> <5506C986.9000309@oracle.com> Message-ID: <5506CB65.4030208@oracle.com> Yes, completion works for imports currently. But what about user defined classes in classpath? Let pkg.A be a user defined class. Completion does not work for both import statements and expression statements. > import pk| > new pk| Andrei Eremeev On 03/16/2015 03:16 PM, Jan Lahoda wrote: > On 15.3.2015 20:29, Robert Field wrote: >> That seems fine. > > Thanks, completion for imports should work better now. > > Jan > >> It also suggests there might be ways for us to optimize the number of >> compiler tasks used. >> >> Thanks, >> Robert >> >> >> >> On March 15, 2015 11:22:13 AM Jan Lahoda wrote: >> >>> On 13.3.2015 19:06, Robert Field wrote: >>> > >>> > On 03/13/15 08:22, andrei.eremeev wrote: >>> >> Hi REPL team, >>> >> >>> >> Found bugs: >>> >> >>> >> 1. In completion analysis possible packages are not suggested. >>> "import >>> >> java.ut|". >>> > >>> > Jan? >>> >>> Two problems here (thanks for report!): >>> -the completion did not complete packages in any context. Should be >>> fixed now (is a little bit tricky, as it is not easy to get the list of >>> packages, so completion is listing classes using the JavaFileManager). >>> -completion misbehaving for imports in some cases (in particular for >>> import static). To fix this, I'd like to change the way AnalyzeTask >>> sets >>> AnalyzeTask.cut like this: >>> diff -r c9b090dded9b repl/src/impl/TaskFactory.java >>> --- a/repl/src/impl/TaskFactory.java Sun Mar 15 17:10:33 2015 +0100 >>> +++ b/repl/src/impl/TaskFactory.java Sun Mar 15 19:16:09 2015 +0100 >>> @@ -130,11 +130,9 @@ >>> >>> AnalyzeTask(OuterWrap wrap, String... extraOptions) { >>> super(wrap, extraOptions); >>> - Iterator eit = analyze().iterator(); >>> - if (eit.hasNext()) { >>> - Element e = eit.next(); >>> - TreePath cutp = trees().getPath(e); >>> - this.cut = cutp.getCompilationUnit(); >>> + Iterator cuts = >>> analyze().iterator(); >>> + if (cuts.hasNext()) { >>> + this.cut = cuts.next(); >>> //proc.debug("AnalyzeTask element=%s cutp=%s >>> cut=%s\n", e, cutp, cut); >>> } else { >>> this.cut = null; >>> @@ -142,9 +140,11 @@ >>> } >>> } >>> >>> - private Iterable analyze() { >>> + private Iterable analyze() { >>> try { >>> - return task.analyze(); >>> + Iterable cuts = >>> task.parse(); >>> + task.analyze(); >>> + return cuts; >>> } catch (Exception ex) { >>> throw new InternalError("Exception during analyze - " >>> + ex.getMessage(), ex); >>> } >>> >>> Does this seem OK? >>> >>> Thanks, >>> Jan >>> >>> > >>> >> 2. A user defined method/variable cannot hide a method/field >>> which has >>> >> been imported. (Maybe, a duplicate) >>> >> See ReplaceTest#testForwardSingleImportFieldToMethod, ReplaceTest# >>> >> testForwardSingleImportMethodToMethod >>> > >>> > That is a duplicate, but I figured out a way to fix it. So far fixed >>> > for star imports. Still need to fix for named imports. >>> > >>> > Tests reenabled. >>> > >>> >> >>> >> 3. This may not be a bug. Anyway, eval() returns string in quotes >>> for >>> >> String type. >>> > >>> > I sent a query about desired proper behavior here. Got no responses. >>> > So, I'm leaving it, for now. >>> > >>> > -Robert >>> > >>> >> >>> >> Andrei Eremeev >>> > >> >> From jan.lahoda at oracle.com Mon Mar 16 13:29:42 2015 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Mon, 16 Mar 2015 06:29:42 -0700 (PDT) Subject: Bugs Message-ID: <0b68d284-05a7-4b6d-8a38-89da463b3d1d@default> Hi Andrei, Could you please be more specific - what should I do to see the problem with user classes? I tried to add a jar to the classpath using the "-classpath" command line option and using the "/cp" command, and the completion was completing the packages from the jars. For "new", there was a bug that packages were not listed after new, should be fixed now. Thanks for pointing that out. Thanks, Jan ----- Original Message ----- From: andrei.eremeev at oracle.com To: jan.lahoda at oracle.com, robert.field at oracle.com, kulla-dev at openjdk.java.net Sent: Monday, March 16, 2015 1:24:08 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna Subject: Re: Bugs Yes, completion works for imports currently. But what about user defined classes in classpath? Let pkg.A be a user defined class. Completion does not work for both import statements and expression statements. > import pk| > new pk| Andrei Eremeev On 03/16/2015 03:16 PM, Jan Lahoda wrote: > On 15.3.2015 20:29, Robert Field wrote: >> That seems fine. > > Thanks, completion for imports should work better now. > > Jan > >> It also suggests there might be ways for us to optimize the number of >> compiler tasks used. >> >> Thanks, >> Robert >> >> >> >> On March 15, 2015 11:22:13 AM Jan Lahoda wrote: >> >>> On 13.3.2015 19:06, Robert Field wrote: >>> > >>> > On 03/13/15 08:22, andrei.eremeev wrote: >>> >> Hi REPL team, >>> >> >>> >> Found bugs: >>> >> >>> >> 1. In completion analysis possible packages are not suggested. >>> "import >>> >> java.ut|". >>> > >>> > Jan? >>> >>> Two problems here (thanks for report!): >>> -the completion did not complete packages in any context. Should be >>> fixed now (is a little bit tricky, as it is not easy to get the list of >>> packages, so completion is listing classes using the JavaFileManager). >>> -completion misbehaving for imports in some cases (in particular for >>> import static). To fix this, I'd like to change the way AnalyzeTask >>> sets >>> AnalyzeTask.cut like this: >>> diff -r c9b090dded9b repl/src/impl/TaskFactory.java >>> --- a/repl/src/impl/TaskFactory.java Sun Mar 15 17:10:33 2015 +0100 >>> +++ b/repl/src/impl/TaskFactory.java Sun Mar 15 19:16:09 2015 +0100 >>> @@ -130,11 +130,9 @@ >>> >>> AnalyzeTask(OuterWrap wrap, String... extraOptions) { >>> super(wrap, extraOptions); >>> - Iterator eit = analyze().iterator(); >>> - if (eit.hasNext()) { >>> - Element e = eit.next(); >>> - TreePath cutp = trees().getPath(e); >>> - this.cut = cutp.getCompilationUnit(); >>> + Iterator cuts = >>> analyze().iterator(); >>> + if (cuts.hasNext()) { >>> + this.cut = cuts.next(); >>> //proc.debug("AnalyzeTask element=%s cutp=%s >>> cut=%s\n", e, cutp, cut); >>> } else { >>> this.cut = null; >>> @@ -142,9 +140,11 @@ >>> } >>> } >>> >>> - private Iterable analyze() { >>> + private Iterable analyze() { >>> try { >>> - return task.analyze(); >>> + Iterable cuts = >>> task.parse(); >>> + task.analyze(); >>> + return cuts; >>> } catch (Exception ex) { >>> throw new InternalError("Exception during analyze - " >>> + ex.getMessage(), ex); >>> } >>> >>> Does this seem OK? >>> >>> Thanks, >>> Jan >>> >>> > >>> >> 2. A user defined method/variable cannot hide a method/field >>> which has >>> >> been imported. (Maybe, a duplicate) >>> >> See ReplaceTest#testForwardSingleImportFieldToMethod, ReplaceTest# >>> >> testForwardSingleImportMethodToMethod >>> > >>> > That is a duplicate, but I figured out a way to fix it. So far fixed >>> > for star imports. Still need to fix for named imports. >>> > >>> > Tests reenabled. >>> > >>> >> >>> >> 3. This may not be a bug. Anyway, eval() returns string in quotes >>> for >>> >> String type. >>> > >>> > I sent a query about desired proper behavior here. Got no responses. >>> > So, I'm leaving it, for now. >>> > >>> > -Robert >>> > >>> >> >>> >> Andrei Eremeev >>> > >> >> From jan.lahoda at oracle.com Mon Mar 16 13:31:30 2015 From: jan.lahoda at oracle.com (jan.lahoda at oracle.com) Date: Mon, 16 Mar 2015 13:31:30 +0000 Subject: hg: kulla/dev/langtools: List packages after 'new' Message-ID: <201503161331.t2GDVUis010695@aojmv0008> Changeset: 98dcb849b448 Author: jlahoda Date: 2015-03-16 14:21 +0100 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/98dcb849b448 List packages after 'new' ! repl/src/impl/SourceCodeAnalysisImpl.java ! repl/testng/test/CompletionTest.java From andrei.eremeev at oracle.com Mon Mar 16 14:49:58 2015 From: andrei.eremeev at oracle.com (andrei.eremeev) Date: Mon, 16 Mar 2015 17:49:58 +0300 Subject: Bugs In-Reply-To: <0b68d284-05a7-4b6d-8a38-89da463b3d1d@default> References: <0b68d284-05a7-4b6d-8a38-89da463b3d1d@default> Message-ID: <5506ED96.5070005@oracle.com> It looks like completion works for jars, but does not work for directories. I tried setting classpath by -classpath command line option and /cp command shell. Andrei Eremeev On 03/16/2015 04:29 PM, Jan Lahoda wrote: > Hi Andrei, > > Could you please be more specific - what should I do to see the problem with user classes? I tried to add a jar to the classpath using the "-classpath" command line option and using the "/cp" command, and the completion was completing the packages from the jars. > > For "new", there was a bug that packages were not listed after new, should be fixed now. Thanks for pointing that out. > > Thanks, > Jan > > ----- Original Message ----- > From: andrei.eremeev at oracle.com > To: jan.lahoda at oracle.com, robert.field at oracle.com, kulla-dev at openjdk.java.net > Sent: Monday, March 16, 2015 1:24:08 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna > Subject: Re: Bugs > > Yes, completion works for imports currently. But what about user defined > classes in classpath? > Let pkg.A be a user defined class. Completion does not work for both > import statements and expression statements. > > > import pk| > > new pk| > > Andrei Eremeev > > On 03/16/2015 03:16 PM, Jan Lahoda wrote: >> On 15.3.2015 20:29, Robert Field wrote: >>> That seems fine. >> Thanks, completion for imports should work better now. >> >> Jan >> >>> It also suggests there might be ways for us to optimize the number of >>> compiler tasks used. >>> >>> Thanks, >>> Robert >>> >>> >>> >>> On March 15, 2015 11:22:13 AM Jan Lahoda wrote: >>> >>>> On 13.3.2015 19:06, Robert Field wrote: >>>>> On 03/13/15 08:22, andrei.eremeev wrote: >>>>>> Hi REPL team, >>>>>> >>>>>> Found bugs: >>>>>> >>>>>> 1. In completion analysis possible packages are not suggested. >>>> "import >>>>>> java.ut|". >>>>> Jan? >>>> Two problems here (thanks for report!): >>>> -the completion did not complete packages in any context. Should be >>>> fixed now (is a little bit tricky, as it is not easy to get the list of >>>> packages, so completion is listing classes using the JavaFileManager). >>>> -completion misbehaving for imports in some cases (in particular for >>>> import static). To fix this, I'd like to change the way AnalyzeTask >>>> sets >>>> AnalyzeTask.cut like this: >>>> diff -r c9b090dded9b repl/src/impl/TaskFactory.java >>>> --- a/repl/src/impl/TaskFactory.java Sun Mar 15 17:10:33 2015 +0100 >>>> +++ b/repl/src/impl/TaskFactory.java Sun Mar 15 19:16:09 2015 +0100 >>>> @@ -130,11 +130,9 @@ >>>> >>>> AnalyzeTask(OuterWrap wrap, String... extraOptions) { >>>> super(wrap, extraOptions); >>>> - Iterator eit = analyze().iterator(); >>>> - if (eit.hasNext()) { >>>> - Element e = eit.next(); >>>> - TreePath cutp = trees().getPath(e); >>>> - this.cut = cutp.getCompilationUnit(); >>>> + Iterator cuts = >>>> analyze().iterator(); >>>> + if (cuts.hasNext()) { >>>> + this.cut = cuts.next(); >>>> //proc.debug("AnalyzeTask element=%s cutp=%s >>>> cut=%s\n", e, cutp, cut); >>>> } else { >>>> this.cut = null; >>>> @@ -142,9 +140,11 @@ >>>> } >>>> } >>>> >>>> - private Iterable analyze() { >>>> + private Iterable analyze() { >>>> try { >>>> - return task.analyze(); >>>> + Iterable cuts = >>>> task.parse(); >>>> + task.analyze(); >>>> + return cuts; >>>> } catch (Exception ex) { >>>> throw new InternalError("Exception during analyze - " >>>> + ex.getMessage(), ex); >>>> } >>>> >>>> Does this seem OK? >>>> >>>> Thanks, >>>> Jan >>>> >>>>>> 2. A user defined method/variable cannot hide a method/field >>>> which has >>>>>> been imported. (Maybe, a duplicate) >>>>>> See ReplaceTest#testForwardSingleImportFieldToMethod, ReplaceTest# >>>>>> testForwardSingleImportMethodToMethod >>>>> That is a duplicate, but I figured out a way to fix it. So far fixed >>>>> for star imports. Still need to fix for named imports. >>>>> >>>>> Tests reenabled. >>>>> >>>>>> 3. This may not be a bug. Anyway, eval() returns string in quotes >>>> for >>>>>> String type. >>>>> I sent a query about desired proper behavior here. Got no responses. >>>>> So, I'm leaving it, for now. >>>>> >>>>> -Robert >>>>> >>>>>> Andrei Eremeev >>> From robert.field at oracle.com Wed Mar 18 01:34:45 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Wed, 18 Mar 2015 01:34:45 +0000 Subject: hg: kulla/dev/langtools: Modifier error (instead of side-effect errors) for synchronized, native, and (except for class) abstract. Warning and ignore (instead of silently ignore) for public protected private static final. Major test munging to handle that. Message-ID: <201503180134.t2I1YjQV027182@aojmv0008> Changeset: 9bfc7e3e8038 Author: rfield Date: 2015-03-17 18:34 -0700 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/9bfc7e3e8038 Modifier error (instead of side-effect errors) for synchronized, native, and (except for class) abstract. Warning and ignore (instead of silently ignore) for public protected private static final. Major test munging to handle that. ! repl/TODO ! repl/src/impl/EvalStateImpl.java ! repl/src/impl/ReplParser.java ! repl/testng/test/ClassMembersTest.java ! repl/testng/test/ClassesTest.java ! repl/testng/test/IgnoreTest.java ! repl/testng/test/KullaTesting.java ! repl/testng/test/MethodsTest.java ! repl/testng/test/ModifiersTest.java ! repl/testng/test/ReplToolTesting.java ! repl/testng/test/ReplaceTest.java ! repl/testng/test/ToolBasicTest.java From andrei.eremeev at oracle.com Wed Mar 18 11:07:51 2015 From: andrei.eremeev at oracle.com (andrei.eremeev at oracle.com) Date: Wed, 18 Mar 2015 11:07:51 +0000 Subject: hg: kulla/dev/langtools: Tests for error position translation. Message-ID: <201503181107.t2IB7pGB003731@aojmv0008> Changeset: a0603348c30c Author: aeremeev Date: 2015-03-18 14:07 +0300 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/a0603348c30c Tests for error position translation. ! repl/TODO ! repl/testng/test/ClassMembersTest.java ! repl/testng/test/ClassesTest.java + repl/testng/test/ExpectedDiagnostic.java ! repl/testng/test/ImportTest.java ! repl/testng/test/KullaCompletenessStressTest.java ! repl/testng/test/KullaDeclareStressTest.java ! repl/testng/test/KullaTesting.java ! repl/testng/test/MethodsTest.java ! repl/testng/test/ModifiersTest.java - repl/testng/test/SanityTest.java ! repl/testng/test/SimpleRegressionTest.java ! repl/testng/test/VariablesTest.java From andrei.eremeev at oracle.com Wed Mar 18 11:13:51 2015 From: andrei.eremeev at oracle.com (andrei.eremeev) Date: Wed, 18 Mar 2015 14:13:51 +0300 Subject: Bugs: error translation Message-ID: <55095DEF.4030105@oracle.com> Hi REPL team, Bugs: 1. "import" followed by "new" cannot be completed. REPL always waits for more input. > import new java.util.List; 2. String f(); Position points to incorrect error location. Start position is 0, end position is 0, position is 0. While it should be 7, 7, 7. See MethodsTest#methodsErrors 3. int g = x; Position points to incorrect error location. Start position is 8, end position is 0, position is 0. While it should be 8, 8, 8. See SimpleRegressionTest# testCannotResolve 4. Position points to incorrect error location. Start position is 0, end position is 0, position is 0. While it should be 0, 3, 0. See VariablesTest#variablesErrors Andrei Eremeev From andrei.eremeev at oracle.com Wed Mar 18 12:49:20 2015 From: andrei.eremeev at oracle.com (andrei.eremeev) Date: Wed, 18 Mar 2015 15:49:20 +0300 Subject: Bug in documentation Message-ID: <55097450.2030400@oracle.com> Hi REPL team, Documentation of eval should be cleaned up. It mentions that "The modifiers synchronized, abstract, and default are not allowed on top-level declarations and are errors." Nevertheless, an abstract class can be declared. Andrei Eremeev From andrei.eremeev at oracle.com Wed Mar 18 13:31:10 2015 From: andrei.eremeev at oracle.com (andrei.eremeev) Date: Wed, 18 Mar 2015 16:31:10 +0300 Subject: Class cast exception in TreeDissector Message-ID: <55097E1E.5000904@oracle.com> -> void f(T...a) {} Exception in thread "main" java.lang.ClassCastException: com.sun.tools.javac.code.Type$ForAll cannot be cast to com.sun.tools.javac.code.Type$MethodType at impl.TreeDissector.typeOfMethod(TreeDissector.java:235) at impl.EvalStateImpl.processMethod(EvalStateImpl.java:493) at impl.EvalStateImpl.eval(EvalStateImpl.java:174) at tool.Repl.processSource(Repl.java:752) at tool.Repl.run(Repl.java:340) at tool.Repl.start(Repl.java:203) at tool.Repl.start(Repl.java:182) at tool.Repl.main(Repl.java:172) Andrei Eremeev From andrei.eremeev at oracle.com Wed Mar 18 14:09:06 2015 From: andrei.eremeev at oracle.com (andrei.eremeev at oracle.com) Date: Wed, 18 Mar 2015 14:09:06 +0000 Subject: hg: kulla/dev/langtools: Tests for error position translation in REPL shell Message-ID: <201503181409.t2IE9CiZ010465@aojmv0008> Changeset: 13e5078bd958 Author: aeremeev Date: 2015-03-18 17:08 +0300 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/13e5078bd958 Tests for error position translation in REPL shell ! repl/testng/test/ClassMembersTest.java ! repl/testng/test/ClassesTest.java ! repl/testng/test/ExpectedDiagnostic.java ! repl/testng/test/ImportTest.java ! repl/testng/test/KullaTesting.java ! repl/testng/test/MethodsTest.java ! repl/testng/test/ModifiersTest.java ! repl/testng/test/SimpleRegressionTest.java ! repl/testng/test/VariablesTest.java ! repl/testng/testng.xml From andrei.eremeev at oracle.com Wed Mar 18 14:16:57 2015 From: andrei.eremeev at oracle.com (andrei.eremeev at oracle.com) Date: Wed, 18 Mar 2015 14:16:57 +0000 Subject: hg: kulla/dev/langtools: Tests for error position translation in REPL shell Message-ID: <201503181416.t2IEGvBb012470@aojmv0008> Changeset: a0a247270da8 Author: aeremeev Date: 2015-03-18 17:16 +0300 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/a0a247270da8 Tests for error position translation in REPL shell + repl/testng/test/ErrorTranslationTest.java From robert.field at oracle.com Wed Mar 18 18:46:23 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Wed, 18 Mar 2015 18:46:23 +0000 Subject: hg: kulla/dev/langtools: Fixed class cast exception in TreeDissector on: void f(T...a) {}. Compile with -Xlint:unchecked to give better info and rid advice to recompile. Message-ID: <201503181846.t2IIkNe0008843@aojmv0008> Changeset: 6c8bc120bd28 Author: rfield Date: 2015-03-18 11:46 -0700 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/6c8bc120bd28 Fixed class cast exception in TreeDissector on: void f(T...a) {}. Compile with -Xlint:unchecked to give better info and rid advice to recompile. ! repl/src/impl/EvalStateImpl.java ! repl/src/impl/TaskFactory.java ! repl/src/impl/TreeDissector.java ! repl/testng/test/KullaTesting.java ! repl/testng/test/SimpleRegressionTest.java From robert.field at oracle.com Wed Mar 18 18:46:45 2015 From: robert.field at oracle.com (Robert Field) Date: Wed, 18 Mar 2015 11:46:45 -0700 Subject: Class cast exception in TreeDissector In-Reply-To: <55097E1E.5000904@oracle.com> References: <55097E1E.5000904@oracle.com> Message-ID: <5509C815.7070706@oracle.com> Thanks! Fixed. -Robert On 03/18/15 06:31, andrei.eremeev wrote: > -> void f(T...a) {} > Exception in thread "main" java.lang.ClassCastException: > com.sun.tools.javac.code.Type$ForAll cannot be cast to > com.sun.tools.javac.code.Type$MethodType > at impl.TreeDissector.typeOfMethod(TreeDissector.java:235) > at impl.EvalStateImpl.processMethod(EvalStateImpl.java:493) > at impl.EvalStateImpl.eval(EvalStateImpl.java:174) > at tool.Repl.processSource(Repl.java:752) > at tool.Repl.run(Repl.java:340) > at tool.Repl.start(Repl.java:203) > at tool.Repl.start(Repl.java:182) > at tool.Repl.main(Repl.java:172) > > Andrei Eremeev From robert.field at oracle.com Wed Mar 18 18:54:44 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Wed, 18 Mar 2015 18:54:44 +0000 Subject: hg: kulla/dev/langtools: Fix documentation of permitted modifiers on input to eval. Message-ID: <201503181854.t2IIsoJA010452@aojmv0008> Changeset: accb51523a06 Author: rfield Date: 2015-03-18 11:54 -0700 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/accb51523a06 Fix documentation of permitted modifiers on input to eval. ! repl/src/api/EvalState.java From robert.field at oracle.com Wed Mar 18 18:55:02 2015 From: robert.field at oracle.com (Robert Field) Date: Wed, 18 Mar 2015 11:55:02 -0700 Subject: Bug in documentation In-Reply-To: <55097450.2030400@oracle.com> References: <55097450.2030400@oracle.com> Message-ID: <5509CA06.4090307@oracle.com> Thanks. Fixed. -Robert On 03/18/15 05:49, andrei.eremeev wrote: > Hi REPL team, > > Documentation of eval should be cleaned up. It mentions that "The > modifiers synchronized, abstract, and default are not allowed on > top-level declarations and are errors." > Nevertheless, an abstract class can be declared. > > Andrei Eremeev From robert.field at oracle.com Wed Mar 18 20:53:28 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Wed, 18 Mar 2015 20:53:28 +0000 Subject: hg: kulla/dev/langtools: Fix error position information translation. Enable position tests. Message-ID: <201503182053.t2IKrSd1003210@aojmv0008> Changeset: 083645ec502a Author: rfield Date: 2015-03-18 13:53 -0700 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/083645ec502a Fix error position information translation. Enable position tests. ! repl/TODO ! repl/src/impl/GeneralWrap.java ! repl/src/impl/OuterWrap.java ! repl/src/impl/Wrap.java ! repl/testng/test/MethodsTest.java ! repl/testng/test/SimpleRegressionTest.java ! repl/testng/test/VariablesTest.java From robert.field at oracle.com Wed Mar 18 20:55:16 2015 From: robert.field at oracle.com (Robert Field) Date: Wed, 18 Mar 2015 13:55:16 -0700 Subject: Bugs: error translation In-Reply-To: <55095DEF.4030105@oracle.com> References: <55095DEF.4030105@oracle.com> Message-ID: <5509E634.6010709@oracle.com> On 03/18/15 04:13, andrei.eremeev wrote: > Hi REPL team, > > Bugs: > 1. "import" followed by "new" cannot be completed. REPL always waits > for more input. > > import new java.util.List; Added to TODO. > > 2. String f(); > Position points to incorrect error location. Start position is 0, end > position is 0, position is 0. While it should be 7, 7, 7. > See MethodsTest#methodsErrors Fixed. > > 3. int g = x; > Position points to incorrect error location. Start position is 8, end > position is 0, position is 0. While it should be 8, 8, 8. > See SimpleRegressionTest# testCannotResolve Fixed. > > 4. Position points to incorrect error location. Start position is 0, > end position is 0, position is 0. While it should be 0, 3, 0. > See VariablesTest#variablesErrors Fixed. Thanks for the reports. Note that end position is exclusive, so I have adjusted the expected position values. -Robert > > Andrei Eremeev From jan.lahoda at oracle.com Thu Mar 19 11:28:31 2015 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Thu, 19 Mar 2015 12:28:31 +0100 Subject: Captured wildcards Message-ID: <550AB2DF.3040001@oracle.com> Hello, Assume this declaration: List list = Arrays.asList("a"); This expression fails: -> list.iterator().next() | Error: | illegal start of type | list.iterator().next() | ^ The reason is that "? extends String" is used as the type of the expression, instead of "String": --- package REPL; import java.util.regex.*;import java.util.*;import java.util.concurrent.*;import java.util.prefs.*;import java.net.*;import java.io.*;import java.math.*;import static REPL.$REPL8.printf; import static REPL.$REPL9.list; public class $REPL11 { public static ? extends String $2; public static Object do_it$() throws Throwable { return $2 = list.iterator().next(); } } --- Attached is a possible fix - what do you think? Thanks, Jan -------------- next part -------------- # HG changeset patch # Parent 083645ec502a473bca67a524385a18a8d21f0951 diff -r 083645ec502a -r 34f1d952e2d6 repl/src/impl/TreeDissector.java --- a/repl/src/impl/TreeDissector.java Wed Mar 18 13:53:15 2015 -0700 +++ b/repl/src/impl/TreeDissector.java Thu Mar 19 12:13:47 2015 +0100 @@ -203,8 +203,9 @@ if (viPath != null) { TypeMirror tm = trees().getTypeMirror(viPath); if (tm != null) { - TypePrinter tp = new TypePrinter(messages, fullClassNameAndPackageToClass); - ei.typeName = tp.visit((Type)tm, Locale.getDefault()); + Type type = (Type)tm; + TypePrinter tp = new TypePrinter(messages, fullClassNameAndPackageToClass, type); + ei.typeName = tp.visit(type, Locale.getDefault()); switch (tm.getKind()) { case VOID: case NONE: diff -r 083645ec502a -r 34f1d952e2d6 repl/src/impl/TypePrinter.java --- a/repl/src/impl/TypePrinter.java Wed Mar 18 13:53:15 2015 -0700 +++ b/repl/src/impl/TypePrinter.java Thu Mar 19 12:13:47 2015 +0100 @@ -41,10 +41,12 @@ private final JavacMessages messages; private final BinaryOperator fullClassNameAndPackageToClass; + private final Type typeToPrint; - TypePrinter(JavacMessages messages, BinaryOperator fullClassNameAndPackageToClass) { + TypePrinter(JavacMessages messages, BinaryOperator fullClassNameAndPackageToClass, Type typeToPrint) { this.messages = messages; this.fullClassNameAndPackageToClass = fullClassNameAndPackageToClass; + this.typeToPrint = typeToPrint; } @Override @@ -59,7 +61,15 @@ @Override public String visitCapturedType(Type.CapturedType t, Locale locale) { - return visit(t.wildcard, locale); + if (t == typeToPrint) { + if (t.wildcard.getExtendsBound() != null) { + return visit(t.wildcard.getExtendsBound(), locale); + } else { + return "Object"; + } + } else { + return visit(t.wildcard, locale); + } } @Override diff -r 083645ec502a -r 34f1d952e2d6 repl/testng/test/TypeNameTest.java --- a/repl/testng/test/TypeNameTest.java Wed Mar 18 13:53:15 2015 -0700 +++ b/repl/testng/test/TypeNameTest.java Thu Mar 19 12:13:47 2015 +0100 @@ -68,4 +68,15 @@ assertEquals(sn.typeName(), "java.lang.reflect.Method"); } + public void testBounds() { + assertEval1("java.util.List list1 = java.util.Arrays.asList(\"\");"); + VarInfo sn1 = (VarInfo) assertEval1("list1.iterator().next()"); + assertEquals(sn1.typeName(), "String"); + assertEval1("java.util.List list2 = java.util.Arrays.asList(\"\");"); + VarInfo sn2 = (VarInfo) assertEval1("list2.iterator().next()"); + assertEquals(sn2.typeName(), "Object"); + assertEval1("java.util.List list3 = java.util.Arrays.asList(\"\");"); + VarInfo sn3 = (VarInfo) assertEval1("list3.iterator().next()"); + assertEquals(sn3.typeName(), "Object"); + } } From maurizio.cimadamore at oracle.com Thu Mar 19 12:22:49 2015 From: maurizio.cimadamore at oracle.com (Maurizio Cimadamore) Date: Thu, 19 Mar 2015 12:22:49 +0000 Subject: Captured wildcards In-Reply-To: <550AB2DF.3040001@oracle.com> References: <550AB2DF.3040001@oracle.com> Message-ID: <550ABF99.5020306@oracle.com> Upper bound should always be used - although I'm not 100% sure of what should happen when an upper bound is an intersection type: interface A { } interface B { } class E implements A, B { } class Foo { X x; Foo(X x) { this.x = x; } X get() { return x; } } Foo foo = new Foo<>(new E()); foo.get(); //??? Maurizio On 19/03/15 11:28, Jan Lahoda wrote: > Hello, > > Assume this declaration: > List list = Arrays.asList("a"); > > This expression fails: > -> list.iterator().next() > | Error: > | illegal start of type > | list.iterator().next() > | ^ > > The reason is that "? extends String" is used as the type of the > expression, instead of "String": > --- > package REPL; > import java.util.regex.*;import java.util.*;import > java.util.concurrent.*;import java.util.prefs.*;import > java.net.*;import java.io.*;import java.math.*;import static > REPL.$REPL8.printf; > import static REPL.$REPL9.list; > public class $REPL11 { > public static > ? extends String $2; > public static Object do_it$() throws Throwable { > return $2 = > list.iterator().next(); > } > } > --- > > Attached is a possible fix - what do you think? > > Thanks, > Jan From maurizio.cimadamore at oracle.com Thu Mar 19 12:28:51 2015 From: maurizio.cimadamore at oracle.com (Maurizio Cimadamore) Date: Thu, 19 Mar 2015 12:28:51 +0000 Subject: Captured wildcards In-Reply-To: <550ABF99.5020306@oracle.com> References: <550AB2DF.3040001@oracle.com> <550ABF99.5020306@oracle.com> Message-ID: <550AC103.5010801@oracle.com> Thinking about it more, I'd say that using the upper bound of the _wildcard_ associated to the captured type (as per Jan's patch) is always correct; after all, that's the most likely explicit type the user would come up with if storing the contents of the expression into some variable. Some static type info is lost as a result, but that's not terrible, assuming the only way to declare a variable in kulla is to have an explicit variable declaration with a type. Of course if you could do stuff like: var x = foo.get() you'll get into trouble if the inferred type for 'x' is less precise than the type of foo.get(). Maurizio On 19/03/15 12:22, Maurizio Cimadamore wrote: > Upper bound should always be used - although I'm not 100% sure of what > should happen when an upper bound is an intersection type: > > interface A { } > interface B { } > > class E implements A, B { } > > class Foo { > X x; > > Foo(X x) { > this.x = x; > } > > X get() { > return x; > } > } > > > Foo foo = new Foo<>(new E()); > foo.get(); //??? > > Maurizio > > On 19/03/15 11:28, Jan Lahoda wrote: >> Hello, >> >> Assume this declaration: >> List list = Arrays.asList("a"); >> >> This expression fails: >> -> list.iterator().next() >> | Error: >> | illegal start of type >> | list.iterator().next() >> | ^ >> >> The reason is that "? extends String" is used as the type of the >> expression, instead of "String": >> --- >> package REPL; >> import java.util.regex.*;import java.util.*;import >> java.util.concurrent.*;import java.util.prefs.*;import >> java.net.*;import java.io.*;import java.math.*;import static >> REPL.$REPL8.printf; >> import static REPL.$REPL9.list; >> public class $REPL11 { >> public static >> ? extends String $2; >> public static Object do_it$() throws Throwable { >> return $2 = >> list.iterator().next(); >> } >> } >> --- >> >> Attached is a possible fix - what do you think? >> >> Thanks, >> Jan > From andrei.eremeev at oracle.com Thu Mar 19 13:40:57 2015 From: andrei.eremeev at oracle.com (andrei.eremeev) Date: Thu, 19 Mar 2015 16:40:57 +0300 Subject: Bugs In-Reply-To: <550AAE6C.8000804@oracle.com> References: <0b68d284-05a7-4b6d-8a38-89da463b3d1d@default> <5506ED96.5070005@oracle.com> <55083511.4020207@oracle.com> <55095DDC.7040704@oracle.com> <550AAE6C.8000804@oracle.com> Message-ID: <550AD1E9.6020807@oracle.com> Hi Jan, Ok, this makes sense. You can postpone it. Additionally, I have found that REPL crashes in the following test case: > new testClasspathDirectory.pkg.A Type tab and get the following crash. Exception in thread "main" com.sun.tools.javac.code.ClassFinder$BadClassFile: bad class file: build/testClasspathDirectory/pkg/A.class class file contains wrong class: pkg.A Please remove or make sure it appears in the correct subdirectory of the classpath. at com.sun.tools.javac.jvm.ClassReader.badClassFile(ClassReader.java:249) at com.sun.tools.javac.jvm.ClassReader.readClass(ClassReader.java:2172) at com.sun.tools.javac.jvm.ClassReader.readClassBuffer(ClassReader.java:2283) at com.sun.tools.javac.jvm.ClassReader.readClassFile(ClassReader.java:2294) at com.sun.tools.javac.code.ClassFinder.fillIn(ClassFinder.java:346) at com.sun.tools.javac.code.ClassFinder.complete(ClassFinder.java:285) at com.sun.tools.javac.code.ClassFinder.access$000(ClassFinder.java:72) at com.sun.tools.javac.code.ClassFinder$1.complete(ClassFinder.java:159) at com.sun.tools.javac.code.Symbol.complete(Symbol.java:569) at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:1053) at com.sun.tools.javac.code.Symbol$ClassSymbol.flags(Symbol.java:987) at com.sun.tools.javac.code.Symbol$TypeSymbol.getEnclosedElements(Symbol.java:735) at impl.SourceCodeAnalysisImpl.membersOf(SourceCodeAnalysisImpl.java:366) at impl.SourceCodeAnalysisImpl.computeSuggestions(SourceCodeAnalysisImpl.java:256) at impl.SourceCodeAnalysisImpl.completionSuggestions(SourceCodeAnalysisImpl.java:197) at tool.ConsoleIOContext$1.complete(Repl.java:1081) at jline.console.ConsoleReader.complete(ConsoleReader.java:3261) at jline.console.ConsoleReader.readLine(ConsoleReader.java:2621) at jline.console.ConsoleReader.readLine(ConsoleReader.java:2269) at tool.ConsoleIOContext.readLine(Repl.java:1062) at tool.Repl.run(Repl.java:322) at tool.Repl.start(Repl.java:203) at tool.Repl.start(Repl.java:182) at tool.Repl.main(Repl.java:172) Andrei Eremeev On 03/19/2015 02:09 PM, Jan Lahoda wrote: > Hi Andrei, > > Thanks for the steps to reproduce. I believe the problem is that both > "build" and "build/testClasspathDirectory" are on the classpath, so > when build/testClasspathDirectory/pkg/A.class file is found, a wrong > binary name is inferred from the classfile name (the binary name is > based on the build directory, and so it testClasspathDirectory.pkg.A > instead of pkg.A). This seems like a corner case to me, so my proposal > would be to not fix this now. > > What do you think? > > Thanks, > Jan > > On 18.3.2015 12:13, andrei.eremeev wrote: >> I can reproduce it in the following way: >> >> 1. Run all tests by scripts/test.sh >> 2. Run REPL >> 3. /cp build/testClasspathDirectory (one of directories generated by >> tests with class pkg.A) >> 4. new pk| >> >> I think I determine the root cause of the bug. When I try the same thing >> with the absolute path, package completion works. >> >> Andrei Eremeev >> >> On 03/17/2015 05:07 PM, Jan Lahoda wrote: >>> Hi Andrei, >>> >>> I tried to specify a directory for /cp, and the package completion >>> still appears to work for me. Would you have more details on how to >>> reproduce? >>> >>> Thanks a lot, >>> Jan >>> >>> On 16.3.2015 15:49, andrei.eremeev wrote: >>>> It looks like completion works for jars, but does not work for >>>> directories. >>>> I tried setting classpath by -classpath command line option and /cp >>>> command shell. >>>> >>>> Andrei Eremeev >>>> >>>> On 03/16/2015 04:29 PM, Jan Lahoda wrote: >>>>> Hi Andrei, >>>>> >>>>> Could you please be more specific - what should I do to see the >>>>> problem with user classes? I tried to add a jar to the classpath >>>>> using >>>>> the "-classpath" command line option and using the "/cp" command, and >>>>> the completion was completing the packages from the jars. >>>>> >>>>> For "new", there was a bug that packages were not listed after new, >>>>> should be fixed now. Thanks for pointing that out. >>>>> >>>>> Thanks, >>>>> Jan >>>>> >>>>> ----- Original Message ----- >>>>> From: andrei.eremeev at oracle.com >>>>> To: jan.lahoda at oracle.com, robert.field at oracle.com, >>>>> kulla-dev at openjdk.java.net >>>>> Sent: Monday, March 16, 2015 1:24:08 PM GMT +01:00 Amsterdam / Berlin >>>>> / Bern / Rome / Stockholm / Vienna >>>>> Subject: Re: Bugs >>>>> >>>>> Yes, completion works for imports currently. But what about user >>>>> defined >>>>> classes in classpath? >>>>> Let pkg.A be a user defined class. Completion does not work for both >>>>> import statements and expression statements. >>>>> >>>>> > import pk| >>>>> > new pk| >>>>> >>>>> Andrei Eremeev >>>>> >>>>> On 03/16/2015 03:16 PM, Jan Lahoda wrote: >>>>>> On 15.3.2015 20:29, Robert Field wrote: >>>>>>> That seems fine. >>>>>> Thanks, completion for imports should work better now. >>>>>> >>>>>> Jan >>>>>> >>>>>>> It also suggests there might be ways for us to optimize the >>>>>>> number of >>>>>>> compiler tasks used. >>>>>>> >>>>>>> Thanks, >>>>>>> Robert >>>>>>> >>>>>>> >>>>>>> >>>>>>> On March 15, 2015 11:22:13 AM Jan Lahoda >>>>>>> wrote: >>>>>>> >>>>>>>> On 13.3.2015 19:06, Robert Field wrote: >>>>>>>>> On 03/13/15 08:22, andrei.eremeev wrote: >>>>>>>>>> Hi REPL team, >>>>>>>>>> >>>>>>>>>> Found bugs: >>>>>>>>>> >>>>>>>>>> 1. In completion analysis possible packages are not suggested. >>>>>>>> "import >>>>>>>>>> java.ut|". >>>>>>>>> Jan? >>>>>>>> Two problems here (thanks for report!): >>>>>>>> -the completion did not complete packages in any context. >>>>>>>> Should be >>>>>>>> fixed now (is a little bit tricky, as it is not easy to get the >>>>>>>> list of >>>>>>>> packages, so completion is listing classes using the >>>>>>>> JavaFileManager). >>>>>>>> -completion misbehaving for imports in some cases (in >>>>>>>> particular for >>>>>>>> import static). To fix this, I'd like to change the way >>>>>>>> AnalyzeTask >>>>>>>> sets >>>>>>>> AnalyzeTask.cut like this: >>>>>>>> diff -r c9b090dded9b repl/src/impl/TaskFactory.java >>>>>>>> --- a/repl/src/impl/TaskFactory.java Sun Mar 15 17:10:33 2015 >>>>>>>> +0100 >>>>>>>> +++ b/repl/src/impl/TaskFactory.java Sun Mar 15 19:16:09 2015 >>>>>>>> +0100 >>>>>>>> @@ -130,11 +130,9 @@ >>>>>>>> >>>>>>>> AnalyzeTask(OuterWrap wrap, String... extraOptions) { >>>>>>>> super(wrap, extraOptions); >>>>>>>> - Iterator eit = >>>>>>>> analyze().iterator(); >>>>>>>> - if (eit.hasNext()) { >>>>>>>> - Element e = eit.next(); >>>>>>>> - TreePath cutp = trees().getPath(e); >>>>>>>> - this.cut = cutp.getCompilationUnit(); >>>>>>>> + Iterator cuts = >>>>>>>> analyze().iterator(); >>>>>>>> + if (cuts.hasNext()) { >>>>>>>> + this.cut = cuts.next(); >>>>>>>> //proc.debug("AnalyzeTask element=%s cutp=%s >>>>>>>> cut=%s\n", e, cutp, cut); >>>>>>>> } else { >>>>>>>> this.cut = null; >>>>>>>> @@ -142,9 +140,11 @@ >>>>>>>> } >>>>>>>> } >>>>>>>> >>>>>>>> - private Iterable analyze() { >>>>>>>> + private Iterable >>>>>>>> analyze() { >>>>>>>> try { >>>>>>>> - return task.analyze(); >>>>>>>> + Iterable cuts = >>>>>>>> task.parse(); >>>>>>>> + task.analyze(); >>>>>>>> + return cuts; >>>>>>>> } catch (Exception ex) { >>>>>>>> throw new InternalError("Exception during >>>>>>>> analyze - " >>>>>>>> + ex.getMessage(), ex); >>>>>>>> } >>>>>>>> >>>>>>>> Does this seem OK? >>>>>>>> >>>>>>>> Thanks, >>>>>>>> Jan >>>>>>>> >>>>>>>>>> 2. A user defined method/variable cannot hide a method/field >>>>>>>> which has >>>>>>>>>> been imported. (Maybe, a duplicate) >>>>>>>>>> See ReplaceTest#testForwardSingleImportFieldToMethod, >>>>>>>>>> ReplaceTest# >>>>>>>>>> testForwardSingleImportMethodToMethod >>>>>>>>> That is a duplicate, but I figured out a way to fix it. So far >>>>>>>>> fixed >>>>>>>>> for star imports. Still need to fix for named imports. >>>>>>>>> >>>>>>>>> Tests reenabled. >>>>>>>>> >>>>>>>>>> 3. This may not be a bug. Anyway, eval() returns string in >>>>>>>>>> quotes >>>>>>>> for >>>>>>>>>> String type. >>>>>>>>> I sent a query about desired proper behavior here. Got no >>>>>>>>> responses. >>>>>>>>> So, I'm leaving it, for now. >>>>>>>>> >>>>>>>>> -Robert >>>>>>>>> >>>>>>>>>> Andrei Eremeev >>>>>>> >>>> >> From andrei.eremeev at oracle.com Thu Mar 19 15:49:00 2015 From: andrei.eremeev at oracle.com (andrei.eremeev) Date: Thu, 19 Mar 2015 18:49:00 +0300 Subject: Bug: problems with forward methods Message-ID: <550AEFEC.1060600@oracle.com> Hi REPL team, The code is not compiled if the name of a forward method equals to the method name in which the forward method is called. -> void f() { f(10); } | Error: | method f in class cannot be applied to given types; | required: no arguments | found: int | reason: actual and formal argument lists differ in length | void f() { f(10); } | ^ Andrei Eremeev From andrei.eremeev at oracle.com Thu Mar 19 16:13:38 2015 From: andrei.eremeev at oracle.com (andrei.eremeev) Date: Thu, 19 Mar 2015 19:13:38 +0300 Subject: Bug: problems with forward methods In-Reply-To: <550AEFEC.1060600@oracle.com> References: <550AEFEC.1060600@oracle.com> Message-ID: <550AF5B2.6020900@oracle.com> And as for forward variables, I think method "f" can be declared, but cannot be executed until "a" with a proper type is declared. -> double a | Added variable a of type double -> int f() { return a; } | Error: | incompatible types: possible lossy conversion from double to int | int f() { return a; } | ^ -> int a | Replaced variable a of type int Andrei Eremeev On 03/19/2015 06:49 PM, andrei.eremeev wrote: > Hi REPL team, > > The code is not compiled if the name of a forward method equals to the > method name in which the forward method is called. > > -> void f() { f(10); } > | Error: > | method f in class cannot be applied to given types; > | required: no arguments > | found: int > | reason: actual and formal argument lists differ in length > | void f() { f(10); } > | ^ > > > Andrei Eremeev From robert.field at oracle.com Thu Mar 19 18:27:32 2015 From: robert.field at oracle.com (Robert Field) Date: Thu, 19 Mar 2015 11:27:32 -0700 Subject: Bug: problems with forward methods In-Reply-To: <550AF5B2.6020900@oracle.com> References: <550AEFEC.1060600@oracle.com> <550AF5B2.6020900@oracle.com> Message-ID: <550B1514.8070907@oracle.com> Both of these are cases were it is unclear if it is just an error or the user intends to change or add declarations. Not sure how to go here. -Robert On 03/19/15 09:13, andrei.eremeev wrote: > And as for forward variables, I think method "f" can be declared, but > cannot be executed until "a" with a proper type is declared. > > -> double a > | Added variable a of type double > > -> int f() { return a; } > | Error: > | incompatible types: possible lossy conversion from double to int > | int f() { return a; } > | ^ > > -> int a > | Replaced variable a of type int > > Andrei Eremeev > > On 03/19/2015 06:49 PM, andrei.eremeev wrote: >> Hi REPL team, >> >> The code is not compiled if the name of a forward method equals to >> the method name in which the forward method is called. >> >> -> void f() { f(10); } >> | Error: >> | method f in class cannot be applied to given types; >> | required: no arguments >> | found: int >> | reason: actual and formal argument lists differ in length >> | void f() { f(10); } >> | ^ >> >> >> Andrei Eremeev > From robert.field at oracle.com Thu Mar 19 20:56:33 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Thu, 19 Mar 2015 20:56:33 +0000 Subject: hg: kulla/dev/langtools: Add 'all' and 'history' modifiers to /list and /save. Clean-up restructure TODO. Tighten newline usage in /list. Message-ID: <201503192056.t2JKuX2s005672@aojmv0008> Changeset: 0900013bcd27 Author: rfield Date: 2015-03-19 13:56 -0700 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/0900013bcd27 Add 'all' and 'history' modifiers to /list and /save. Clean-up restructure TODO. Tighten newline usage in /list. ! repl/TODO ! repl/scripts/doc.sh ! repl/src/tool/Repl.java From robert.field at oracle.com Thu Mar 19 21:39:47 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Thu, 19 Mar 2015 21:39:47 +0000 Subject: hg: kulla/dev/langtools: Fix over eager variable reset to null messages from REPL tool. Message-ID: <201503192139.t2JLdmtE018536@aojmv0008> Changeset: 711643248fd3 Author: rfield Date: 2015-03-19 14:39 -0700 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/711643248fd3 Fix over eager variable reset to null messages from REPL tool. ! repl/TODO ! repl/src/tool/Repl.java ! repl/testng/test/ToolBasicTest.java From robert.field at oracle.com Fri Mar 20 06:49:06 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Fri, 20 Mar 2015 06:49:06 +0000 Subject: hg: kulla/dev/langtools: Fix bad declaration clobbering good. Message-ID: <201503200649.t2K6n60J004329@aojmv0008> Changeset: 7fd27f8e4302 Author: rfield Date: 2015-03-19 23:48 -0700 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/7fd27f8e4302 Fix bad declaration clobbering good. ! repl/TODO ! repl/src/impl/EvalStateImpl.java ! repl/src/tool/Repl.java ! repl/testng/test/VariablesTest.java From jan.lahoda at oracle.com Fri Mar 20 11:55:23 2015 From: jan.lahoda at oracle.com (jan.lahoda at oracle.com) Date: Fri, 20 Mar 2015 11:55:23 +0000 Subject: hg: kulla/dev/langtools: Better target type for expressions whose type is a captured type. Message-ID: <201503201155.t2KBtOnI012700@aojmv0008> Changeset: 28fbca2a43fe Author: jlahoda Date: 2015-03-20 12:37 +0100 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/28fbca2a43fe Better target type for expressions whose type is a captured type. ! repl/src/impl/TreeDissector.java ! repl/src/impl/TypePrinter.java ! repl/testng/test/TypeNameTest.java From jan.lahoda at oracle.com Fri Mar 20 14:12:01 2015 From: jan.lahoda at oracle.com (jan.lahoda at oracle.com) Date: Fri, 20 Mar 2015 14:12:01 +0000 Subject: hg: kulla/dev/langtools: Beep when the completion is empty. Message-ID: <201503201412.t2KEC164012009@aojmv0008> Changeset: a59b23b8812d Author: jlahoda Date: 2015-03-20 15:11 +0100 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/a59b23b8812d Beep when the completion is empty. ! repl/src/tool/Repl.java From robert.field at oracle.com Sat Mar 21 04:16:28 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Sat, 21 Mar 2015 04:16:28 +0000 Subject: hg: kulla/dev/langtools: Fix System.exit(5) in REPL tool causes IllegalStateException. Solidify remote shutdown. Add specific EvalStateClosedException to API. Make /history not confusable with snippet ids. Message-ID: <201503210416.t2L4GSQs014033@aojmv0008> Changeset: cf5beff013d1 Author: rfield Date: 2015-03-20 21:16 -0700 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/cf5beff013d1 Fix System.exit(5) in REPL tool causes IllegalStateException. Solidify remote shutdown. Add specific EvalStateClosedException to API. Make /history not confusable with snippet ids. ! repl/TODO ! repl/src/api/EvalState.java + repl/src/api/EvalStateClosedException.java ! repl/src/impl/EvalStateImpl.java ! repl/src/tool/Repl.java ! repl/testng/test/ToolBasicTest.java From andrei.eremeev at oracle.com Sat Mar 21 15:41:11 2015 From: andrei.eremeev at oracle.com (andrei.eremeev at oracle.com) Date: Sat, 21 Mar 2015 15:41:11 +0000 Subject: hg: kulla/dev/langtools: Parallelization of stress tests. Message-ID: <201503211541.t2LFfGWm028460@aojmv0008> Changeset: 121f3e7cae77 Author: aeremeev Date: 2015-03-21 18:41 +0300 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/121f3e7cae77 Parallelization of stress tests. ! repl/TODO ! repl/testng/stress.xml ! repl/testng/stress/CompletenessStressTest.java ! repl/testng/stress/DeclareStressTest.java ! repl/testng/stress/StressTestBase.java ! repl/testng/test/KullaDeclareStressTest.java ! repl/testng/test/ReplaceTest.java ! repl/testng/test/VariablesTest.java ! repl/testng/testng.xml From andrei.eremeev at oracle.com Mon Mar 23 17:40:25 2015 From: andrei.eremeev at oracle.com (andrei.eremeev at oracle.com) Date: Mon, 23 Mar 2015 17:40:25 +0000 Subject: hg: kulla/dev/langtools: Tests for /feedback, /save arguments and /list arguments. Message-ID: <201503231740.t2NHeP4G014782@aojmv0008> Changeset: 103ddf4fb8f2 Author: aeremeev Date: 2015-03-23 20:39 +0300 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/103ddf4fb8f2 Tests for /feedback, /save arguments and /list arguments. ! repl/TODO ! repl/testng/test/Compiler.java ! repl/testng/test/ToolBasicTest.java From robert.field at oracle.com Mon Mar 23 23:21:24 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Mon, 23 Mar 2015 23:21:24 +0000 Subject: hg: kulla/dev/langtools: TODO update Message-ID: <201503232321.t2NNLO22015426@aojmv0008> Changeset: e3798cb695cc Author: rfield Date: 2015-03-23 16:21 -0700 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/e3798cb695cc TODO update ! repl/TODO From robert.field at oracle.com Tue Mar 24 06:19:48 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Tue, 24 Mar 2015 06:19:48 +0000 Subject: hg: kulla/dev/langtools: Avoid remote termination failure/hang. Message-ID: <201503240619.t2O6JmIE027171@aojmv0008> Changeset: 5ce01b9b135f Author: rfield Date: 2015-03-23 23:19 -0700 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/5ce01b9b135f Avoid remote termination failure/hang. ! repl/src/impl/JDIEnv.java From jan.lahoda at oracle.com Tue Mar 24 06:22:47 2015 From: jan.lahoda at oracle.com (jan.lahoda at oracle.com) Date: Tue, 24 Mar 2015 06:22:47 +0000 Subject: hg: kulla/dev/langtools: Completion for REPL commands and their arguments. Message-ID: <201503240622.t2O6MlW3027950@aojmv0008> Changeset: a522e3dbc4ef Author: jlahoda Date: 2015-03-24 07:18 +0100 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/a522e3dbc4ef Completion for REPL commands and their arguments. ! repl/src/tool/Repl.java + repl/testng/test/CommandCompletionTest.java ! repl/testng/test/ReplToolTesting.java ! repl/testng/testng.xml From bitterfoxc at gmail.com Tue Mar 24 23:12:32 2015 From: bitterfoxc at gmail.com (ShinyaYoshida) Date: Wed, 25 Mar 2015 08:12:32 +0900 Subject: hg: kulla/dev/langtools: Completion for REPL commands and their arguments. In-Reply-To: <201503240622.t2O6MlW3027950@aojmv0008> References: <201503240622.t2O6MlW3027950@aojmv0008> Message-ID: Hi, Jan. Consider this case: -> void m(int n) {} -> int num1 = 1, num2 = 2 -> m(num1 >> /[tab] /classes /classpath /exit /feedback /help etc... Currently, REPL prints command suggestions. But, REPL should print code suggestions, not command suggestions. Please consider my patch. webrev: http://cr.openjdk.java.net/~shinyafox/kulla/a522e3dbc4ef/webrev.00/ Regards, shinyafox(Shinya Yoshida) 2015-03-24 15:22 GMT+09:00 : > Changeset: a522e3dbc4ef > Author: jlahoda > Date: 2015-03-24 07:18 +0100 > URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/a522e3dbc4ef > > Completion for REPL commands and their arguments. > > ! repl/src/tool/Repl.java > + repl/testng/test/CommandCompletionTest.java > ! repl/testng/test/ReplToolTesting.java > ! repl/testng/testng.xml > > From robert.field at oracle.com Wed Mar 25 00:07:17 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Wed, 25 Mar 2015 00:07:17 +0000 Subject: hg: kulla/dev/langtools: Add a pop-up declaration/statement editor window. This is a concept trial. Motivated by this, ignore duplicate declarations. Message-ID: <201503250007.t2P07M6v009533@aojmv0008> Changeset: ed58a08cebaa Author: rfield Date: 2015-03-24 17:07 -0700 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/ed58a08cebaa Add a pop-up declaration/statement editor window. This is a concept trial. Motivated by this, ignore duplicate declarations. ! repl/src/impl/EvalStateImpl.java + repl/src/tool/EditPad.java ! repl/src/tool/Repl.java ! repl/testng/test/ClassesTest.java ! repl/testng/test/ReplaceTest.java ! repl/testng/test/ToolBasicTest.java From andrei.eremeev at oracle.com Wed Mar 25 06:23:05 2015 From: andrei.eremeev at oracle.com (andrei.eremeev) Date: Wed, 25 Mar 2015 09:23:05 +0300 Subject: hg: kulla/dev/langtools: Add a pop-up declaration/statement editor window. This is a concept trial. Motivated by this, ignore duplicate declarations. In-Reply-To: <201503250007.t2P07M6v009533@aojmv0008> References: <201503250007.t2P07M6v009533@aojmv0008> Message-ID: <55125449.5050101@oracle.com> It looks like that EditPad is not created on EDT. It can be a cause of unexpected failures. See the end of the page: http://docs.oracle.com/javase/8/docs/api/javax/swing/package-summary.html Andrei Eremeev On 03/25/2015 03:07 AM, robert.field at oracle.com wrote: > Changeset: ed58a08cebaa > Author: rfield > Date: 2015-03-24 17:07 -0700 > URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/ed58a08cebaa > > Add a pop-up declaration/statement editor window. This is a concept trial. Motivated by this, ignore duplicate declarations. > > ! repl/src/impl/EvalStateImpl.java > + repl/src/tool/EditPad.java > ! repl/src/tool/Repl.java > ! repl/testng/test/ClassesTest.java > ! repl/testng/test/ReplaceTest.java > ! repl/testng/test/ToolBasicTest.java > From andrei.eremeev at oracle.com Wed Mar 25 15:35:16 2015 From: andrei.eremeev at oracle.com (andrei.eremeev) Date: Wed, 25 Mar 2015 18:35:16 +0300 Subject: Crashes in REPL Message-ID: <5512D5B4.1000703@oracle.com> Hi REPL team, Hi REPL team, 1. After several invocations of the code which causes StackOverflowError followed by the code which causes OutOfMemoryError leads to message "| Exception while reading file: java.lang.ArrayIndexOutOfBoundsException: -1" See ErrorTranslation# stressTest(). 2. REPL crashes with com.sun.tools.javac.code.ClassFinder$BadClassFile. Steps to reproduce: - run all tests; - run REPL; - type "new test." [TAB] Exception in thread "main" com.sun.tools.javac.code.ClassFinder$BadClassFile: bad class file: build/test/ErrorTranslationTest.class class file contains wrong class: ErrorTranslationTest Please remove or make sure it appears in the correct subdirectory of the classpath. at com.sun.tools.javac.jvm.ClassReader.badClassFile(ClassReader.java:249) at com.sun.tools.javac.jvm.ClassReader.readClass(ClassReader.java:2172) at com.sun.tools.javac.jvm.ClassReader.readClassBuffer(ClassReader.java:2283) at com.sun.tools.javac.jvm.ClassReader.readClassFile(ClassReader.java:2294) at com.sun.tools.javac.code.ClassFinder.fillIn(ClassFinder.java:346) at com.sun.tools.javac.code.ClassFinder.complete(ClassFinder.java:285) at com.sun.tools.javac.code.ClassFinder.access$000(ClassFinder.java:72) at com.sun.tools.javac.code.ClassFinder$1.complete(ClassFinder.java:159) at com.sun.tools.javac.code.Symbol.complete(Symbol.java:569) at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:1053) at com.sun.tools.javac.code.Symbol$ClassSymbol.flags(Symbol.java:987) at com.sun.tools.javac.code.Symbol$TypeSymbol.getEnclosedElements(Symbol.java:735) at impl.SourceCodeAnalysisImpl.membersOf(SourceCodeAnalysisImpl.java:366) at impl.SourceCodeAnalysisImpl.computeSuggestions(SourceCodeAnalysisImpl.java:256) at impl.SourceCodeAnalysisImpl.completionSuggestions(SourceCodeAnalysisImpl.java:197) at tool.ConsoleIOContext$1.complete(Repl.java:1344) at jline.console.ConsoleReader.complete(ConsoleReader.java:3261) at jline.console.ConsoleReader.readLine(ConsoleReader.java:2621) at jline.console.ConsoleReader.readLine(ConsoleReader.java:2269) at tool.ConsoleIOContext.readLine(Repl.java:1320) at tool.Repl.run(Repl.java:338) at tool.Repl.start(Repl.java:219) at tool.Repl.start(Repl.java:198) at tool.Repl.main(Repl.java:188) From andrei.eremeev at oracle.com Wed Mar 25 17:40:37 2015 From: andrei.eremeev at oracle.com (andrei.eremeev at oracle.com) Date: Wed, 25 Mar 2015 17:40:37 +0000 Subject: hg: kulla/dev/langtools: Tests for StackOverflowError and OutOfMemoryError. Message-ID: <201503251740.t2PHebGu021078@aojmv0008> Changeset: 4e0c545f896c Author: aeremeev Date: 2015-03-25 20:40 +0300 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/4e0c545f896c Tests for StackOverflowError and OutOfMemoryError. ! repl/testng/test/ErrorTranslationTest.java ! repl/testng/test/ExceptionsTest.java ! repl/testng/test/ReplToolTesting.java ! repl/testng/test/ToolBasicTest.java From jan.lahoda at oracle.com Wed Mar 25 20:46:18 2015 From: jan.lahoda at oracle.com (jan.lahoda at oracle.com) Date: Wed, 25 Mar 2015 20:46:18 +0000 Subject: hg: kulla/dev/langtools: Command completion should be disabled during while entering continuation of previous line(s). Message-ID: <201503252046.t2PKkIqc028448@aojmv0008> Changeset: a2d5eb60a928 Author: jlahoda Date: 2015-03-25 21:36 +0100 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/a2d5eb60a928 Command completion should be disabled during while entering continuation of previous line(s). Contributed-by: bitterfoxc at gmail.com ! repl/src/tool/Repl.java From jan.lahoda at oracle.com Wed Mar 25 20:46:36 2015 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Wed, 25 Mar 2015 21:46:36 +0100 Subject: hg: kulla/dev/langtools: Completion for REPL commands and their arguments. In-Reply-To: References: <201503240622.t2O6MlW3027950@aojmv0008> Message-ID: <55131EAC.9070204@oracle.com> Hello Shinya, Thanks for the patch, pushed. Jan On 25.3.2015 00:12, ShinyaYoshida wrote: > Hi, Jan. > > Consider this case: > > -> void m(int n) {} > -> int num1 = 1, num2 = 2 > > -> m(num1 > >> /[tab] > > /classes /classpath /exit /feedback /help etc... > > Currently, REPL prints command suggestions. > But, REPL should print code suggestions, not command suggestions. > > Please consider my patch. > webrev: http://cr.openjdk.java.net/~shinyafox/kulla/a522e3dbc4ef/webrev.00/ > > Regards, > shinyafox(Shinya Yoshida) > > 2015-03-24 15:22 GMT+09:00 >: > > Changeset: a522e3dbc4ef > Author: jlahoda > Date: 2015-03-24 07:18 +0100 > URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/a522e3dbc4ef > > Completion for REPL commands and their arguments. > > ! repl/src/tool/Repl.java > + repl/testng/test/CommandCompletionTest.java > ! repl/testng/test/ReplToolTesting.java > ! repl/testng/testng.xml > > From robert.field at oracle.com Wed Mar 25 23:58:22 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Wed, 25 Mar 2015 23:58:22 +0000 Subject: hg: kulla/dev/langtools: Run Edit Pad on EDT. REPL tool: Process remaining text unrelated to the number of units in the proceeding result. Message-ID: <201503252358.t2PNwMfV007927@aojmv0008> Changeset: 6c0490166ce2 Author: rfield Date: 2015-03-25 16:54 -0700 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/6c0490166ce2 Run Edit Pad on EDT. REPL tool: Process remaining text unrelated to the number of units in the proceeding result. ! repl/src/tool/EditPad.java ! repl/src/tool/Repl.java ! repl/testng/test/ToolBasicTest.java From robert.field at oracle.com Wed Mar 25 23:59:07 2015 From: robert.field at oracle.com (Robert Field) Date: Wed, 25 Mar 2015 16:59:07 -0700 Subject: hg: kulla/dev/langtools: Add a pop-up declaration/statement editor window. This is a concept trial. Motivated by this, ignore duplicate declarations. In-Reply-To: <55125449.5050101@oracle.com> References: <201503250007.t2P07M6v009533@aojmv0008> <55125449.5050101@oracle.com> Message-ID: <55134BCB.5060304@oracle.com> On 03/24/15 23:23, andrei.eremeev wrote: > It looks like that EditPad is not created on EDT. It can be a cause of > unexpected failures. See the end of the page: > http://docs.oracle.com/javase/8/docs/api/javax/swing/package-summary.html > > Andrei Eremeev Good catch! Fix pushed. -Robert > > On 03/25/2015 03:07 AM, robert.field at oracle.com wrote: >> Changeset: ed58a08cebaa >> Author: rfield >> Date: 2015-03-24 17:07 -0700 >> URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/ed58a08cebaa >> >> Add a pop-up declaration/statement editor window. This is a concept >> trial. Motivated by this, ignore duplicate declarations. >> >> ! repl/src/impl/EvalStateImpl.java >> + repl/src/tool/EditPad.java >> ! repl/src/tool/Repl.java >> ! repl/testng/test/ClassesTest.java >> ! repl/testng/test/ReplaceTest.java >> ! repl/testng/test/ToolBasicTest.java >> > From robert.field at oracle.com Thu Mar 26 02:23:25 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Thu, 26 Mar 2015 02:23:25 +0000 Subject: hg: kulla/dev/langtools: Fix ArrayIndexOutOfBoundsException on empty stack trace. Seen on stress test that cycles between StackOverflowError and OutOfMemoryError. Message-ID: <201503260223.t2Q2NQi3003135@aojmv0008> Changeset: 759cb7863900 Author: rfield Date: 2015-03-25 19:23 -0700 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/759cb7863900 Fix ArrayIndexOutOfBoundsException on empty stack trace. Seen on stress test that cycles between StackOverflowError and OutOfMemoryError. ! repl/src/impl/EvalStateImpl.java From jan.lahoda at oracle.com Thu Mar 26 08:11:05 2015 From: jan.lahoda at oracle.com (jan.lahoda at oracle.com) Date: Thu, 26 Mar 2015 08:11:05 +0000 Subject: hg: kulla/dev/langtools: Disabling event expansion. Message-ID: <201503260811.t2Q8B5M0028326@aojmv0008> Changeset: 879daa36f7a6 Author: jlahoda Date: 2015-03-26 08:39 +0100 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/879daa36f7a6 Disabling event expansion. ! repl/src/tool/Repl.java From jan.lahoda at oracle.com Thu Mar 26 08:34:51 2015 From: jan.lahoda at oracle.com (jan.lahoda at oracle.com) Date: Thu, 26 Mar 2015 08:34:51 +0000 Subject: hg: kulla/dev/langtools: On Shift-TAB, show synopsis of the current method invocation. Message-ID: <201503260834.t2Q8Yp4d002051@aojmv0008> Changeset: a1940fea40a7 Author: jlahoda Date: 2015-03-26 09:18 +0100 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/a1940fea40a7 On Shift-TAB, show synopsis of the current method invocation. ! repl/src/api/SourceCodeAnalysis.java ! repl/src/impl/SourceCodeAnalysisImpl.java ! repl/src/tool/Repl.java ! repl/testng/test/CompletionTest.java ! repl/testng/test/KullaTesting.java From bitterfoxc at gmail.com Thu Mar 26 13:01:45 2015 From: bitterfoxc at gmail.com (ShinyaYoshida) Date: Thu, 26 Mar 2015 22:01:45 +0900 Subject: More fix around suggestions for the multi-line code. Message-ID: Hi Jan, Thank you for your pushing my patch. I have more patch around suggestions for the multi-line code. Please review my patch. webrev: http://cr.openjdk.java.net/~shinyafox/kulla/201503262/webrev.00/ 1. Find suggestions, considering the incompleting code: Currently, REPL prints all suggestions for the following code: ---- ->"". >>[TAB]Display all 446 possibilities? (y or n) ---- But, it should print members of String class. ---- ->"". >>[TAB] CASE_INSENSITIVE_ORDER String( charAt( etc... ---- 2. Don't print a command documentation in the multi-line code: Currently, REPL prints the command documentation in the multi-line code. ---- ->"". >>/list all[SHIFT+TAB] list the source you have typed ---- But, it shouldn't print the command documentation. 3. Print method documentation in multi-line code: Currently, REPL don't print the method documentation in the multi-line code. But, it should print the method documentation such as following: ---- ->"". >>split([SHIFt+TAB] java.lang.String.split(java.lang.String arg0, int arg1) java.lang.String.split(java.lang.String arg0) ---- Regards, shinyafox(Shinya Yoshida) From jan.lahoda at oracle.com Thu Mar 26 16:23:12 2015 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Thu, 26 Mar 2015 17:23:12 +0100 Subject: More fix around suggestions for the multi-line code. In-Reply-To: References: Message-ID: <55143270.6020304@oracle.com> Hi Shinya, Thanks for the report and patch. Thinking about this, I was not sure if making ConsoleIOContext more dependent on details in the Repl class is a good direction. I think it may be better to simply pass the current "prefix" (incomplete String) into the IOContext.readLine - any particular IOContext may then decide what to do with the current prefix. This would avoid tight coupling between ConsoleIOContext and Repl classes. A patch implementing that is attached - what do you think? Thanks, Jan On 26.3.2015 14:01, ShinyaYoshida wrote: > Hi Jan, > Thank you for your pushing my patch. > > I have more patch around suggestions for the multi-line code. > > Please review my patch. > webrev: http://cr.openjdk.java.net/~shinyafox/kulla/201503262/webrev.00/ > > 1. Find suggestions, considering the incompleting code: > > Currently, REPL prints all suggestions for the following code: > > ---- > ->"". >>> [TAB]Display all 446 possibilities? (y or n) > ---- > > But, it should print members of String class. > > ---- > ->"". >>> [TAB] > > CASE_INSENSITIVE_ORDER String( charAt( etc... > ---- > > 2. Don't print a command documentation in the multi-line code: > > Currently, REPL prints the command documentation in the multi-line code. > > ---- > ->"". >>> /list all[SHIFT+TAB] > list the source you have typed > ---- > > But, it shouldn't print the command documentation. > > 3. Print method documentation in multi-line code: > > Currently, REPL don't print the method documentation in the multi-line code. > But, it should print the method documentation such as following: > > ---- > ->"". >>> split([SHIFt+TAB] > java.lang.String.split(java.lang.String arg0, int arg1) > java.lang.String.split(java.lang.String arg0) > ---- > > Regards, > shinyafox(Shinya Yoshida) > -------------- next part -------------- A non-text attachment was scrubbed... Name: context-read-line-prefix.diff Type: text/x-patch Size: 3392 bytes Desc: not available URL: From bitterfoxc at gmail.com Thu Mar 26 16:51:40 2015 From: bitterfoxc at gmail.com (ShinyaYoshida) Date: Fri, 27 Mar 2015 01:51:40 +0900 Subject: More fix around suggestions for the multi-line code. In-Reply-To: <55143270.6020304@oracle.com> References: <55143270.6020304@oracle.com> Message-ID: Hi Jan, Thank you for your review. Certainly, the dependent is not good and passing the current prefix is looks good to me. I agree with you. Your patch looks almost good to me. But, I think you should add a little of fix to resolve "3: Print method documentation in multi-line code" of previous my mail: (...) @@ -1434,7 +1435,7 @@ String buffer = in.getCursorBuffer().buffer.toString(); int cursor = in.getCursorBuffer().cursor; String doc; - if (buffer.trim().startsWith("/")) { + if (prefix.isEmpty() && buffer.trim().startsWith("/")) { doc = repl.commandDocumentation(buffer, cursor); } else { - doc = repl.analysis.documentation(buffer, cursor); // HERE + doc = repl.analysis.documentation(prefix + buffer, cursor + prefix.length()) // HERE Regards, shinyafox(Shinya Yoshida) 2015-03-27 1:23 GMT+09:00 Jan Lahoda : > Hi Shinya, > > Thanks for the report and patch. Thinking about this, I was not sure if > making ConsoleIOContext more dependent on details in the Repl class is a > good direction. I think it may be better to simply pass the current > "prefix" (incomplete String) into the IOContext.readLine - any particular > IOContext may then decide what to do with the current prefix. This would > avoid tight coupling between ConsoleIOContext and Repl classes. > > A patch implementing that is attached - what do you think? > > Thanks, > Jan > > > On 26.3.2015 14:01, ShinyaYoshida wrote: > >> Hi Jan, >> Thank you for your pushing my patch. >> >> I have more patch around suggestions for the multi-line code. >> >> Please review my patch. >> webrev: http://cr.openjdk.java.net/~shinyafox/kulla/201503262/webrev.00/ >> >> 1. Find suggestions, considering the incompleting code: >> >> Currently, REPL prints all suggestions for the following code: >> >> ---- >> ->"". >> >>> [TAB]Display all 446 possibilities? (y or n) >>>> >>> ---- >> >> But, it should print members of String class. >> >> ---- >> ->"". >> >>> [TAB] >>>> >>> >> CASE_INSENSITIVE_ORDER String( charAt( etc... >> ---- >> >> 2. Don't print a command documentation in the multi-line code: >> >> Currently, REPL prints the command documentation in the multi-line code. >> >> ---- >> ->"". >> >>> /list all[SHIFT+TAB] >>>> >>> list the source you have typed >> ---- >> >> But, it shouldn't print the command documentation. >> >> 3. Print method documentation in multi-line code: >> >> Currently, REPL don't print the method documentation in the multi-line >> code. >> But, it should print the method documentation such as following: >> >> ---- >> ->"". >> >>> split([SHIFt+TAB] >>>> >>> java.lang.String.split(java.lang.String arg0, int arg1) >> java.lang.String.split(java.lang.String arg0) >> ---- >> >> Regards, >> shinyafox(Shinya Yoshida) >> >> From jan.lahoda at oracle.com Fri Mar 27 20:23:39 2015 From: jan.lahoda at oracle.com (jan.lahoda at oracle.com) Date: Fri, 27 Mar 2015 20:23:39 +0000 Subject: hg: kulla/dev/langtools: Fixing completion and documentation for input continuation. Message-ID: <201503272023.t2RKNdc6009744@aojmv0008> Changeset: b5fe3150ad0f Author: jlahoda Date: 2015-03-27 20:35 +0100 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/b5fe3150ad0f Fixing completion and documentation for input continuation. Contributed-by: bitterfoxc at gmail.com, jan.lahoda at oracle.com ! repl/src/tool/Repl.java From jan.lahoda at oracle.com Fri Mar 27 20:24:45 2015 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Fri, 27 Mar 2015 21:24:45 +0100 Subject: More fix around suggestions for the multi-line code. In-Reply-To: References: <55143270.6020304@oracle.com> Message-ID: <5515BC8D.1030509@oracle.com> Hi Shinya, On 26.3.2015 17:51, ShinyaYoshida wrote: > Hi Jan, > Thank you for your review. > > Certainly, the dependent is not good and passing the current prefix is > looks good to me. I agree with you. > > Your patch looks almost good to me. > But, I think you should add a little of fix to resolve "3: Print method > documentation in multi-line code" of previous my mail: Yes, sorry I missed that. Pushed. Thanks, Jan > > (...) > @@ -1434,7 +1435,7 @@ > String buffer = in.getCursorBuffer().buffer.toString(); > int cursor = in.getCursorBuffer().cursor; > String doc; > - if (buffer.trim().startsWith("/")) { > + if (prefix.isEmpty() && buffer.trim().startsWith("/")) { > doc = repl.commandDocumentation(buffer, cursor); > } else { > - doc = repl.analysis.documentation(buffer, cursor); // HERE > + doc = repl.analysis.documentation(prefix + buffer, cursor + > prefix.length()) // HERE > > Regards, > shinyafox(Shinya Yoshida) > > > 2015-03-27 1:23 GMT+09:00 Jan Lahoda >: > > Hi Shinya, > > Thanks for the report and patch. Thinking about this, I was not sure > if making ConsoleIOContext more dependent on details in the Repl > class is a good direction. I think it may be better to simply pass > the current "prefix" (incomplete String) into the IOContext.readLine > - any particular IOContext may then decide what to do with the > current prefix. This would avoid tight coupling between > ConsoleIOContext and Repl classes. > > A patch implementing that is attached - what do you think? > > Thanks, > Jan > > > On 26.3.2015 14:01, ShinyaYoshida wrote: > > Hi Jan, > Thank you for your pushing my patch. > > I have more patch around suggestions for the multi-line code. > > Please review my patch. > webrev: > http://cr.openjdk.java.net/~__shinyafox/kulla/201503262/__webrev.00/ > > > 1. Find suggestions, considering the incompleting code: > > Currently, REPL prints all suggestions for the following code: > > ---- > ->"". > > [TAB]Display all 446 possibilities? (y or n) > > ---- > > But, it should print members of String class. > > ---- > ->"". > > [TAB] > > > CASE_INSENSITIVE_ORDER String( charAt( etc... > ---- > > 2. Don't print a command documentation in the multi-line code: > > Currently, REPL prints the command documentation in the > multi-line code. > > ---- > ->"". > > /list all[SHIFT+TAB] > > list the source you have typed > ---- > > But, it shouldn't print the command documentation. > > 3. Print method documentation in multi-line code: > > Currently, REPL don't print the method documentation in the > multi-line code. > But, it should print the method documentation such as following: > > ---- > ->"". > > split([SHIFt+TAB] > > java.lang.String.split(java.__lang.String arg0, int arg1) > java.lang.String.split(java.__lang.String arg0) > ---- > > Regards, > shinyafox(Shinya Yoshida) > > From jan.lahoda at oracle.com Sat Mar 28 07:21:05 2015 From: jan.lahoda at oracle.com (jan.lahoda at oracle.com) Date: Sat, 28 Mar 2015 07:21:05 +0000 Subject: hg: kulla/dev/langtools: Workaround possible CompletionFailure when listing package elements Message-ID: <201503280721.t2S7L5Cm025729@aojmv0008> Changeset: 8377eb53deb8 Author: jlahoda Date: 2015-03-28 08:06 +0100 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/8377eb53deb8 Workaround possible CompletionFailure when listing package elements ! repl/src/impl/SourceCodeAnalysisImpl.java ! repl/testng/test/CompletionTest.java From bitterfoxc at gmail.com Sat Mar 28 18:03:57 2015 From: bitterfoxc at gmail.com (ShinyaYoshida) Date: Sun, 29 Mar 2015 03:03:57 +0900 Subject: Unnecessary suggestion in on-demand import statements Message-ID: Hi. I found the unnecessary suggestion bug in on-demand import statements: -> import java.util.*[TAB]Display all 114 possibilities? (y or n) REPL shouldn't print any suggestion in on-demand import statements. Here is the fix & test: http://cr.openjdk.java.net/~shinyafox/kulla/20153291/webrev.00/ Regards, shinyafox(Shinya Yoshida) From bitterfoxc at gmail.com Sun Mar 29 16:32:52 2015 From: bitterfoxc at gmail.com (ShinyaYoshida) Date: Mon, 30 Mar 2015 01:32:52 +0900 Subject: Missing suggestions for full qualified name in the assignment or the parameter Message-ID: Hi, I found missing suggestions for full qualified name in the assignment or the parameter: -> Optional opt = java.u[TAB] Currently, REPL doesn't suggest anything. But it should do "util". Here is the fix and tests for this problem: http://cr.openjdk.java.net/~shinyafox/kulla/201503301/webrev.00/ Regards, shinyafox(Shinya Yoshida) From bitterfoxc at gmail.com Mon Mar 30 02:15:58 2015 From: bitterfoxc at gmail.com (ShinyaYoshida) Date: Mon, 30 Mar 2015 11:15:58 +0900 Subject: Missing suggestions for full qualified name in the assignment or the parameter In-Reply-To: References: Message-ID: I've updated my patch. New patch is following: http://cr.openjdk.java.net/~shinyafox/kulla/201503301/webrev.01/ 2015-03-30 1:32 GMT+09:00 ShinyaYoshida : > Hi, > I found missing suggestions for full qualified name in the assignment or > the parameter: > > -> Optional opt = java.u[TAB] > > Currently, REPL doesn't suggest anything. > But it should do "util". > > Here is the fix and tests for this problem: > http://cr.openjdk.java.net/~shinyafox/kulla/201503301/webrev.00/ > > Regards, > shinyafox(Shinya Yoshida) > From andrei.eremeev at oracle.com Mon Mar 30 15:41:24 2015 From: andrei.eremeev at oracle.com (andrei.eremeev) Date: Mon, 30 Mar 2015 18:41:24 +0300 Subject: Bugs Message-ID: <55196EA4.70909@oracle.com> Hi REPL team, The following declaration fails with compilation error if there is no space between "I" and "{". See SimpleRegressionTest#testNoSpaceBetweenIAndBrace -> interface I { void f(); } | Added interface I -> class C implements I{ public void f() {}} | Error: | f() in C cannot implement f() in I | attempting to assign weaker access privileges; was public | class C implements I{ public void f() {}} | ^---------^ Andrei Eremeev From andrei.eremeev at oracle.com Mon Mar 30 15:56:26 2015 From: andrei.eremeev at oracle.com (andrei.eremeev at oracle.com) Date: Mon, 30 Mar 2015 15:56:26 +0000 Subject: hg: kulla/dev/langtools: Small regression test. Message-ID: <201503301556.t2UFuQqH003678@aojmv0008> Changeset: 13b2bd68523e Author: aeremeev Date: 2015-03-30 18:56 +0300 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/13b2bd68523e Small regression test. ! repl/testng/test/ErrorTranslationTest.java ! repl/testng/test/SimpleRegressionTest.java From robert.field at oracle.com Mon Mar 30 17:39:08 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Mon, 30 Mar 2015 17:39:08 +0000 Subject: hg: kulla/dev/langtools: Fix dependency on system class loader as URLClassLoader. Steps towards using base name for imported classes. Message-ID: <201503301739.t2UHd9AA027083@aojmv0008> Changeset: 54aaf7f000d8 Author: rfield Date: 2015-03-30 10:38 -0700 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/54aaf7f000d8 Fix dependency on system class loader as URLClassLoader. Steps towards using base name for imported classes. ! repl/src/impl/EvalStateImpl.java ! repl/src/impl/SnippetMaps.java ! repl/src/remote/RemoteClassLoader.java ! repl/src/tool/Repl.java From robert.field at oracle.com Mon Mar 30 19:28:22 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Mon, 30 Mar 2015 19:28:22 +0000 Subject: hg: kulla/dev/langtools: Remove package name prefix from imported class names. Message-ID: <201503301928.t2UJSMNB024422@aojmv0008> Changeset: 14bc224c384b Author: rfield Date: 2015-03-30 12:28 -0700 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/14bc224c384b Remove package name prefix from imported class names. ! repl/TODO ! repl/src/impl/EvalStateImpl.java ! repl/src/impl/SnippetImpl.java ! repl/src/impl/SnippetMaps.java From robert.field at oracle.com Tue Mar 31 02:11:50 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Tue, 31 Mar 2015 02:11:50 +0000 Subject: hg: kulla/dev/langtools: Make compatible with upcoming Jigsaw. Message-ID: <201503310211.t2V2BoTe004061@aojmv0008> Changeset: a5e4db58cce7 Author: rfield Date: 2015-03-30 19:11 -0700 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/a5e4db58cce7 Make compatible with upcoming Jigsaw. ! repl/src/impl/MemoryFileManager.java From andrei.eremeev at oracle.com Tue Mar 31 10:42:09 2015 From: andrei.eremeev at oracle.com (andrei.eremeev) Date: Tue, 31 Mar 2015 13:42:09 +0300 Subject: Completion suggestion bugs Message-ID: <551A7A01.5060102@oracle.com> Hi REPL team, Bugs: 1. /classpath does not suggest jar files to add to classpath. 2. /edit should suggest snippets or snippets numbers declared in the REPL session. Andrei Eremeev From andrei.eremeev at oracle.com Tue Mar 31 13:12:33 2015 From: andrei.eremeev at oracle.com (andrei.eremeev at oracle.com) Date: Tue, 31 Mar 2015 13:12:33 +0000 Subject: hg: kulla/dev/langtools: Tests for command completion Message-ID: <201503311312.t2VDCXgr013882@aojmv0008> Changeset: a3c76b8602e1 Author: aeremeev Date: 2015-03-31 16:12 +0300 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/a3c76b8602e1 Tests for command completion ! repl/testng/test/CommandCompletionTest.java ! repl/testng/test/CompletionTest.java ! repl/testng/test/ReplToolTesting.java From robert.field at oracle.com Tue Mar 31 18:27:59 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Tue, 31 Mar 2015 18:27:59 +0000 Subject: hg: kulla/dev/langtools: Fix spacing sensitive bracket detection in modifier removal. Message-ID: <201503311828.t2VIRxkS001471@aojmv0008> Changeset: d915d6fb2bcf Author: rfield Date: 2015-03-31 11:27 -0700 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/d915d6fb2bcf Fix spacing sensitive bracket detection in modifier removal. ! repl/TODO ! repl/src/impl/MaskCommentsAndModifiers.java ! repl/src/tool/Repl.java ! repl/testng/test/ClassesTest.java From robert.field at oracle.com Tue Mar 31 18:29:20 2015 From: robert.field at oracle.com (Robert Field) Date: Tue, 31 Mar 2015 11:29:20 -0700 Subject: Bugs In-Reply-To: <55196EA4.70909@oracle.com> References: <55196EA4.70909@oracle.com> Message-ID: <551AE780.9080903@oracle.com> Fix pushed: hg: kulla/dev/langtools: Fix spacing sensitive bracket detection in modifier removal. -Robert On 03/30/15 08:41, andrei.eremeev wrote: > Hi REPL team, > > The following declaration fails with compilation error if there is no > space between "I" and "{". See > SimpleRegressionTest#testNoSpaceBetweenIAndBrace > > -> interface I { void f(); } > | Added interface I > > -> class C implements I{ public void f() {}} > | Error: > | f() in C cannot implement f() in I > | attempting to assign weaker access privileges; was public > | class C implements I{ public void f() {}} > | ^---------^ > > > Andrei Eremeev From robert.field at oracle.com Tue Mar 31 18:48:59 2015 From: robert.field at oracle.com (robert.field at oracle.com) Date: Tue, 31 Mar 2015 18:48:59 +0000 Subject: hg: kulla/dev/langtools: Add -startup and -nostartup command line options. Message-ID: <201503311848.t2VImxqu005999@aojmv0008> Changeset: 1646532f7c82 Author: rfield Date: 2015-03-31 11:48 -0700 URL: http://hg.openjdk.java.net/kulla/dev/langtools/rev/1646532f7c82 Add -startup and -nostartup command line options. ! repl/src/tool/Repl.java