This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 201871
Collapse All | Expand All

(-)a/apisupport.refactoring/src/org/netbeans/modules/apisupport/hints/UseNbBundleMessages.java (-3 / +5 lines)
Lines 111-122 Link Here
111
    })
111
    })
112
    public static List<ErrorDescription> run(HintContext context) {
112
    public static List<ErrorDescription> run(HintContext context) {
113
        final CompilationInfo compilationInfo = context.getInfo();
113
        final CompilationInfo compilationInfo = context.getInfo();
114
        final TreePath treePath = context.getPath();
114
        TreePath treePath = context.getPath();
115
        Tree tree = treePath.getLeaf();
115
        Tree tree = treePath.getLeaf();
116
        int[] span;
116
        int[] span;
117
        final String key;
117
        final String key;
118
        final FileObject src = compilationInfo.getFileObject();
118
        final FileObject src = compilationInfo.getFileObject();
119
        final MethodInvocationTree mit;
119
        MethodInvocationTree mit;
120
        if (tree.getKind() == Kind.METHOD_INVOCATION) {
120
        if (tree.getKind() == Kind.METHOD_INVOCATION) {
121
            mit = (MethodInvocationTree) tree;
121
            mit = (MethodInvocationTree) tree;
122
            ExpressionTree methodSelect = mit.getMethodSelect();
122
            ExpressionTree methodSelect = mit.getMethodSelect();
Lines 219-226 Link Here
219
            }
219
            }
220
            @Override protected void performRewrite(JavaFix.TransformationContext ctx) throws Exception {
220
            @Override protected void performRewrite(JavaFix.TransformationContext ctx) throws Exception {
221
                WorkingCopy wc = ctx.getWorkingCopy();
221
                WorkingCopy wc = ctx.getWorkingCopy();
222
                TreePath treePath = ctx.getPath();
222
                        TreeMaker make = wc.getTreeMaker();
223
                        TreeMaker make = wc.getTreeMaker();
223
                        if (mit != null) {
224
                        if (treePath.getLeaf().getKind() == Kind.METHOD_INVOCATION) {
225
                            MethodInvocationTree mit = (MethodInvocationTree) treePath.getLeaf();
224
                            CompilationUnitTree cut = wc.getCompilationUnit();
226
                            CompilationUnitTree cut = wc.getCompilationUnit();
225
                            boolean imported = false;
227
                            boolean imported = false;
226
                            String importBundleStar = cut.getPackageName() + ".Bundle.*";
228
                            String importBundleStar = cut.getPackageName() + ".Bundle.*";

Return to bug 201871