From 51c5586d97af2d62e82d246d3a7157e08cf4e8bd Mon Sep 17 00:00:00 2001 From: Alexander Koshevoy Date: Tue, 7 Aug 2018 20:17:12 +0300 Subject: [PATCH] PY-18029 Move auto-generated Thrift structures to com.jetbrains.python.console.protocol package --- python/helpers/pydev/pydev_console/console.thrift | 2 +- .../python/console/{ => protocol}/ArrayData.java | 4 ++-- .../python/console/{ => protocol}/ArrayHeaders.java | 4 ++-- .../python/console/{ => protocol}/ColHeader.java | 4 ++-- .../python/console/{ => protocol}/CompletionOption.java | 8 ++++---- .../console/{ => protocol}/CompletionOptionType.java | 2 +- .../python/console/{ => protocol}/DebugValue.java | 4 ++-- .../python/console/{ => protocol}/GetArrayResponse.java | 4 ++-- .../{ => protocol}/PythonConsoleBackendService.java | 4 ++-- .../{ => protocol}/PythonConsoleFrontendService.java | 4 ++-- .../python/console/{ => protocol}/RowHeader.java | 4 ++-- .../{ => protocol}/UnsupportedArrayTypeException.java | 4 ++-- .../python/console/PydevConsoleCommunication.java | 1 + .../python/console/PydevConsoleCommunicationUtil.kt | 2 ++ .../console/PythonConsoleBackendServiceDisposable.kt | 2 ++ .../jetbrains/python/console/PythonConsoleClientUtil.kt | 4 +++- 16 files changed, 32 insertions(+), 25 deletions(-) rename python/python-console/gen/com/jetbrains/python/console/{ => protocol}/ArrayData.java (99%) rename python/python-console/gen/com/jetbrains/python/console/{ => protocol}/ArrayHeaders.java (99%) rename python/python-console/gen/com/jetbrains/python/console/{ => protocol}/ColHeader.java (99%) rename python/python-console/gen/com/jetbrains/python/console/{ => protocol}/CompletionOption.java (98%) rename python/python-console/gen/com/jetbrains/python/console/{ => protocol}/CompletionOptionType.java (96%) rename python/python-console/gen/com/jetbrains/python/console/{ => protocol}/DebugValue.java (99%) rename python/python-console/gen/com/jetbrains/python/console/{ => protocol}/GetArrayResponse.java (99%) rename python/python-console/gen/com/jetbrains/python/console/{ => protocol}/PythonConsoleBackendService.java (99%) rename python/python-console/gen/com/jetbrains/python/console/{ => protocol}/PythonConsoleFrontendService.java (99%) rename python/python-console/gen/com/jetbrains/python/console/{ => protocol}/RowHeader.java (99%) rename python/python-console/gen/com/jetbrains/python/console/{ => protocol}/UnsupportedArrayTypeException.java (99%) diff --git a/python/helpers/pydev/pydev_console/console.thrift b/python/helpers/pydev/pydev_console/console.thrift index 979765d32de7..c87a3b94950d 100644 --- a/python/helpers/pydev/pydev_console/console.thrift +++ b/python/helpers/pydev/pydev_console/console.thrift @@ -1,4 +1,4 @@ -namespace java com.jetbrains.python.console +namespace java com.jetbrains.python.console.protocol /** * `com.jetbrains.python.console.PydevConsoleCommunication` diff --git a/python/python-console/gen/com/jetbrains/python/console/ArrayData.java b/python/python-console/gen/com/jetbrains/python/console/protocol/ArrayData.java similarity index 99% rename from python/python-console/gen/com/jetbrains/python/console/ArrayData.java rename to python/python-console/gen/com/jetbrains/python/console/protocol/ArrayData.java index 8335b87d8bc8..3020472ea088 100644 --- a/python/python-console/gen/com/jetbrains/python/console/ArrayData.java +++ b/python/python-console/gen/com/jetbrains/python/console/protocol/ArrayData.java @@ -4,10 +4,10 @@ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ -package com.jetbrains.python.console; +package com.jetbrains.python.console.protocol; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-05-18") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-08-07") public class ArrayData implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ArrayData"); diff --git a/python/python-console/gen/com/jetbrains/python/console/ArrayHeaders.java b/python/python-console/gen/com/jetbrains/python/console/protocol/ArrayHeaders.java similarity index 99% rename from python/python-console/gen/com/jetbrains/python/console/ArrayHeaders.java rename to python/python-console/gen/com/jetbrains/python/console/protocol/ArrayHeaders.java index de80cdc892d2..e94b91bb6eb6 100644 --- a/python/python-console/gen/com/jetbrains/python/console/ArrayHeaders.java +++ b/python/python-console/gen/com/jetbrains/python/console/protocol/ArrayHeaders.java @@ -4,10 +4,10 @@ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ -package com.jetbrains.python.console; +package com.jetbrains.python.console.protocol; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-05-18") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-08-07") public class ArrayHeaders implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ArrayHeaders"); diff --git a/python/python-console/gen/com/jetbrains/python/console/ColHeader.java b/python/python-console/gen/com/jetbrains/python/console/protocol/ColHeader.java similarity index 99% rename from python/python-console/gen/com/jetbrains/python/console/ColHeader.java rename to python/python-console/gen/com/jetbrains/python/console/protocol/ColHeader.java index 9e344fa170cb..cd868feb42f7 100644 --- a/python/python-console/gen/com/jetbrains/python/console/ColHeader.java +++ b/python/python-console/gen/com/jetbrains/python/console/protocol/ColHeader.java @@ -4,10 +4,10 @@ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ -package com.jetbrains.python.console; +package com.jetbrains.python.console.protocol; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-05-18") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-08-07") public class ColHeader implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ColHeader"); diff --git a/python/python-console/gen/com/jetbrains/python/console/CompletionOption.java b/python/python-console/gen/com/jetbrains/python/console/protocol/CompletionOption.java similarity index 98% rename from python/python-console/gen/com/jetbrains/python/console/CompletionOption.java rename to python/python-console/gen/com/jetbrains/python/console/protocol/CompletionOption.java index 18f2f1deb8a3..21b159b15ac4 100644 --- a/python/python-console/gen/com/jetbrains/python/console/CompletionOption.java +++ b/python/python-console/gen/com/jetbrains/python/console/protocol/CompletionOption.java @@ -4,10 +4,10 @@ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ -package com.jetbrains.python.console; +package com.jetbrains.python.console.protocol; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-05-18") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-08-07") public class CompletionOption implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CompletionOption"); @@ -623,7 +623,7 @@ public class CompletionOption implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DebugValue"); diff --git a/python/python-console/gen/com/jetbrains/python/console/GetArrayResponse.java b/python/python-console/gen/com/jetbrains/python/console/protocol/GetArrayResponse.java similarity index 99% rename from python/python-console/gen/com/jetbrains/python/console/GetArrayResponse.java rename to python/python-console/gen/com/jetbrains/python/console/protocol/GetArrayResponse.java index 0493fabf07da..5b029f479367 100644 --- a/python/python-console/gen/com/jetbrains/python/console/GetArrayResponse.java +++ b/python/python-console/gen/com/jetbrains/python/console/protocol/GetArrayResponse.java @@ -4,14 +4,14 @@ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ -package com.jetbrains.python.console; +package com.jetbrains.python.console.protocol; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) /** * Corresponds to `ArrayChunk`. * */ -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-07-02") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-08-07") public class GetArrayResponse implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetArrayResponse"); diff --git a/python/python-console/gen/com/jetbrains/python/console/PythonConsoleBackendService.java b/python/python-console/gen/com/jetbrains/python/console/protocol/PythonConsoleBackendService.java similarity index 99% rename from python/python-console/gen/com/jetbrains/python/console/PythonConsoleBackendService.java rename to python/python-console/gen/com/jetbrains/python/console/protocol/PythonConsoleBackendService.java index e9dc2a616b44..8d8d048235c7 100644 --- a/python/python-console/gen/com/jetbrains/python/console/PythonConsoleBackendService.java +++ b/python/python-console/gen/com/jetbrains/python/console/protocol/PythonConsoleBackendService.java @@ -4,10 +4,10 @@ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ -package com.jetbrains.python.console; +package com.jetbrains.python.console.protocol; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-07-24") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-08-07") public class PythonConsoleBackendService { public interface Iface { diff --git a/python/python-console/gen/com/jetbrains/python/console/PythonConsoleFrontendService.java b/python/python-console/gen/com/jetbrains/python/console/protocol/PythonConsoleFrontendService.java similarity index 99% rename from python/python-console/gen/com/jetbrains/python/console/PythonConsoleFrontendService.java rename to python/python-console/gen/com/jetbrains/python/console/protocol/PythonConsoleFrontendService.java index 9e50efcf6b83..5c9dcba05c3f 100644 --- a/python/python-console/gen/com/jetbrains/python/console/PythonConsoleFrontendService.java +++ b/python/python-console/gen/com/jetbrains/python/console/protocol/PythonConsoleFrontendService.java @@ -4,10 +4,10 @@ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ -package com.jetbrains.python.console; +package com.jetbrains.python.console.protocol; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-07-09") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-08-07") public class PythonConsoleFrontendService { public interface Iface { diff --git a/python/python-console/gen/com/jetbrains/python/console/RowHeader.java b/python/python-console/gen/com/jetbrains/python/console/protocol/RowHeader.java similarity index 99% rename from python/python-console/gen/com/jetbrains/python/console/RowHeader.java rename to python/python-console/gen/com/jetbrains/python/console/protocol/RowHeader.java index 295db1aa700a..79544953df24 100644 --- a/python/python-console/gen/com/jetbrains/python/console/RowHeader.java +++ b/python/python-console/gen/com/jetbrains/python/console/protocol/RowHeader.java @@ -4,10 +4,10 @@ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ -package com.jetbrains.python.console; +package com.jetbrains.python.console.protocol; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-05-18") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-08-07") public class RowHeader implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RowHeader"); diff --git a/python/python-console/gen/com/jetbrains/python/console/UnsupportedArrayTypeException.java b/python/python-console/gen/com/jetbrains/python/console/protocol/UnsupportedArrayTypeException.java similarity index 99% rename from python/python-console/gen/com/jetbrains/python/console/UnsupportedArrayTypeException.java rename to python/python-console/gen/com/jetbrains/python/console/protocol/UnsupportedArrayTypeException.java index f82af2ae7628..3a1d5b28fc71 100644 --- a/python/python-console/gen/com/jetbrains/python/console/UnsupportedArrayTypeException.java +++ b/python/python-console/gen/com/jetbrains/python/console/protocol/UnsupportedArrayTypeException.java @@ -4,10 +4,10 @@ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ -package com.jetbrains.python.console; +package com.jetbrains.python.console.protocol; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-07-24") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-08-07") public class UnsupportedArrayTypeException extends org.apache.thrift.TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("UnsupportedArrayTypeException"); diff --git a/python/src/com/jetbrains/python/console/PydevConsoleCommunication.java b/python/src/com/jetbrains/python/console/PydevConsoleCommunication.java index 49a2d35469ff..7832508b6fce 100644 --- a/python/src/com/jetbrains/python/console/PydevConsoleCommunication.java +++ b/python/src/com/jetbrains/python/console/PydevConsoleCommunication.java @@ -22,6 +22,7 @@ import com.intellij.xdebugger.frame.XCompositeNode; import com.intellij.xdebugger.frame.XValueChildrenList; import com.intellij.xdebugger.frame.XValueNode; import com.jetbrains.python.console.parsing.PythonConsoleData; +import com.jetbrains.python.console.protocol.*; import com.jetbrains.python.console.pydev.AbstractConsoleCommunication; import com.jetbrains.python.console.pydev.InterpreterResponse; import com.jetbrains.python.console.pydev.PydevCompletionVariant; diff --git a/python/src/com/jetbrains/python/console/PydevConsoleCommunicationUtil.kt b/python/src/com/jetbrains/python/console/PydevConsoleCommunicationUtil.kt index 78a5e0f2420d..ae96de77f9c7 100644 --- a/python/src/com/jetbrains/python/console/PydevConsoleCommunicationUtil.kt +++ b/python/src/com/jetbrains/python/console/PydevConsoleCommunicationUtil.kt @@ -4,6 +4,8 @@ package com.jetbrains.python.console import com.intellij.xdebugger.frame.XValueChildrenList +import com.jetbrains.python.console.protocol.DebugValue +import com.jetbrains.python.console.protocol.GetArrayResponse import com.jetbrains.python.debugger.ArrayChunk import com.jetbrains.python.debugger.ArrayChunkBuilder import com.jetbrains.python.debugger.PyDebugValue diff --git a/python/src/com/jetbrains/python/console/PythonConsoleBackendServiceDisposable.kt b/python/src/com/jetbrains/python/console/PythonConsoleBackendServiceDisposable.kt index de8d383e8564..3f589934b554 100644 --- a/python/src/com/jetbrains/python/console/PythonConsoleBackendServiceDisposable.kt +++ b/python/src/com/jetbrains/python/console/PythonConsoleBackendServiceDisposable.kt @@ -1,6 +1,8 @@ // Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.jetbrains.python.console +import com.jetbrains.python.console.protocol.PythonConsoleBackendService + /** * Not really [com.intellij.openapi.Disposable] as [dispose] method is expected * to be called directly. diff --git a/python/src/com/jetbrains/python/console/PythonConsoleClientUtil.kt b/python/src/com/jetbrains/python/console/PythonConsoleClientUtil.kt index 19832a79b969..509f945c9bfe 100644 --- a/python/src/com/jetbrains/python/console/PythonConsoleClientUtil.kt +++ b/python/src/com/jetbrains/python/console/PythonConsoleClientUtil.kt @@ -4,6 +4,7 @@ package com.jetbrains.python.console import com.intellij.util.ConcurrencyUtil +import com.jetbrains.python.console.protocol.PythonConsoleBackendService import java.lang.reflect.InvocationHandler import java.lang.reflect.InvocationTargetException import java.lang.reflect.Method @@ -20,7 +21,8 @@ fun synchronizedPythonConsoleClient(loader: ClassLoader, pythonConsoleProcess: Process): PythonConsoleBackendServiceDisposable { val executorService = ConcurrencyUtil.newSingleThreadExecutor(PYTHON_CONSOLE_COMMAND_THREAD_FACTORY_NAME) // make the `PythonConsoleBackendService.Iface` process-aware and thread-safe - val proxy = Proxy.newProxyInstance(loader, arrayOf>(PythonConsoleBackendService.Iface::class.java), + val proxy = Proxy.newProxyInstance(loader, arrayOf>( + PythonConsoleBackendService.Iface::class.java), InvocationHandler { _, method, args -> // we evaluate the original method in the other thread in order to control it val future = executorService.submit(Callable {