Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gjjs-bd-common
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
s_guodong
gjjs-bd-common
Commits
a67f26cd
Commit
a67f26cd
authored
Aug 25, 2023
by
s_guodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决int.toString问题
parent
cc45ff1a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
MdaDriver.java
...java/com/brilliance/mda/runtime/mda/driver/MdaDriver.java
+17
-5
No files found.
gjjs-bd-runtime/src/main/java/com/brilliance/mda/runtime/mda/driver/MdaDriver.java
View file @
a67f26cd
...
@@ -387,8 +387,8 @@ public class MdaDriver {
...
@@ -387,8 +387,8 @@ public class MdaDriver {
try
{
try
{
if
(
from
==
null
||
fromObj
==
null
||
to
==
null
||
toObj
==
null
)
if
(
from
==
null
||
fromObj
==
null
||
to
==
null
||
toObj
==
null
)
return
;
return
;
Class
<?>
fromClass
=
from
.
getType
(
);
Class
<?>
fromClass
=
getFieldType
(
from
);
Class
<?>
toClass
=
to
.
getType
(
);
Class
<?>
toClass
=
getFieldType
(
to
);
from
.
setAccessible
(
true
);
from
.
setAccessible
(
true
);
to
.
setAccessible
(
true
);
to
.
setAccessible
(
true
);
if
(
List
.
class
.
isAssignableFrom
(
fromClass
)
if
(
List
.
class
.
isAssignableFrom
(
fromClass
)
...
@@ -432,11 +432,9 @@ public class MdaDriver {
...
@@ -432,11 +432,9 @@ public class MdaDriver {
return
;
return
;
}
}
//类型不相等
//类型不相等
if
(!
to
.
getType
().
equals
(
from
.
getType
()
))
{
if
(!
to
Class
.
equals
(
fromClass
))
{
return
;
return
;
}
}
to
.
set
(
toObj
,
from
.
get
(
fromObj
));
to
.
set
(
toObj
,
from
.
get
(
fromObj
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -674,5 +672,19 @@ public class MdaDriver {
...
@@ -674,5 +672,19 @@ public class MdaDriver {
}
}
return
errorsMap
;
return
errorsMap
;
}
}
private
static
Class
getFieldType
(
Field
field
)
{
Class
<?>
type
=
field
.
getType
();
if
(
type
.
isAssignableFrom
(
int
.
class
))
{
return
Integer
.
class
;
}
if
(
type
.
isAssignableFrom
(
double
.
class
))
{
return
Double
.
class
;
}
return
type
;
}
}
}
Write
Preview
Markdown
is supported
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