# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: /doma/jarda/netbeans-src/openide/util # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: nbproject/project.properties *** /doma/jarda/netbeans-src/openide/util/nbproject/project.properties Base (1.9) --- /doma/jarda/netbeans-src/openide/util/nbproject/project.properties Locally Modified (Based On 1.9) *************** *** 9,14 **** --- 9,16 ---- # Code is Sun Microsystems, Inc. Portions Copyright 1997-2005 Sun # Microsystems, Inc. All Rights Reserved. + javac.compilerargs=-Xlint:unchecked + javac.source=1.5 module.jar.dir=lib spec.version.base=6.9.0 Index: src/org/openide/util/Lookup.java *** /doma/jarda/netbeans-src/openide/util/src/org/openide/util/Lookup.java Base (1.5) --- /doma/jarda/netbeans-src/openide/util/src/org/openide/util/Lookup.java Locally Modified (Based On 1.5) *************** *** 134,140 **** * @return an object implementing the given class or null if no such * implementation is found */ ! public abstract Object lookup(Class clazz); /** The general lookup method. Callers can get list of all instances and classes * that match the given template, request more info about --- 134,140 ---- * @return an object implementing the given class or null if no such * implementation is found */ ! public abstract T lookup(Class clazz); /** The general lookup method. Callers can get list of all instances and classes * that match the given template, request more info about *************** *** 147,153 **** * @param template a template describing the services to look for * @return an object containing the results */ ! public abstract Result lookup(Template template); /** Look up the first item matching a given template. * Includes not only the instance but other associated information. --- 147,153 ---- * @param template a template describing the services to look for * @return an object containing the results */ ! public abstract Result lookup(Template template); /** Look up the first item matching a given template. * Includes not only the instance but other associated information. *************** *** 156,166 **** * * @since 1.8 */ ! public Item lookupItem(Template template) { ! Result res = lookup(template); ! Iterator it = res.allItems().iterator(); ! return it.hasNext() ? (Item) it.next() : null; } /** --- 156,166 ---- * * @since 1.8 */ ! public Item lookupItem(Template template) { ! Result res = lookup(template); ! Iterator> it = res.allItems().iterator(); ! return it.hasNext() ? it.next() : null; } /** *************** *** 183,200 **** /** Template defining a pattern to filter instances by. */ ! public static final class Template extends Object { /** cached hash code */ private int hashCode; /** type of the service */ ! private Class type; /** identity to search for */ private String id; /** instance to search for */ ! private Object instance; /** General template to find all possible instances. * @deprecated Use new Template (Object.class) which --- 183,200 ---- /** Template defining a pattern to filter instances by. */ ! public static final class Template extends Object { /** cached hash code */ private int hashCode; /** type of the service */ ! private Class type; /** identity to search for */ private String id; /** instance to search for */ ! private T instance; /** General template to find all possible instances. * @deprecated Use new Template (Object.class) which *************** *** 208,214 **** /** Create a simple template matching by class. * @param type the class of service we are looking for (subclasses will match) */ ! public Template(Class type) { this(type, null, null); } --- 208,214 ---- /** Create a simple template matching by class. * @param type the class of service we are looking for (subclasses will match) */ ! public Template(Class type) { this(type, null, null); } *************** *** 217,224 **** * @param id the ID of the item/service we are looking for or null to leave unspecified * @param instance a specific known instance to look for or null to leave unspecified */ ! public Template(Class type, String id, Object instance) { ! this.type = (type == null) ? Object.class : type; this.id = id; this.instance = instance; } --- 217,228 ---- * @param id the ID of the item/service we are looking for or null to leave unspecified * @param instance a specific known instance to look for or null to leave unspecified */ ! @SuppressWarnings("unchecked") ! public Template(Class type, String id, T instance) { ! if (type == null) { ! type = (Class)Object.class; ! } ! this.type = type; this.id = id; this.instance = instance; } *************** *** 228,234 **** * this will match any instance. * @return the class to search for */ ! public Class getType() { return type; } --- 232,238 ---- * this will match any instance. * @return the class to search for */ ! public Class getType() { return type; } *************** *** 250,256 **** * * @since 1.8 */ ! public Object getInstance() { return instance; } --- 254,260 ---- * * @since 1.8 */ ! public T getInstance() { return instance; } *************** *** 317,323 **** * Also permits listening to changes in the result. * Result can contain duplicate items. */ ! public static abstract class Result extends Object { /** Registers a listener that is invoked when there is a possible * change in this result. * --- 321,327 ---- * Also permits listening to changes in the result. * Result can contain duplicate items. */ ! public static abstract class Result extends Object { /** Registers a listener that is invoked when there is a possible * change in this result. * *************** *** 334,340 **** * should be List instead of Collection, but it is too late to change it. * @return unmodifiable collection of all instances that will never change its content */ ! public abstract java.util.Collection allInstances(); /** Get all classes represented in the result. * That is, the set of concrete classes --- 338,344 ---- * should be List instead of Collection, but it is too late to change it. * @return unmodifiable collection of all instances that will never change its content */ ! public abstract java.util.Collection allInstances(); /** Get all classes represented in the result. * That is, the set of concrete classes *************** *** 344,351 **** * * @since 1.8 */ ! public java.util.Set allClasses() { ! return java.util.Collections.EMPTY_SET; } /** Get all registered items. --- 348,355 ---- * * @since 1.8 */ ! public java.util.Set> allClasses() { ! return java.util.Collections.emptySet(); } /** Get all registered items. *************** *** 356,363 **** * * @since 1.8 */ ! public java.util.Collection allItems() { ! return java.util.Collections.EMPTY_SET; } } --- 360,367 ---- * * @since 1.8 */ ! public java.util.Collection> allItems() { ! return java.util.Collections.emptySet(); } } *************** *** 367,382 **** * * @since 1.25 */ ! public static abstract class Item extends Object { /** Get the instance itself. * @return the instance or null if the instance cannot be created */ ! public abstract Object getInstance(); /** Get the implementing class of the instance. * @return the class of the item */ ! public abstract Class getType(); // XXX can it be null?? --- 371,386 ---- * * @since 1.25 */ ! public static abstract class Item extends Object { /** Get the instance itself. * @return the instance or null if the instance cannot be created */ ! public abstract T getInstance(); /** Get the implementing class of the instance. * @return the class of the item */ ! public abstract Class getType(); // XXX can it be null?? *************** *** 425,436 **** Empty() { } ! public Object lookup(Class clazz) { return null; } ! public Result lookup(Template template) { ! return NO_RESULT; } } } --- 429,441 ---- Empty() { } ! public T lookup(Class clazz) { return null; } ! @SuppressWarnings("unchecked") ! public Result lookup(Template template) { ! return (Result)NO_RESULT; } } }