Commits

Jan Lahoda committed 17dcac3

@TriggerTreeKind works again. Cleanup. Introducing module for testing hints.

Comments (0)

Files changed (22)

hints/manifest.mf

 OpenIDE-Module: org.netbeans.modules.jackpot30
 OpenIDE-Module-Layer: org/netbeans/modules/jackpot30/hints/resources/layer.xml
 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jackpot30/hints/resources/Bundle.properties
-OpenIDE-Module-Specification-Version: 1.0
 

hints/nbproject/genfiles.properties

-build.xml.data.CRC32=6b8aa402
+build.xml.data.CRC32=fe221ee8
 build.xml.script.CRC32=e5c1372f
 build.xml.stylesheet.CRC32=79c3b980@1.28.0.7
 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=6b8aa402
+nbproject/build-impl.xml.data.CRC32=fe221ee8
 nbproject/build-impl.xml.script.CRC32=c85c4c1c
 nbproject/build-impl.xml.stylesheet.CRC32=3517ddf9@1.28.0.7

hints/nbproject/project.properties

 javac.source=1.5
 javac.compilerargs=-Xlint -Xlint:-serial
+spec.version.base=1.0

hints/nbproject/project.xml

                     </test-dependency>
                 </test-type>
             </test-dependencies>
-            <public-packages/>
+            <public-packages>
+                <package>org.netbeans.modules.jackpot30.hints.epi</package>
+            </public-packages>
         </data>
     </configuration>
 </project>

hints/src/org/netbeans/modules/jackpot30/hints/epi/HintContext.java

 
 package org.netbeans.modules.jackpot30.hints.epi;
 
+import com.sun.source.util.TreePath;
 import org.netbeans.api.java.source.CompilationInfo;
-import org.netbeans.modules.java.hints.spi.AbstractHint;
 import org.netbeans.modules.java.hints.spi.AbstractHint.HintSeverity;
 
 /**
 public class HintContext {
 
     private final CompilationInfo info;
-    private final AbstractHint hint;
+    private final HintSeverity severity;
+    private final TreePath path;
 
-    private HintContext(CompilationInfo info, AbstractHint hint) {
+    public HintContext(CompilationInfo info, HintSeverity severity, TreePath path) {
         this.info = info;
-        this.hint = hint;
+        this.severity = severity;
+        this.path = path;
     }
 
     public CompilationInfo getInfo() {
     }
 
     public HintSeverity getSeverity() {
-        return hint.getSeverity();
+        return severity;
+    }
+
+    public TreePath getPath() {
+        return path;
     }
     
-    public static HintContext create(CompilationInfo info, AbstractHint hint) {
-        return new HintContext(info, hint);
+    public static HintContext create(CompilationInfo info, HintSeverity severity, TreePath path) {
+        return new HintContext(info, severity, path);
     }
 }

hints/src/org/netbeans/modules/jackpot30/hints/file/DeclarativeHintsRunner.java

                 fixes[cntr] = JavaFix.rewriteFix(compilationInfo, h.getFixes().get(cntr).getDisplayName(), treePath, h.getFixes().get(cntr).getPattern(), vars);
             }
 
-            ErrorDescription ed = ErrorDescriptionFactory.forName(HintContext.create(compilationInfo, this), treePath, h.getDisplayName(), fixes);
+            ErrorDescription ed = ErrorDescriptionFactory.forName(HintContext.create(compilationInfo, getSeverity(), treePath), treePath, h.getDisplayName(), fixes);
 
             if (ed == null) {
                 continue;

hints/src/org/netbeans/modules/jackpot30/hints/pm/AnnotationBasedHintsRunner.java

             fixes.add(JavaFix.rewriteFix(compilationInfo, dn, treePath, to, variables));
         }
 
-        return ErrorDescriptionFactory.forName(HintContext.create(compilationInfo, this), treePath, displayName, fixes.toArray(new Fix[0]));
+        return ErrorDescriptionFactory.forName(HintContext.create(compilationInfo, getSeverity(), treePath), treePath, displayName, fixes.toArray(new Fix[0]));
     }
 
     private <T> T findValue(AnnotationMirror m, String name, Class<T> clazz) {

hints/src/org/netbeans/modules/jackpot30/hints/pm/HintsInvoker.java

 import org.netbeans.api.java.source.CompilationInfo;
 import org.netbeans.api.java.source.JavaSource.Phase;
 import org.netbeans.api.java.source.JavaSource.Priority;
+import org.netbeans.api.java.source.JavaSourceTaskFactory;
 import org.netbeans.api.java.source.support.EditorAwareJavaSourceTaskFactory;
 import org.netbeans.modules.java.hints.spi.AbstractHint;
 import org.netbeans.modules.jackpot30.hints.epi.Hint;
 import org.openide.util.Exceptions;
 import org.openide.util.Lookup;
 import org.openide.util.NbCollections;
+import org.openide.util.lookup.ServiceProvider;
 
 /**
  *
     }
     
     private static List<ErrorDescription> runHint(CompilationInfo info, FileObject file, ProcessingEnvironment env, Method m, TreePath treePath) {
-//        HintContext c = info != null ? new HintContext(info, treePath) : new HintContext(file, env, treePath);
-//
-//        try {
-//            Object result = m.invoke(null, c);
-//
-//            if (result == null) {
-//                return null;
-//            }
-//
-//            if (result instanceof Iterable) {
-//                List<ErrorDescription> out = new LinkedList<ErrorDescription>();
-//
-//                for (ErrorDescription ed : NbCollections.iterable(NbCollections.checkedIteratorByFilter(((Iterable) result).iterator(), ErrorDescription.class, false))) {
-//                    out.add(ed);
-//                }
-//
-//                return out;
-//            }
-//
-//            if (result instanceof ErrorDescription) {
-//                return Collections.singletonList((ErrorDescription) result);
-//            }
-//
-//            //XXX: log if result was ignored...
-//        } catch (IllegalAccessException ex) {
-//            Exceptions.printStackTrace(ex);
-//        } catch (IllegalArgumentException ex) {
-//            Exceptions.printStackTrace(ex);
-//        } catch (InvocationTargetException ex) {
-//            Exceptions.printStackTrace(ex);
-//        }
+        HintContext c = /*info != null ? */new HintContext(info, AbstractHint.HintSeverity.WARNING, treePath);// : new HintContext(file, env, treePath);
+
+        try {
+            Object result = m.invoke(null, c);
+
+            if (result == null) {
+                return null;
+            }
+
+            if (result instanceof Iterable) {
+                List<ErrorDescription> out = new LinkedList<ErrorDescription>();
+
+                for (ErrorDescription ed : NbCollections.iterable(NbCollections.checkedIteratorByFilter(((Iterable) result).iterator(), ErrorDescription.class, false))) {
+                    out.add(ed);
+                }
+
+                return out;
+            }
+
+            if (result instanceof ErrorDescription) {
+                return Collections.singletonList((ErrorDescription) result);
+            }
+
+            //XXX: log if result was ignored...
+        } catch (IllegalAccessException ex) {
+            Exceptions.printStackTrace(ex);
+        } catch (IllegalArgumentException ex) {
+            Exceptions.printStackTrace(ex);
+        } catch (InvocationTargetException ex) {
+            Exceptions.printStackTrace(ex);
+        }
 
         return null;
     }
         return false;
     }
 
