You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by vi...@apache.org on 2020/07/01 02:56:52 UTC
[dubbo-go-hessian2] branch master updated (f7e01d2 -> 4116f3b)
This is an automated email from the ASF dual-hosted git repository.
victory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-go-hessian2.git.
from f7e01d2 add GetStackTrace method in Throwabler and its implements (#207)
add 445d48e fix hessian issue
add 6652e35 optimize exception bug
add 83c7cfc optimize exception bug
add a3a8fa9 fix review issue
add 863e393 fix review issue
add b582516 fix review issue
add e793b3e fix review issue
add 8d765a5 rename bizException to unknownException
add 41f41aa fix review issue
add 595e399 fix review issue
new 530c6c0 Merge branch 'master' of github.com:apache/dubbo-go-hessian2
new 4116f3b add unit test
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
java_exception/exception.go | 2 +-
java_unknown_exception.go | 90 +++++++++++++++++++++++
boolean_test.go => java_unknown_exception_test.go | 44 ++++-------
list.go | 6 ++
object.go | 5 ++
5 files changed, 118 insertions(+), 29 deletions(-)
create mode 100644 java_unknown_exception.go
copy boolean_test.go => java_unknown_exception_test.go (55%)
[dubbo-go-hessian2] 01/02: Merge branch 'master' of
github.com:apache/dubbo-go-hessian2
Posted by vi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
victory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-go-hessian2.git
commit 530c6c0cc8a999a083bf22637b2c7987ba56da83
Merge: 595e399 f7e01d2
Author: cvictory <sh...@gmail.com>
AuthorDate: Wed Jul 1 10:14:01 2020 +0800
Merge branch 'master' of github.com:apache/dubbo-go-hessian2
.../annotation_type_mismatch_exception.go | 5 +++
java_exception/arithmetic_exception.go | 5 +++
.../array_index_out_of_bounds_exception.go | 5 +++
java_exception/array_store_exception.go | 5 +++
java_exception/backing_store_exception.go | 5 +++
java_exception/broken_barrier_exception.go | 5 +++
java_exception/cancellation_exception.go | 5 +++
java_exception/class_not_found_exception.go | 5 +++
java_exception/classc_cast_exception.go | 5 +++
java_exception/clone_not_supported_exception.go | 5 +++
java_exception/completion_exception.go | 5 +++
.../concurrent_modification_exception.go | 5 +++
java_exception/data_format_exception.go | 5 +++
java_exception/date_time_exception.go | 5 +++
java_exception/date_time_parse_exception.go | 5 +++
java_exception/dubbo_generic_exception.go | 5 +++
java_exception/duplicate_format_flags_exception.go | 5 +++
java_exception/empty_stack_exception.go | 5 +++
.../enum_constant_not_present_exception.go | 5 +++
java_exception/eof_exception.go | 5 +++
java_exception/exception.go | 13 ++++++-
java_exception/execution_exception.go | 5 +++
java_exception/file_not_found_exception.go | 5 +++
java_exception/formatter_closed_exception.go | 5 +++
java_exception/illegal_access_exception.go | 5 +++
java_exception/illegal_argument_exception.go | 4 ++
java_exception/illegal_classFormat_exception.go | 5 +++
.../illegal_format_code_point_exception.go | 5 +++
.../illegal_format_conversion_exception.go | 5 +++
java_exception/illegal_format_flags_exception.go | 5 +++
.../illegal_format_precision_exception.go | 5 +++
java_exception/illegal_format_width_exception.go | 5 +++
java_exception/illegal_monitor_state_exception.go | 5 +++
java_exception/illegal_state_exception.go | 5 +++
java_exception/illegal_thread_state_exception.go | 5 +++
java_exception/illformed_locale_exception.go | 5 +++
java_exception/incomplete_annotation_exception.go | 5 +++
java_exception/index_out_of_bounds_exception.go | 5 +++
java_exception/input_mismatch_exception.go | 5 +++
java_exception/instantiation_exception.go | 5 +++
java_exception/interrupted_exception.go | 5 +++
java_exception/interrupted_io_exception.go | 5 +++
java_exception/invalid_class_exception.go | 5 +++
java_exception/invalid_object_exception.go | 5 +++
.../invalid_preferences_format_exception.go | 5 +++
.../invalid_properties_format_exception.go | 5 +++
java_exception/invocation_target_exception.go | 5 +++
java_exception/io_exception.go | 5 +++
java_exception/jar_exception.go | 5 +++
java_exception/lambda_conversion_exception.go | 5 +++
.../malformed_parameterized_type_exception.go | 5 +++
java_exception/malformed_parameters_exception.go | 5 +++
.../missing_format_argument_exception.go | 5 +++
java_exception/missing_format_width_exception.go | 5 +++
java_exception/missing_resource_exception.go | 5 +++
java_exception/negative_array_size_exception.go | 5 +++
java_exception/no_such_element_exception.go | 5 +++
java_exception/no_such_field_exception.go | 5 +++
java_exception/no_such_method_exception.go | 5 +++
java_exception/not_active_exception.go | 5 +++
java_exception/not_serializable_exception.go | 5 +++
java_exception/null_pointer_exception.go | 5 +++
java_exception/number_format_exception.go | 5 +++
java_exception/object_stream_exception.go | 5 +++
java_exception/optional_data_exception.go | 5 +++
java_exception/reflective_operation_exception.go | 5 +++
java_exception/rejected_execution_exception.go | 5 +++
java_exception/runtime_exception.go | 5 +++
java_exception/security_exception.go | 5 +++
java_exception/stream_corrupted_exception.go | 5 +++
.../string_index_out_of_bounds_exception.go | 5 +++
java_exception/sync_failed_exception.go | 5 +++
java_exception/timeout_exception.go | 5 +++
java_exception/too_many_listeners_exception.go | 5 +++
java_exception/type_not_present_exception.go | 5 +++
java_exception/unchecked_IO_exception.go | 5 +++
java_exception/undeclared_throwable_exception.go | 5 +++
.../unknown_format_conversion_exception.go | 5 +++
java_exception/unknown_format_flags_exception.go | 5 +++
java_exception/unmodifiable_class_exception.go | 5 +++
java_exception/unsupported_operation_exception.go | 5 +++
.../unsupported_temporal_type_exception.go | 5 +++
java_exception/utf_data_format_exception.go | 5 +++
java_exception/write_aborted_exception.go | 5 +++
java_exception/wrong_method_type_exception.go | 5 +++
java_exception/zip_exception.go | 5 +++
java_exception/zone_rules_exception.go | 5 +++
request.go | 3 +-
request_test.go | 44 +++++++++++++++++++++-
89 files changed, 485 insertions(+), 4 deletions(-)
[dubbo-go-hessian2] 02/02: add unit test
Posted by vi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
victory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-go-hessian2.git
commit 4116f3b07ec181b00f045ab56d2ce49a5d1dd8c2
Author: cvictory <sh...@gmail.com>
AuthorDate: Wed Jul 1 10:56:24 2020 +0800
add unit test
---
java_unknown_exception.go | 8 +++++---
java_unknown_exception_test.go | 43 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 48 insertions(+), 3 deletions(-)
diff --git a/java_unknown_exception.go b/java_unknown_exception.go
index 45f5a00..5ea5a49 100644
--- a/java_unknown_exception.go
+++ b/java_unknown_exception.go
@@ -26,7 +26,9 @@ import (
"github.com/apache/dubbo-go-hessian2/java_exception"
)
-var mutex sync.Mutex
+var (
+ expRegMutex sync.Mutex
+)
func checkAndGetException(cls classInfo) (structInfo, bool) {
@@ -48,8 +50,8 @@ func checkAndGetException(cls classInfo) (structInfo, bool) {
if throwable, ok = getStructInfo(cls.javaName); ok {
return throwable, true
}
- mutex.Lock()
- defer mutex.Unlock()
+ expRegMutex.Lock()
+ defer expRegMutex.Unlock()
RegisterPOJO(newBizException(cls.javaName))
if throwable, ok = getStructInfo(cls.javaName); ok {
return throwable, true
diff --git a/java_unknown_exception_test.go b/java_unknown_exception_test.go
new file mode 100644
index 0000000..fa14ed3
--- /dev/null
+++ b/java_unknown_exception_test.go
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package hessian
+
+import (
+ "github.com/stretchr/testify/assert"
+ "testing"
+)
+
+func TestCheckAndGetException(t *testing.T) {
+ clazzInfo1 := classInfo{
+ javaName: "com.test.UserDefinedException",
+ fieldNameList: []string{"detailMessage", "code", "suppressedExceptions", "stackTrace", "cause"},
+ }
+ s, b := checkAndGetException(clazzInfo1)
+ assert.True(t, b)
+
+ assert.Equal(t, s.javaName, "com.test.UserDefinedException")
+ assert.Equal(t, s.goName, "hessian.UnknownException")
+
+ clazzInfo2 := classInfo{
+ javaName: "com.test.UserDefinedException",
+ fieldNameList: []string{"detailMessage", "code", "suppressedExceptions", "cause"},
+ }
+ s, b = checkAndGetException(clazzInfo2)
+ assert.False(t, b)
+ assert.Equal(t, s, structInfo{})
+}