Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
p x
earlywarning
Commits
858e6db0
Commit
858e6db0
authored
Jul 31, 2025
by
p x
Browse files
优化内存使用
parent
3169f154
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/cusc/adas/v2x/utils/Parse.java
View file @
858e6db0
...
@@ -9,6 +9,7 @@ import java.nio.ByteBuffer;
...
@@ -9,6 +9,7 @@ import java.nio.ByteBuffer;
import
java.nio.ByteOrder
;
import
java.nio.ByteOrder
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.charset.StandardCharsets
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.List
;
...
@@ -501,13 +502,13 @@ public class Parse {
...
@@ -501,13 +502,13 @@ public class Parse {
// public static void convoterBean( Object source , Object target) throws IllegalArgumentException, IllegalAccessException, ClassNotFoundException, InstantiationException, NoSuchFieldException, SecurityException {
// public static void convoterBean( Object source , Object target) throws IllegalArgumentException, IllegalAccessException, ClassNotFoundException, InstantiationException, NoSuchFieldException, SecurityException {
public
static
void
convoterBean
(
Object
source
,
Object
target
)
{
public
static
void
convoterBean
(
Object
source
,
Object
target
)
{
Field
[]
fields
=
source
.
getClass
().
getDeclaredFields
();
Field
[]
fields
=
source
.
getClass
().
getDeclaredFields
();
List
<
Field
>
fList
=
new
ArrayList
<>();
//
List<Field> fList = new ArrayList<>();
//
List<Field> fList = Arrays.asList(fields);
List
<
Field
>
fList
=
Arrays
.
asList
(
fields
);
for
(
Field
field
:
fields
)
{
//
for (Field field : fields) {
if
(
field
.
isAnnotationPresent
(
Order
.
class
))
{
//
if (field.isAnnotationPresent(Order.class)) {
fList
.
add
(
field
);
//
fList.add(field);
}
//
}
}
//
}
Collections
.
sort
(
fList
,
new
Comparator
<
Field
>()
{
Collections
.
sort
(
fList
,
new
Comparator
<
Field
>()
{
@Override
@Override
public
int
compare
(
Field
f1
,
Field
f2
)
{
public
int
compare
(
Field
f1
,
Field
f2
)
{
...
@@ -526,7 +527,7 @@ public class Parse {
...
@@ -526,7 +527,7 @@ public class Parse {
if
(
o
==
null
)
{
if
(
o
==
null
)
{
continue
;
continue
;
}
}
System
.
out
.
println
(
"---------fieldName "
+
field
.
getName
());
System
.
out
.
println
(
"---------
convoterBean old
fieldName "
+
field
.
getName
());
OffsetDef
offsetDef
=
null
;
OffsetDef
offsetDef
=
null
;
if
(
field
.
isAnnotationPresent
(
OffsetDef
.
class
))
{
if
(
field
.
isAnnotationPresent
(
OffsetDef
.
class
))
{
...
...
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