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
小 白蛋
Intellij Community
Commits
6fa34ea2
Commit
6fa34ea2
authored
7 years ago
by
Roman Shevchenko
Browse files
Options
Download
Email Patches
Plain Diff
[java decompiler] reverts incorrect optimization
parent
63a201a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/collectors/ImportCollector.java
+10
-7
...ains/java/decompiler/main/collectors/ImportCollector.java
with
10 additions
and
7 deletions
+10
-7
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/collectors/ImportCollector.java
+
10
-
7
View file @
6fa34ea2
// Copyright 2000-2017 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.
/*
* Copyright 2000-2017 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
org.jetbrains.java.decompiler.main.collectors
;
import
org.jetbrains.java.decompiler.main.ClassesProcessor.ClassNode
;
...
...
@@ -68,14 +70,15 @@ public class ImportCollector {
}
public
String
getShortName
(
String
fullName
,
boolean
imported
)
{
ClassNode
node
=
DecompilerContext
.
getClassProcessor
().
getMapRootClasses
().
get
(
fullName
.
replace
(
'.'
,
'/'
));
ClassNode
node
=
DecompilerContext
.
getClassProcessor
().
getMapRootClasses
().
get
(
fullName
.
replace
(
'.'
,
'/'
));
//todo[r.sh] anonymous classes?
String
Builder
result
=
null
;
String
result
=
null
;
if
(
node
!=
null
&&
node
.
classStruct
.
isOwn
())
{
result
=
new
StringBuilder
(
String
.
valueOf
(
node
.
simpleName
))
;
result
=
node
.
simpleName
;
while
(
node
.
parent
!=
null
&&
node
.
type
==
ClassNode
.
CLASS_MEMBER
)
{
result
.
insert
(
0
,
node
.
parent
.
simpleName
+
'.'
);
//noinspection StringConcatenationInLoop
result
=
node
.
parent
.
simpleName
+
'.'
+
result
;
node
=
node
.
parent
;
}
...
...
@@ -84,7 +87,7 @@ public class ImportCollector {
fullName
=
fullName
.
replace
(
'/'
,
'.'
);
}
else
{
return
result
.
toString
()
;
return
result
;
}
}
else
{
...
...
@@ -121,7 +124,7 @@ public class ImportCollector {
}
}
return
result
==
null
?
shortName
:
result
.
toString
()
;
return
result
==
null
?
shortName
:
result
;
}
public
int
writeImports
(
TextBuffer
buffer
)
{
...
...
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