|
18 | 18 | import org.jd.core.v1.model.javasyntax.type.Type;
|
19 | 19 | import org.jd.core.v1.model.javasyntax.type.Types;
|
20 | 20 | import org.jd.core.v1.model.message.DecompileContext;
|
| 21 | +import org.jd.core.v1.model.token.Token; |
21 | 22 | import org.jd.core.v1.printer.PlainTextMetaPrinter;
|
22 | 23 | import org.jd.core.v1.service.fragmenter.javasyntaxtojavafragment.JavaSyntaxToJavaFragmentProcessor;
|
23 | 24 | import org.jd.core.v1.service.layouter.LayoutFragmentProcessor;
|
24 | 25 | import org.jd.core.v1.service.tokenizer.javafragmenttotoken.JavaFragmentToTokenProcessor;
|
25 | 26 | import org.jd.core.v1.service.writer.WriteTokenProcessor;
|
| 27 | +import org.jd.core.v1.util.DefaultList; |
26 | 28 | import org.junit.Assert;
|
27 | 29 | import org.junit.Test;
|
28 | 30 |
|
@@ -153,7 +155,8 @@ public void testClassDeclaration() throws Exception {
|
153 | 155 |
|
154 | 156 | fragmenter.process(compilationUnit, decompileContext);
|
155 | 157 | layouter.process(decompileContext);
|
156 |
| - tokenizer.process(decompileContext); |
| 158 | + DefaultList<Token> tokens = tokenizer.process(decompileContext.getBody()); |
| 159 | + decompileContext.setTokens(tokens); |
157 | 160 | writer.process(decompileContext);
|
158 | 161 |
|
159 | 162 | String source = printer.toString();
|
@@ -194,7 +197,9 @@ public void testInterfaceDeclaration() throws Exception {
|
194 | 197 |
|
195 | 198 | fragmenter.process(compilationUnit, decompileContext);
|
196 | 199 | layouter.process(decompileContext);
|
197 |
| - tokenizer.process(decompileContext); |
| 200 | + DefaultList<Token> tokens = tokenizer.process(decompileContext.getBody()); |
| 201 | + decompileContext.setTokens(tokens); |
| 202 | + |
198 | 203 | writer.process(decompileContext);
|
199 | 204 |
|
200 | 205 | String source = printer.toString();
|
@@ -245,7 +250,9 @@ public void testEnumDayDeclaration() throws Exception {
|
245 | 250 |
|
246 | 251 | fragmenter.process(compilationUnit, decompileContext);
|
247 | 252 | layouter.process(decompileContext);
|
248 |
| - tokenizer.process(decompileContext); |
| 253 | + DefaultList<Token> tokens = tokenizer.process(decompileContext.getBody()); |
| 254 | + decompileContext.setTokens(tokens); |
| 255 | + |
249 | 256 | writer.process(decompileContext);
|
250 | 257 |
|
251 | 258 | String source = printer.toString();
|
@@ -529,9 +536,11 @@ public void testEnumPlanetDeclaration() throws Exception {
|
529 | 536 | decompileContext.setMinorVersion(0);
|
530 | 537 |
|
531 | 538 | fragmenter.process(compilationUnit, decompileContext);
|
532 |
| - layouter.process(decompileContext); |
| 539 | + DefaultList<Token> tokens = tokenizer.process(decompileContext.getBody()); |
| 540 | + decompileContext.setTokens(tokens); |
| 541 | + |
533 | 542 | //tokenizer.process(message);
|
534 |
| - new JavaFragmentToTokenProcessor().process(decompileContext); |
| 543 | + tokens = new JavaFragmentToTokenProcessor().process(decompileContext.getBody()); |
535 | 544 | writer.process(decompileContext);
|
536 | 545 |
|
537 | 546 | String source = printer.toString();
|
@@ -600,7 +609,9 @@ public void testSwitch() throws Exception {
|
600 | 609 |
|
601 | 610 | fragmenter.process(compilationUnit, decompileContext);
|
602 | 611 | layouter.process(decompileContext);
|
603 |
| - tokenizer.process(decompileContext); |
| 612 | + DefaultList<Token> tokens = tokenizer.process(decompileContext.getBody()); |
| 613 | + decompileContext.setTokens(tokens); |
| 614 | + |
604 | 615 | writer.process(decompileContext);
|
605 | 616 |
|
606 | 617 | String source = printer.toString();
|
@@ -657,7 +668,9 @@ public void testBridgeAndSyntheticAttributes() throws Exception {
|
657 | 668 |
|
658 | 669 | fragmenter.process(compilationUnit, decompileContext);
|
659 | 670 | layouter.process(decompileContext);
|
660 |
| - tokenizer.process(decompileContext); |
| 671 | + DefaultList<Token> tokens = tokenizer.process(decompileContext.getBody()); |
| 672 | + decompileContext.setTokens(tokens); |
| 673 | + |
661 | 674 | writer.process(decompileContext);
|
662 | 675 |
|
663 | 676 | String source = printer.toString();
|
|
0 commit comments