Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Fastjson
Commits
cc0c45b5
Commit
cc0c45b5
authored
10 years ago
by
wenshao
Browse files
Options
Download
Email Patches
Plain Diff
bug fixed
parent
0bb37322
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/com/alibaba/fastjson/util/DeserializeBeanInfo.java
+14
-16
...n/java/com/alibaba/fastjson/util/DeserializeBeanInfo.java
with
14 additions
and
16 deletions
+14
-16
src/main/java/com/alibaba/fastjson/util/DeserializeBeanInfo.java
+
14
-
16
View file @
cc0c45b5
...
...
@@ -87,6 +87,10 @@ public class DeserializeBeanInfo {
public
boolean
add
(
FieldInfo
field
)
{
for
(
FieldInfo
item
:
this
.
fieldList
)
{
if
(
item
.
getName
().
equals
(
field
.
getName
()))
{
if
(
item
.
isGetOnly
()
&&
!
field
.
isGetOnly
())
{
continue
;
}
return
false
;
}
}
...
...
@@ -259,7 +263,6 @@ public class DeserializeBeanInfo {
}
}
beanInfo
.
add
(
new
FieldInfo
(
propertyName
,
method
,
null
,
clazz
,
type
,
ordinal
,
serialzeFeatures
));
method
.
setAccessible
(
true
);
}
...
...
@@ -294,13 +297,7 @@ public class DeserializeBeanInfo {
propertyName
=
fieldAnnotation
.
name
();
}
}
FieldInfo
newFieldInfo
=
new
FieldInfo
(
propertyName
,
null
,
field
,
clazz
,
type
,
ordinal
,
serialzeFeatures
);
FieldInfo
oldFieldInfo
=
beanInfo
.
getField
(
propertyName
);
if
(
oldFieldInfo
!=
null
&&
newFieldInfo
.
isGetOnly
())
{
continue
;
}
beanInfo
.
add
(
newFieldInfo
);
beanInfo
.
add
(
new
FieldInfo
(
propertyName
,
null
,
field
,
clazz
,
type
,
ordinal
,
serialzeFeatures
));
}
for
(
Method
method
:
clazz
.
getMethods
())
{
...
...
@@ -324,15 +321,16 @@ public class DeserializeBeanInfo {
||
AtomicInteger
.
class
==
method
.
getReturnType
()
//
||
AtomicLong
.
class
==
method
.
getReturnType
()
//
)
{
String
propertyName
=
Character
.
toLowerCase
(
methodName
.
charAt
(
3
))
+
methodName
.
substring
(
4
);
FieldInfo
newFieldInfo
=
new
FieldInfo
(
propertyName
,
method
,
null
,
clazz
,
type
);
FieldInfo
oldFieldInfo
=
beanInfo
.
getField
(
propertyName
);
if
(
oldFieldInfo
!=
null
&&
newFieldInfo
.
isGetOnly
())
{
continue
;
}
String
propertyName
;
beanInfo
.
add
(
newFieldInfo
);
JSONField
annotation
=
method
.
getAnnotation
(
JSONField
.
class
);
if
(
annotation
!=
null
&&
annotation
.
name
().
length
()
>
0
)
{
propertyName
=
annotation
.
name
();
}
else
{
propertyName
=
Character
.
toLowerCase
(
methodName
.
charAt
(
3
))
+
methodName
.
substring
(
4
);
}
beanInfo
.
add
(
new
FieldInfo
(
propertyName
,
method
,
null
,
clazz
,
type
));
method
.
setAccessible
(
true
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help