├── ASM-BO.iml
├── META-INF
└── plugin.xml
├── README
├── lib
├── reloc-asm-all-5.0.3.jar
└── rules.txt
└── src
├── images
└── asm.gif
└── org
└── objectweb
└── asm
└── idea
├── ACodeView.java
├── BytecodeASMified.java
├── BytecodeOutline.java
├── BytecodeOutlineToolWindowFactory.java
├── Constants.java
├── GroovifiedTextifier.java
├── GroovifiedView.java
├── ShowBytecodeOutlineAction.java
└── config
├── ASMPluginComponent.java
├── ASMPluginConfiguration.form
├── ASMPluginConfiguration.java
└── GroovyCodeStyle.java
/ASM-BO.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
37 |
195 |
209 |
210 |
211 |
212 |
--------------------------------------------------------------------------------
/META-INF/plugin.xml:
--------------------------------------------------------------------------------
1 |
2 | ASM Bytecode Outline
3 | Displays bytecode for Java classes and ASMified code which will help you in your class generation.
4 | 0.3.5
5 | Cédric Champeau
6 |
7 |
8 | Version 0.3.5
10 |
11 | - Fixed ASM lib classes version
12 | - Upgraded ASM to 5.0.5
13 |
14 | Version 0.3.4
15 |
16 | - Support bytecode display for inner classes based on the caret position in the active editor
17 | - Fix outline not beeing always updated when file changed
18 |
19 | Version 0.3.3
20 |
21 | - Upgraded ASM to 5.0
22 |
23 | Version 0.3.2
24 |
25 | - Upgraded ASM to 4.0
26 |
27 | Version 0.3.1
28 |
29 | - Updated for IntelliJ IDEA 10.0.2
30 | - Supports showing bytecode for .class files for which we have source code
31 |
32 | Version 0.3
33 |
34 | - Add diff view popup which shows the differences with the previous version of bytecode
35 | - Search in every output directory, including test files
36 | - Support for Groovy @groovyx.ast.bytecode.Bytecode annotation
37 | - Configuration of ASM ClassReader flags
38 | - Configuration of Groovy code style
39 |
40 | Version 0.2
41 |
42 | - Fixed .class files not being found under Windows
43 | - Fixed tool window not opening if output directory doesn't exist
44 | - Added shortcut in "Code" menu
45 | - Do not compile file if up-to-date
46 |
47 | ]]>
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 | org.objectweb.asm.idea.config.ASMPluginComponent
56 |
57 |
58 |
59 |
60 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
72 |
74 |
76 |
78 |
79 |
80 |
--------------------------------------------------------------------------------
/README:
--------------------------------------------------------------------------------
1 | This file was created by IntelliJ IDEA 10.0.1 for binding GitHub repository
--------------------------------------------------------------------------------
/lib/reloc-asm-all-5.0.3.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/melix/asm-bytecode-intellij/b348bbe5de2f578d1912a5f982c3ed65eac6758a/lib/reloc-asm-all-5.0.3.jar
--------------------------------------------------------------------------------
/lib/rules.txt:
--------------------------------------------------------------------------------
1 | rule org.objectweb.** reloc.org.objectweb.@1
2 |
--------------------------------------------------------------------------------
/src/images/asm.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/melix/asm-bytecode-intellij/b348bbe5de2f578d1912a5f982c3ed65eac6758a/src/images/asm.gif
--------------------------------------------------------------------------------
/src/org/objectweb/asm/idea/ACodeView.java:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * Copyright 2011 Cédric Champeau
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | * /
17 | */
18 |
19 | package org.objectweb.asm.idea;
20 | /**
21 | * Created by IntelliJ IDEA.
22 | * User: cedric
23 | * Date: 07/01/11
24 | * Time: 22:18
25 | */
26 |
27 | import com.intellij.openapi.Disposable;
28 | import com.intellij.openapi.actionSystem.*;
29 | import com.intellij.openapi.diff.DiffContent;
30 | import com.intellij.openapi.diff.DiffManager;
31 | import com.intellij.openapi.diff.DiffRequest;
32 | import com.intellij.openapi.diff.SimpleContent;
33 | import com.intellij.openapi.editor.Document;
34 | import com.intellij.openapi.editor.Editor;
35 | import com.intellij.openapi.editor.EditorFactory;
36 | import com.intellij.openapi.fileTypes.FileTypeManager;
37 | import com.intellij.openapi.keymap.KeymapManager;
38 | import com.intellij.openapi.options.ShowSettingsUtil;
39 | import com.intellij.openapi.project.Project;
40 | import com.intellij.openapi.ui.SimpleToolWindowPanel;
41 | import com.intellij.openapi.util.IconLoader;
42 | import com.intellij.openapi.vfs.VirtualFile;
43 | import com.intellij.openapi.wm.ToolWindowManager;
44 | import com.intellij.psi.PsiFile;
45 | import com.intellij.psi.PsiFileFactory;
46 | import com.intellij.ui.PopupHandler;
47 | import org.objectweb.asm.idea.config.ASMPluginComponent;
48 |
49 | import javax.swing.*;
50 | import java.awt.*;
51 | import java.awt.event.ActionEvent;
52 | import java.awt.event.MouseAdapter;
53 | import java.awt.event.MouseEvent;
54 |
55 | /**
56 | * Base class for editors which displays bytecode or ASMified code.
57 | */
58 | public class ACodeView extends SimpleToolWindowPanel implements Disposable {
59 | private static final String DIFF_WINDOW_TITLE = "Show differences from previous class contents";
60 | private static final String[] DIFF_TITLES = {"Previous version", "Current version"};
61 | protected final Project project;
62 |
63 | protected final ToolWindowManager toolWindowManager;
64 | protected final KeymapManager keymapManager;
65 | private final String extension;
66 |
67 |
68 | protected Editor editor;
69 | protected Document document;
70 | // used for diff view
71 | private String previousCode;
72 | private VirtualFile previousFile;
73 |
74 | public ACodeView(final ToolWindowManager toolWindowManager, KeymapManager keymapManager, final Project project, final String fileExtension) {
75 | super(true, true);
76 | this.toolWindowManager = toolWindowManager;
77 | this.keymapManager = keymapManager;
78 | this.project = project;
79 | this.extension = fileExtension;
80 | setupUI();
81 | }
82 |
83 | public ACodeView(final ToolWindowManager toolWindowManager, KeymapManager keymapManager, final Project project) {
84 | this(toolWindowManager, keymapManager, project, "java");
85 | }
86 |
87 | private void setupUI() {
88 | final EditorFactory editorFactory = EditorFactory.getInstance();
89 | document = editorFactory.createDocument("");
90 | editor = editorFactory.createEditor(document, project, FileTypeManager.getInstance().getFileTypeByExtension(extension), true);
91 |
92 | final JComponent editorComponent = editor.getComponent();
93 | add(editorComponent);
94 | final AnAction diffAction = createShowDiffAction();
95 | DefaultActionGroup group = new DefaultActionGroup();
96 | group.add(diffAction);
97 | group.add(new ShowSettingsAction());
98 |
99 | final ActionManager actionManager = ActionManager.getInstance();
100 | final ActionToolbar actionToolBar = actionManager.createActionToolbar("ASM", group, true);
101 | final JPanel buttonsPanel = new JPanel(new BorderLayout());
102 | buttonsPanel.add(actionToolBar.getComponent(), BorderLayout.CENTER);
103 | PopupHandler.installPopupHandler(editor.getContentComponent(), group, "ASM", actionManager);
104 | setToolbar(buttonsPanel);
105 | }
106 |
107 | public void setCode(final VirtualFile file, final String code) {
108 | final String text = document.getText();
109 | if (previousFile == null || file == null || previousFile.getPath().equals(file.getPath()) && !Constants.NO_CLASS_FOUND.equals(text)) {
110 | if (file != null) previousCode = text;
111 | } else if (!previousFile.getPath().equals(file.getPath())) {
112 | previousCode = ""; // reset previous code
113 | }
114 | document.setText(code);
115 | if (file != null) previousFile = file;
116 | }
117 |
118 |
119 |
120 | public void dispose() {
121 | if (editor != null) {
122 | final EditorFactory editorFactory = EditorFactory.getInstance();
123 | editorFactory.releaseEditor(editor);
124 | editor = null;
125 | }
126 | }
127 |
128 | private AnAction createShowDiffAction() {
129 | return new ShowDiffAction();
130 | }
131 |
132 | private class ShowSettingsAction extends AnAction {
133 |
134 | private ShowSettingsAction() {
135 | super("Settings", "Show settings for ASM plugin", IconLoader.getIcon("/general/projectSettings.png"));
136 | }
137 |
138 | @Override
139 | public boolean displayTextInToolbar() {
140 | return true;
141 | }
142 |
143 | @Override
144 | public void actionPerformed(final AnActionEvent e) {
145 | ShowSettingsUtil.getInstance().showSettingsDialog(project, project.getComponent(ASMPluginComponent.class));
146 | }
147 | }
148 | private class ShowDiffAction extends AnAction {
149 |
150 | public ShowDiffAction() {
151 | super("Show differences",
152 | "Shows differences from the previous version of bytecode for this file",
153 | IconLoader.getIcon("/actions/diffWithCurrent.png"));
154 | }
155 |
156 | @Override
157 | public void update(final AnActionEvent e) {
158 | e.getPresentation().setEnabled(!"".equals(previousCode) && (previousFile!=null));
159 | }
160 |
161 | @Override
162 | public boolean displayTextInToolbar() {
163 | return true;
164 | }
165 |
166 | @Override
167 | public void actionPerformed(final AnActionEvent e) {
168 | DiffManager.getInstance().getDiffTool().show(new DiffRequest(project) {
169 | @Override
170 | public DiffContent[] getContents() {
171 | // there must be a simpler way to obtain the file type
172 | PsiFile psiFile = PsiFileFactory.getInstance(project).createFileFromText("asm." + extension, "");
173 | final DiffContent currentContent = previousFile == null ? new SimpleContent("") : new SimpleContent(document.getText(), psiFile.getFileType());
174 | final DiffContent oldContent = new SimpleContent(previousCode == null ? "" : previousCode, psiFile.getFileType());
175 | return new DiffContent[]{
176 | oldContent,
177 | currentContent
178 | };
179 | }
180 |
181 | @Override
182 | public String[] getContentTitles() {
183 | return DIFF_TITLES;
184 | }
185 |
186 | @Override
187 | public String getWindowTitle() {
188 | return DIFF_WINDOW_TITLE;
189 | }
190 | });
191 | }
192 | }
193 | }
194 |
--------------------------------------------------------------------------------
/src/org/objectweb/asm/idea/BytecodeASMified.java:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * Copyright 2011 Cédric Champeau
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | * /
17 | */
18 |
19 | package org.objectweb.asm.idea;
20 |
21 | import com.intellij.openapi.components.ServiceManager;
22 | import com.intellij.openapi.keymap.KeymapManager;
23 | import com.intellij.openapi.project.Project;
24 | import com.intellij.openapi.wm.ToolWindowManager;
25 |
26 | import javax.swing.*;
27 | import java.awt.*;
28 |
29 |
30 | /**
31 | * Created by IntelliJ IDEA.
32 | * User: cedric
33 | * Date: 07/01/11
34 | * Time: 17:07
35 | */
36 |
37 | /**
38 | * ASMified code view.
39 | */
40 | public class BytecodeASMified extends ACodeView {
41 |
42 | public BytecodeASMified(final ToolWindowManager toolWindowManager, KeymapManager keymapManager, final Project project) {
43 | super(toolWindowManager, keymapManager, project);
44 | }
45 |
46 | public static BytecodeASMified getInstance(Project project) {
47 | return ServiceManager.getService(project, BytecodeASMified.class);
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/org/objectweb/asm/idea/BytecodeOutline.java:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * Copyright 2011 Cédric Champeau
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | * /
17 | */
18 |
19 | package org.objectweb.asm.idea;
20 |
21 | import com.intellij.openapi.components.ProjectComponent;
22 | import com.intellij.openapi.components.ServiceManager;
23 | import com.intellij.openapi.keymap.KeymapManager;
24 | import com.intellij.openapi.project.Project;
25 | import com.intellij.openapi.ui.ComponentContainer;
26 | import com.intellij.openapi.wm.ToolWindow;
27 | import com.intellij.openapi.wm.ToolWindowAnchor;
28 | import com.intellij.openapi.wm.ToolWindowManager;
29 | import org.jetbrains.annotations.NotNull;
30 |
31 | import javax.swing.*;
32 | import java.awt.*;
33 |
34 |
35 | /**
36 | * Created by IntelliJ IDEA.
37 | * User: cedric
38 | * Date: 07/01/11
39 | * Time: 17:07
40 | */
41 |
42 | /**
43 | * Bytecode view.
44 | */
45 | public class BytecodeOutline extends ACodeView {
46 |
47 | public BytecodeOutline(final Project project, KeymapManager keymapManager, final ToolWindowManager toolWindowManager) {
48 | super(toolWindowManager, keymapManager, project);
49 | }
50 |
51 | public static BytecodeOutline getInstance(Project project) {
52 | return ServiceManager.getService(project, BytecodeOutline.class);
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/src/org/objectweb/asm/idea/BytecodeOutlineToolWindowFactory.java:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * Copyright 2011 Cédric Champeau
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | * /
17 | */
18 |
19 | package org.objectweb.asm.idea;
20 |
21 | import com.intellij.openapi.project.Project;
22 | import com.intellij.openapi.wm.ToolWindow;
23 | import com.intellij.openapi.wm.ToolWindowFactory;
24 | import com.intellij.openapi.wm.ToolWindowManager;
25 | import com.intellij.ui.content.ContentFactory;
26 |
27 | /**
28 | * ASM ToolWindow factory
29 | */
30 | public class BytecodeOutlineToolWindowFactory implements ToolWindowFactory{
31 | public void createToolWindowContent(final Project project, final ToolWindow toolWindow) {
32 | BytecodeOutline outline = BytecodeOutline.getInstance(project);
33 | BytecodeASMified asmified = BytecodeASMified.getInstance(project);
34 | GroovifiedView groovified = GroovifiedView.getInstance(project);
35 | toolWindow.getContentManager().addContent(ContentFactory.SERVICE.getInstance().createContent(outline, "Bytecode", false));
36 | toolWindow.getContentManager().addContent(ContentFactory.SERVICE.getInstance().createContent(asmified, "ASMified", false));
37 | toolWindow.getContentManager().addContent(ContentFactory.SERVICE.getInstance().createContent(groovified, "Groovified", false));
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/org/objectweb/asm/idea/Constants.java:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * Copyright 2011 Cédric Champeau
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | * /
17 | */
18 | package org.objectweb.asm.idea;
19 |
20 | /**
21 | * Created by IntelliJ IDEA.
22 | * User: cedric
23 | * Date: 18/01/11
24 | * Time: 06:58
25 | */
26 |
27 | /**
28 | * Constants used in various places of the code.
29 | */
30 | public abstract class Constants {
31 | final static String NO_CLASS_FOUND = "// couldn't generate bytecode view, no .class file found";
32 | }
33 |
--------------------------------------------------------------------------------
/src/org/objectweb/asm/idea/GroovifiedTextifier.java:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * Copyright 2011 Cédric Champeau
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | * /
17 | */
18 |
19 | package org.objectweb.asm.idea;
20 | /**
21 | * Created by IntelliJ IDEA.
22 | * User: cedric
23 | * Date: 17/01/11
24 | * Time: 22:07
25 | */
26 |
27 | import org.objectweb.asm.*;
28 | import reloc.org.objectweb.asm.*;
29 | import reloc.org.objectweb.asm.Label;
30 | import reloc.org.objectweb.asm.Opcodes;
31 | import reloc.org.objectweb.asm.Type;
32 | import reloc.org.objectweb.asm.commons.Method;
33 | import org.objectweb.asm.idea.config.GroovyCodeStyle;
34 | import reloc.org.objectweb.asm.util.*;
35 |
36 | import java.util.Collections;
37 | import java.util.HashMap;
38 | import java.util.List;
39 |
40 | /**
41 | * A customized trace visitor which outputs code compatible with the Groovy @groovyx.ast.bytecode.Bytecode AST
42 | * transform.
43 | */
44 | public class GroovifiedTextifier extends Textifier {
45 |
46 | private final static String[] GROOVY_DEFAULT_IMPORTS = {
47 | "java.io.",
48 | "java.lang.",
49 | "java.net.",
50 | "java.util.",
51 | "groovy.lang.",
52 | "groovy.util."
53 | };
54 |
55 | private final static String[] ATYPES;
56 |
57 | static {
58 | ATYPES = new String[12];
59 | String s = "boolean,char,float,double,byte,short,int,long,";
60 | int j = 0;
61 | int i = 4;
62 | int l;
63 | while ((l = s.indexOf(',', j)) > 0) {
64 | ATYPES[i++] = s.substring(j, l);
65 | j = l + 1;
66 | }
67 | }
68 |
69 | private final GroovyCodeStyle codeStyle;
70 |
71 | public GroovifiedTextifier(final GroovyCodeStyle codeStyle) {
72 | super( Opcodes.ASM5 );
73 | this.codeStyle = codeStyle;
74 | }
75 |
76 | protected Textifier createTextifier() {
77 | return new GroovifiedMethodTextifier(codeStyle);
78 | }
79 |
80 | @Override
81 | public Textifier visitMethod(final int access, final String name, final String desc, final String signature, final String[] exceptions) {
82 | buf.setLength(0);
83 | buf.append('\n');
84 | if ((access & Opcodes.ACC_DEPRECATED) != 0) {
85 | buf.append(tab).append("// @Deprecated\n");
86 | }
87 | buf.append(tab).append("@groovyx.ast.bytecode.Bytecode\n");
88 | Method method = new Method(name, desc);
89 |
90 | buf.append(tab);
91 | appendAccess(access);
92 | if ((access & Opcodes.ACC_NATIVE) != 0) {
93 | buf.append("native ");
94 | }
95 | buf.append(groovyClassName(method.getReturnType().getClassName()));
96 | buf.append(' ');
97 | buf.append(name);
98 | buf.append('(');
99 | final Type[] argumentTypes = method.getArgumentTypes();
100 | char arg = 'a';
101 | for (int j = 0, argumentTypesLength = argumentTypes.length; j < argumentTypesLength; j++) {
102 | final Type type = argumentTypes[j];
103 | buf.append(groovyClassName(type.getClassName()));
104 | buf.append(' ');
105 | buf.append(arg);
106 | if (j < argumentTypesLength - 1) buf.append(',');
107 | arg++;
108 | }
109 | buf.append(')');
110 | if (exceptions != null && exceptions.length > 0) {
111 | buf.append(" throws ");
112 | for (int i = 0; i < exceptions.length; ++i) {
113 | appendDescriptor(INTERNAL_NAME, exceptions[i].replace('/', '.'));
114 | if (i < exceptions.length - 1) buf.append(',');
115 | }
116 | }
117 | buf.append(" {");
118 | buf.append('\n');
119 | text.add(buf.toString());
120 |
121 | GroovifiedMethodTextifier tcv = (GroovifiedMethodTextifier) createTextifier();
122 | text.add(tcv.getText());
123 | text.add(" }\n");
124 | return tcv;
125 | }
126 |
127 | /**
128 | * Appends a string representation of the given access modifiers to {@link #buf buf}.
129 | *
130 | * @param access some access modifiers.
131 | */
132 | private void appendAccess(final int access) {
133 | if ((access & Opcodes.ACC_PUBLIC) != 0) {
134 | buf.append("public ");
135 | }
136 | if ((access & Opcodes.ACC_PRIVATE) != 0) {
137 | buf.append("private ");
138 | }
139 | if ((access & Opcodes.ACC_PROTECTED) != 0) {
140 | buf.append("protected ");
141 | }
142 | if ((access & Opcodes.ACC_FINAL) != 0) {
143 | buf.append("final ");
144 | }
145 | if ((access & Opcodes.ACC_STATIC) != 0) {
146 | buf.append("static ");
147 | }
148 | if ((access & Opcodes.ACC_SYNCHRONIZED) != 0) {
149 | buf.append("synchronized ");
150 | }
151 | if ((access & Opcodes.ACC_VOLATILE) != 0) {
152 | buf.append("volatile ");
153 | }
154 | if ((access & Opcodes.ACC_TRANSIENT) != 0) {
155 | buf.append("transient ");
156 | }
157 | if ((access & Opcodes.ACC_ABSTRACT) != 0) {
158 | buf.append("abstract ");
159 | }
160 | if ((access & Opcodes.ACC_STRICT) != 0) {
161 | buf.append("strictfp ");
162 | }
163 | if ((access & Opcodes.ACC_ENUM) != 0) {
164 | buf.append("enum ");
165 | }
166 | }
167 |
168 | private static String groovyClassName(String className) {
169 | for (String anImport : GROOVY_DEFAULT_IMPORTS) {
170 | if (className.startsWith(anImport)) return className.substring(anImport.length());
171 | }
172 | return className;
173 | }
174 |
175 | protected static class GroovifiedMethodTextifier extends Textifier {
176 |
177 | private final GroovyCodeStyle codeStyle;
178 | private static final Textifier EMPTY_TEXTIFIER = new Textifier( Opcodes.ASM5 ) {
179 | @Override
180 | public List