+    @ServiceProvider(service=JavaSourceTaskFactory.class)
     public static final class FactoryImpl extends EditorAwareJavaSourceTaskFactory {
 
         public FactoryImpl() {

hints/src/org/netbeans/modules/jackpot30/hints/processor/JavaHintsAnnotationProcessor.java

 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008-2009 Sun Microsystems, Inc. All rights reserved.
  *
  * The contents of this file are subject to the terms of either the GNU
  * General Public License Version 2 only ("GPL") or the Common
  *
  * Contributor(s):
  *
- * Portions Copyrighted 2008 Sun Microsystems, Inc.
+ * Portions Copyrighted 2008-2009 Sun Microsystems, Inc.
  */
 
 package org.netbeans.modules.jackpot30.hints.processor;
 import javax.annotation.processing.Filer;
 import javax.annotation.processing.Messager;
 import javax.annotation.processing.ProcessingEnvironment;
+import javax.annotation.processing.Processor;
 import javax.annotation.processing.RoundEnvironment;
 import javax.annotation.processing.SupportedAnnotationTypes;
 import javax.annotation.processing.SupportedSourceVersion;
 import javax.tools.StandardLocation;
 import org.netbeans.spi.editor.hints.ErrorDescription;
 import org.openide.util.Exceptions;
+import org.openide.util.lookup.ServiceProvider;
 
 /**
  *
  * @author lahvac
  */
 @SupportedSourceVersion(SourceVersion.RELEASE_6)
-@SupportedAnnotationTypes("org.netbeans.modules.javahints.epi.*")
+@SupportedAnnotationTypes("org.netbeans.modules.jackpot30.hints.epi.*")
+@ServiceProvider(service=Processor.class)
 public class JavaHintsAnnotationProcessor extends AbstractProcessor {
 
     @Override
     public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
-        generateTypeList("org.netbeans.modules.javahints.epi.Hint", roundEnv, "hints");
-        generateTypeList("org.netbeans.modules.javahints.epi.TriggerCompileTime", roundEnv, "compile-time");
+        generateTypeList("org.netbeans.modules.jackpot30.hints.epi.Hint", roundEnv, "hints");
+        generateTypeList("org.netbeans.modules.jackpot30.hints.epi.TriggerCompileTime", roundEnv, "compile-time");
 
         if (true) return false;
         
                 CompilationUnitTree cut = tp.getCompilationUnit();
 
                 if (cuts.add(cut)) {
-//                    processingEnv.getMessager().printMessage(Kind.NOTE, cut.toString());
+                    processingEnv.getMessager().printMessage(Kind.NOTE, cut.toString());
                     computeHints.invoke(null, cut.getSourceFile().toUri(), processingEnv, cut, rm);
                 }
             }

hints/src/org/netbeans/modules/jackpot30/hints/resources/Bundle.properties

 # be found in, in the options dialog under System | Modules
 #
 
-OpenIDE-Module-Name=Experimental Java Hints
+OpenIDE-Module-Name=Hints Infrastructure
 OpenIDE-Module-Display-Category=Java
-OpenIDE-Module-Short-Description=Experimental Java Hints
-OpenIDE-Module-Long-Description=\
-    A set of experimental hints for Java. \
-    Currently the following hints are available:\n-fix typo
+OpenIDE-Module-Short-Description=Hints Infrastructure
+OpenIDE-Module-Long-Description=Hints Infrastructure
 
 EditorHints/org-netbeans-modules-java-hints.err=Java Compiler Errors
 

hints/src/org/netbeans/modules/jackpot30/hints/resources/layer.xml

             </file>
         </folder>
     </folder>
-    <folder name="org-netbeans-modules-java-hints">
-        <folder name="rules">
-            <folder name="errors">
-<!--                <file name="org-netbeans-modules-javahints-DeclarationFixer.instance" />-->
-                <file name="org-netbeans-modules-javahints-TypoDetector.instance"/>
-            </folder>
-
-            <folder name="hints">
-<!--                <file name="org-netbeans-modules-javahints-DeclarationFixer.instance" />-->
-                <folder name="experimental">
-                    <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.jackpot30.hints.resources.Bundle"/>
-                    <file name="org-netbeans-modules-javahints-ImageUtilitiesDeprecation.instance"/>
-                    <file name="org-netbeans-modules-javahints-NPECheck.instance"/>
-                    <file name="org-netbeans-modules-javahints-NoFileToURL.instance"/>
-                    <file name="org-netbeans-modules-javahints-OrganizeImports.instance"/>
-                    <file name="org-netbeans-modules-javahints-NoDOGetCookie.instance"/>
-                    <file name="org-netbeans-modules-javahints-file-DeclarativeHintsRunner.instance"/>
-                    <file name="org-netbeans-modules-javahints-pm-AnnotationBasedHintsRunner.instance"/>
-                </folder>
-            </folder>
-            
-            <folder name="suggestions">
-                <file name="org-netbeans-modules-javahints-NegateCondition.instance"/>
-            </folder>
-        </folder>
-        <folder name="declarative">
-            <file name="test.hint" url="test.hint"/>
-        </folder>
-    </folder>
 
 <!--    <folder name="Templates">
         <folder name="NetBeansModuleDevelopment">
         </folder>
     </folder>-->
     
-    <folder name="org.netbeans.modules.java.source">
-        <folder name="options">
-            <file name="Snippets.instance">
-                <attr name="instanceClass" stringvalue="org.netbeans.modules.jackpot30.hints.options.CodeStyleAdvancedOption"/>
-            </file>
-        </folder>
-    </folder>
-    
     <folder name="Editors">
         <folder name="text">
             <folder name="x-javahints">

hintsimpl/build.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
+<!-- for some information on what you could do (e.g. targets to override). -->
+<!-- If you delete this file and reopen the project it will be recreated. -->
+<project name="org.netbeans.modules.jackpot30.hintsimpl" default="netbeans" basedir=".">
+    <description>Builds, tests, and runs the project org.netbeans.modules.jackpot30.hintsimpl.</description>
+    <import file="nbproject/build-impl.xml"/>
+</project>

hintsimpl/manifest.mf

+Manifest-Version: 1.0
+OpenIDE-Module: org.netbeans.modules.jackpot30.hintsimpl
+OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jackpot30/hintsimpl/Bundle.properties
+OpenIDE-Module-Specification-Version: 1.0
+

hintsimpl/nbproject/build-impl.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+*** GENERATED FROM project.xml - DO NOT EDIT  ***
+***         EDIT ../build.xml INSTEAD         ***
+-->
+<project name="org.netbeans.modules.jackpot30.hintsimpl-impl" basedir="..">
+    <fail message="Please build using Ant 1.7.1 or higher.">
+        <condition>
+            <not>
+                <antversion atleast="1.7.1"/>
+            </not>
+        </condition>
+    </fail>
+    <property file="nbproject/private/suite-private.properties"/>
+    <property file="nbproject/suite.properties"/>
+    <fail unless="suite.dir">You must set 'suite.dir' to point to your containing module suite</fail>
+    <property file="${suite.dir}/nbproject/private/platform-private.properties"/>
+    <property file="${suite.dir}/nbproject/platform.properties"/>
+    <macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
+        <attribute name="name"/>
+        <attribute name="value"/>
+        <sequential>
+            <property name="@{name}" value="${@{value}}"/>
+        </sequential>
+    </macrodef>
+    <macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2">
+        <attribute name="property"/>
+        <attribute name="value"/>
+        <sequential>
+            <property name="@{property}" value="@{value}"/>
+        </sequential>
+    </macrodef>
+    <property file="${user.properties.file}"/>
+    <nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
+    <nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
+    <nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
+    <fail message="You must specify at least path to 'platform' cluster in $${cluster.path} property.">
+        <condition>
+            <not>
+                <contains string="${cluster.path.evaluated}" substring="platform"/>
+            </not>
+        </condition>
+    </fail>
+    <import file="${harness.dir}/build.xml"/>
+</project>

hintsimpl/nbproject/genfiles.properties

+build.xml.data.CRC32=59c8e5b3
+build.xml.script.CRC32=ef577a91
+build.xml.stylesheet.CRC32=79c3b980@1.28.0.7
+# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
+# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
+nbproject/build-impl.xml.data.CRC32=59c8e5b3
+nbproject/build-impl.xml.script.CRC32=ba129d1b
+nbproject/build-impl.xml.stylesheet.CRC32=3517ddf9@1.28.0.7

hintsimpl/nbproject/project.properties

+javac.source=1.5
+javac.compilerargs=-Xlint -Xlint:-serial

hintsimpl/nbproject/project.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+    <type>org.netbeans.modules.apisupport.project</type>
+    <configuration>
+        <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
+            <code-name-base>org.netbeans.modules.jackpot30.hintsimpl</code-name-base>
+            <suite-component/>
+            <module-dependencies>
+                <dependency>
+                    <code-name-base>org.jdesktop.layout</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <release-version>1</release-version>
+                        <specification-version>1.7.0.103</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.netbeans.api.java.classpath</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <release-version>1</release-version>
+                        <specification-version>1.19</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.netbeans.api.progress</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <release-version>1</release-version>
+                        <specification-version>1.13.0.1</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.netbeans.libs.javacapi</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <specification-version>0.8.0.1</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.netbeans.libs.javacimpl</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <release-version>1</release-version>
+                        <implementation-version/>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.netbeans.modules.editor</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <release-version>3</release-version>
+                        <specification-version>1.42.0.3.9.2</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.netbeans.modules.editor.guards</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <release-version>1</release-version>
+                        <specification-version>1.3</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.netbeans.modules.editor.lib</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <release-version>1</release-version>
+                        <specification-version>1.38.0.9.2</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.netbeans.modules.jackpot30</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <specification-version>1.0</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.netbeans.modules.java.editor</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <release-version>1</release-version>
+                        <implementation-version/>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.netbeans.modules.java.hints</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <release-version>1</release-version>
+                        <implementation-version/>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.netbeans.modules.java.lexer</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <release-version>1</release-version>
+                        <specification-version>1.5</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.netbeans.modules.java.source</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <implementation-version/>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.netbeans.modules.lexer</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <release-version>2</release-version>
+                        <specification-version>1.30.0.1</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.netbeans.modules.options.api</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <release-version>1</release-version>
+                        <specification-version>1.12</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.netbeans.modules.parsing.api</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <specification-version>1.12.1</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.netbeans.modules.projectapi</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <release-version>1</release-version>
+                        <specification-version>1.24</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.netbeans.modules.projectuiapi</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <release-version>1</release-version>
+                        <specification-version>1.34.0.6</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.netbeans.modules.sendopts</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <release-version>2</release-version>
+                        <specification-version>2.4</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.netbeans.spi.editor.hints</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <release-version>0-1</release-version>
+                        <specification-version>1.7.0.7.2</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.netbeans.spi.tasklist</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <release-version>1</release-version>
+                        <specification-version>1.4.0.1</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.openide.awt</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <specification-version>7.7.0.1</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.openide.dialogs</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <specification-version>7.10</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.openide.filesystems</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <specification-version>7.21.0.1.1</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.openide.loaders</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <specification-version>7.5</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.openide.nodes</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <specification-version>7.9.0.1</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.openide.text</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <specification-version>6.22</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.openide.util</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <specification-version>7.22.0.1</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.openide.windows</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <specification-version>6.26</specification-version>
+                    </run-dependency>
+                </dependency>
+            </module-dependencies>
+            <public-packages/>
+        </data>
+    </configuration>
+</project>

hintsimpl/nbproject/suite.properties

+suite.dir=${basedir}/..

hintsimpl/src/org/netbeans/modules/jackpot30/hintsimpl/Bundle.properties

+OpenIDE-Module-Name=Hints Impl

hintsimpl/src/org/netbeans/modules/jackpot30/hintsimpl/CollectionRemove.java

+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, the
+ * "License"). You may not use this file except in compliance with the
+ * License. You can obtain a copy of the License at
+ * http://www.netbeans.org/cddl-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License.  When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
+ *
+ * Contributor(s):
+ *
+ * Portions Copyrighted 2009 Sun Microsystems, Inc.
+ */
+package org.netbeans.modules.jackpot30.hintsimpl;
+
+/**
+ *
+ * @author Jan Lahoda
+ */
+public class CollectionRemove {
+
+}

hintsimpl/src/org/netbeans/modules/jackpot30/hintsimpl/FileToURL.java

+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2008-2009 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, the
+ * "License"). You may not use this file except in compliance with the
+ * License. You can obtain a copy of the License at
+ * http://www.netbeans.org/cddl-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License.  When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
+ *
+ * Contributor(s):
+ *
+ * Portions Copyrighted 2008-2009 Sun Microsystems, Inc.
+ */
+
+package org.netbeans.modules.jackpot30.hintsimpl;
+
+import com.sun.source.tree.MethodInvocationTree;
+import com.sun.source.tree.Tree.Kind;
+import com.sun.source.util.TreePath;
+import javax.lang.model.element.Element;
+import javax.lang.model.element.ElementKind;
+import org.netbeans.api.java.source.CompilationInfo;
+import org.netbeans.modules.jackpot30.hints.epi.ErrorDescriptionFactory;
+import org.netbeans.modules.jackpot30.hints.epi.Hint;
+import org.netbeans.modules.jackpot30.hints.epi.HintContext;
+import org.netbeans.modules.jackpot30.hints.epi.TriggerTreeKind;
+import org.netbeans.spi.editor.hints.ErrorDescription;
+
+/**
+ *
+ * @author Jan Lahoda
+ */
+public class FileToURL {
+
+    @Hint("org.netbeans.modules.jackpot30.hintsimpl.FileToURL.computeTreeKind")
+    @TriggerTreeKind(Kind.METHOD_INVOCATION)
+    public static ErrorDescription computeTreeKind(HintContext ctx) {
+        MethodInvocationTree mit = (MethodInvocationTree) ctx.getPath().getLeaf();
+
+        if (!mit.getArguments().isEmpty() || !mit.getTypeArguments().isEmpty()) {
+            return null;
+        }
+
+        CompilationInfo info = ctx.getInfo();
+        Element e = info.getTrees().getElement(new TreePath(ctx.getPath(), mit.getMethodSelect()));
+
+        if (e == null || e.getKind() != ElementKind.METHOD) {
+            return null;
+        }
+
+        if (e.getSimpleName().contentEquals("toURL") && info.getElementUtilities().enclosingTypeElement(e).getQualifiedName().contentEquals("java.io.File")) {
+            ErrorDescription w = ErrorDescriptionFactory.forName(ctx, mit, "Use of java.io.File.toURL()");
+
+            return w;
+        }
+
+        return null;
+    }
+    
+}

nbproject/project.properties

 modules=\
     ${project.org.netbeans.modules.jackpot30}:\
-    ${project.org.netbeans.modules.jackpot30.test.borrowed}
+    ${project.org.netbeans.modules.jackpot30.test.borrowed}:\
+    ${project.org.netbeans.modules.jackpot30.hintsimpl}
 project.org.netbeans.modules.jackpot30=hints
+project.org.netbeans.modules.jackpot30.hintsimpl=hintsimpl
 project.org.netbeans.modules.jackpot30.test.borrowed=borrowedtests