Name clash when attempting to override a method in a paramaterized class

The following code gives me a name clash, I do not understand why this happens, anyone care to explain?
import java.util.Comparator;
import java.util.Map;
import java.util.Map.Entry;
public class Test<K,V> {
     public void sort(Comparator<Entry<? extends K, ? extends V>> comparator) {
class Test2<K, V> extends Test<K, V> {
     @Override
     public void sort(Comparator<Entry<? extends K, ? extends V>> comparator) {
          super.sort(comparator);
}

i think it it a version problem, thanks
the error i get is:
Name clash: The method sort(Comparator<Map.Entry<? extends K,? extends V>>) of
type Test2<K,V> has the same erasure as sort(Comparator<Map.Entry<? extends
K,? extends V>>) of type Test<K,V> but does not override it
Message was edited by:
hans_bladerDeeg

Similar Messages

  • [svn] 3921: Fix for - @inheritDoc tag not working for get/ set overrides when you only override the setter of a base class

    Revision: 3921
    Author: [email protected]
    Date: 2008-10-28 06:23:00 -0700 (Tue, 28 Oct 2008)
    Log Message:
    Fix for - @inheritDoc tag not working for get/set overrides when you only override the setter of a base class
    QE Notes: Baselines for framework test will need to be updated.
    Doc Notes: None
    Reviewer: Paul
    Bugs: SDK-17304
    tests: checkintests
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-17304
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/ASDocExtension.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/ClassTable.java

    Revision: 3921
    Author: [email protected]
    Date: 2008-10-28 06:23:00 -0700 (Tue, 28 Oct 2008)
    Log Message:
    Fix for - @inheritDoc tag not working for get/set overrides when you only override the setter of a base class
    QE Notes: Baselines for framework test will need to be updated.
    Doc Notes: None
    Reviewer: Paul
    Bugs: SDK-17304
    tests: checkintests
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-17304
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/ASDocExtension.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/ClassTable.java

  • How to override a method in an inner class of the super class

    I have a rather horribly written class, which I need to adapt. I could simply do this if I could override a method in one of it's inner classes. My plan then was to extend the original class, and override the method in question. But here I am struggling.
    The code below is representative of my situation.
    public class ClassA
       ValueChecks vc = null;
       /** Creates a new instance of Main */
       public ClassA()
          System.out.println("ClassA Constructor");
          vc = new ValueChecks();
          vc.checkMaximum();
         // I want this to call the overridden method, but it does not, it seems to call
         // the method in this class. probably because vc belongs to this class
          this.vc.checkMinimum();
          this.myMethod();
       protected void myMethod()
          System.out.println("myMethod(SUPER)");
       protected class ValueChecks
          protected boolean checkMinimum()
             System.out.println("ValueChecks.checkMinimum (SUPER)");
             return true;
          protected boolean checkMaximum()
             return false;
    }I have extended ClassA, call it ClassASub, and it is this Class which I instantiate. The constructor in ClassASub obviously calls the constructor in ClassA. I want to override the checkMinimum() method in ValueChecks, but the above code always calls the method in ClassA. The ClassASub code looks like this
    public class ClassASub extends ClassA
       public ClassAInner cias;
       /** Creates a new instance of Main */
       public ClassASub()
          System.out.println("ClassASub Constructor");
       protected void myMethod()
          System.out.println("myMethod(SUB)");
       protected class ValueChecks extends ClassA.ValueChecks
          protected boolean checkMinimum()
             System.out.println("ValueChecks.checkMinimum (SUB)");
             return true;
    }The method myMethod seems to be suitably overridden, but I cannot override the checkMinimum() method.
    I think this is a stupid problem to do with how the ValueChecks class is instantiated. I think I need to create an instance of ValueChecks in ClassASub, and pass a reference to it into ClassA. But this will upset the way ClassA works. Could somebody enlighten me please.

    vc = new ValueChecks();vc is a ValueChecks object. No matter whether you subclass ValueChecks or not, vc is always of this type, per this line of code.
    // I want this to call the overridden method, but it does not, it seems to > call
    // the method in this class. probably because vc belongs to this class
    this.vc.checkMinimum();No, it's because again vc references a ValueChecks object, because it was created as such.
    And when I say ValueChecks, I mean the original class, not the one you tried to create by the same name, attempting to override the original.

  • Getting Bad Type Error when calling a method in the proxy class

    Hi,
    I have generated the proxy classes from wsdl.
    When I am calling the methods in the proxy class from one of external class, I am getting following error.
    Can anyone please help me in resolving this issue.
    javax.xml.ws.soap.SOAPFaultException: org.xml.sax.SAXException: Bad types (interface javax.xml.soap.SOAPElement -> class com.intraware.snetmgr.webservice.data.SubscribeNetObjectReference) Message being parsed:
         at com.sun.xml.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:197)
         at com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:122)
         at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:125)
         at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:95)
         at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:136)
         at $Proxy176.find(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at weblogic.wsee.jaxws.spi.ClientInstanceInvocationHandler.invoke(ClientInstanceInvocationHandler.java:84)
         at $Proxy173.find(Unknown Source)
         at com.xxx.fs.FNServices.findAccountWs(FNServices.java:132)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at weblogic.wsee.jaxws.WLSInstanceResolver$WLSInvoker.invoke(WLSInstanceResolver.java:92)
         at weblogic.wsee.jaxws.WLSInstanceResolver$WLSInvoker.invoke(WLSInstanceResolver.java:74)
         at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:151)
         at com.sun.xml.ws.server.sei.EndpointMethodHandlerImpl.invoke(EndpointMethodHandlerImpl.java:268)
         at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:100)
         at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:866)
         at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:815)
         at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:778)
         at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:680)
         at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:403)
         at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:532)
         at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:253)
         at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:140)
         at weblogic.wsee.jaxws.WLSServletAdapter.handle(WLSServletAdapter.java:171)
         at weblogic.wsee.jaxws.HttpServletAdapter$AuthorizedInvoke.run(HttpServletAdapter.java:708)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
         at weblogic.wsee.util.ServerSecurityHelper.authenticatedInvoke(ServerSecurityHelper.java:103)
         at weblogic.wsee.jaxws.HttpServletAdapter$3.run(HttpServletAdapter.java:311)
         at weblogic.wsee.jaxws.HttpServletAdapter.post(HttpServletAdapter.java:336)
         at weblogic.wsee.jaxws.JAXWSServlet.doRequest(JAXWSServlet.java:95)
         at weblogic.servlet.http.AbstractAsyncServlet.service(AbstractAsyncServlet.java:99)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Thanks
    Anoop

    Hi Vlad,
    The service has not been changed since i have generated the proxy.
    I tried calling the service from soapUI and I am getting the following error now.
    Request:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:uri="uri:webservice.subscribenet.intraware.com" xmlns:uri1="uri:subscribenet.intraware.com">
    <soapenv:Header>
    <uri:SessionHeader>
    <uri:SessionID>hjkashd9sd90809dskjkds090dsj</uri:SessionID>
    </uri:SessionHeader>
    </soapenv:Header>
    <soapenv:Body>
    <uri:Find>
    <uri:SubscribeNetObjectReference>
    <uri1:ID></uri1:ID>
    <uri1:IntrawareID></uri1:IntrawareID>
    <uri1:SharePartnerID></uri1:SharePartnerID>
    </uri:SubscribeNetObjectReference>
    </uri:Find>
    </soapenv:Body>
    </soapenv:Envelope>
    Response:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header/>
    <soapenv:Body>
    <soapenv:Fault>
    <faultcode>soapenv:Server.generalException</faultcode>
    <faultstring>org.xml.sax.SAXException: WSWS3279E: Error: Unable to create JavaBean of type com.intraware.snetmgr.webservice.data.SubscribeNetObjectReference. Missing default constructor? Error was: java.lang.InstantiationException: com.intraware.snetmgr.webservice.data.SubscribeNetObjectReference. Message being parsed:</faultstring>
    </soapenv:Fault>
    </soapenv:Body>
    </soapenv:Envelope>
    Thanks
    Anoop

  • "Name Clash: Method in Two Classes Have Same Erasure, Yet Neither Over-..."

    Ok, I'm getting this message when trying to compile the classes below: "FileUtils.java:1117: name clash: add(E) in java.util.ArrayList<java.util.LinkedList<F>> and add(T) in gov.sandia.gajanik.util.Addable<F> have the same erasure, yet neither overrides the other"
    The funny thing is, they actually don't have the same erasure, from what I can see. In short, I have a class
    class DuplicatesArrayList<F extends File> extends ArrayList<LinkedList<F>> implements Addable<F>Addable<T> has a method
    public boolean add(T addMe);and, from the javadoc for jdk1.6.0, ArrayList<E>has a method
    public boolean add(E e);But, note how ArrayList has the type parameter LinkedList<F> and Addable has the type parameter F. Given that, the erasures should be
    public boolean add(LinkedList e);//Erasure of LinkedList<F>
    public boolean add(File addMe);  //Erasure of FAm I missing something? Is it just the end of the day and my brain isn't working right? Help!

    Actually, the ArrayList extension is the most critical part. The class I'm trying to make really is an ArrayList that has files added to it, but stores them in LinkedList (the context doing the adding decides when to delimit the files in LinkedLists). I came to this solution because I tried to designed the method that's actually using the ArrayList the take anything that it can "add" Files to and separate related groups of files. This way it can either use a collection-type class (what you've seen here) or a class that handles the files differently (I have one that prints them to System.out instead). I could require a collection, but then the method that is calling "add" also has to specify exactly how it groups related files together (which is less flexible), and callers must implement all the methods specified by the Collection interface (or have them throw something like an UnsupportedOperationException for everthing except "add"), even though all I need is "add".
    I probably could make my own inheritance tree that would simply be a copy of that in java.util, starting at AbstractList. But I have qualms about copying Sun's source code (which is essentially what I would do) and then just add the few methods I need to their collection classes.
    I'm interested to know how you would implement such a solution, if you would be kind enough to show me. Here's what I have:
    * An interface that specifies an object that can have things added to (and thus
    * processed by) it.</p>
    * @param <T> The type processed by this {@code Addable}
    public interface Addable<T> {
         * Ensures that this {@code Addable} takes appropriate action on the
         * specified object</p>
         * @param addMe The object to operate on
         * @return Whether or not the operation succeeded
        public boolean add(T addMe);
         * Ensures that this {@code Addable} takes appropriate action on all the
         * items returned by the iterator of the specified iterable object</p>
         * @param itr The object to get items from
         * @return The number of items successfully proccessed
        public int addAll(Iterable<T> itr);
        public static final class DefaultBehavior {
             * Ensures that this {@code Addable} takes appropriate action on all the
             * items returned by the iterator of the specified iterable object</p>
             * @param <T> The type contained by the iterator and target
             * @param me The target to add to (typically the caller)
             * @param itr The object to get items from
             * @return The number of items successfully proccessed
            public static final <T> int addAll(final Addable<T> me,
                    final Iterable<T> itr) {
                int totalAdded = 0;
                if (itr instanceof List) {
                    for (T element : (List<T>)itr)
                        if (me.add(element))
                            totalAdded++;
                } else {
                    for (T element : itr)
                        if (me.add(element))
                            totalAdded++;
                return totalAdded;
    }I would make Addable an abstract class with that default implementation for addAll, but alas, Java only allows single class inheritance, and I can't even make that DefaultBehavior class protected (which would make more sense than public).
    * @param <T> {@inheritDoc}
    public interface GroupingAddable<T> extends Addable<T> {
         * Indicates the items added since the last call to this method should be
         * associated under the given combination of keys</p>
         * @param keys The keys that identify this group
         * @return The number of items that were added to the group
        public int group(Object... keys);
         * Supplies some default implementations of the methods in this interface
         * </p><p>
         * This member would be more suited to {@code static protected} access, but
         * the JLS does not allow protected members of interfaces.<p>
        public static class DefaultBehavior {
             * Ensures that this {@code Addable} takes appropriate action on all the
             * items returned by the iterator of the specified iterable object</p>
             * @param <F> The type contained by the iterator and target
             * @param me The target to add to (typically the caller)
             * @param itr The object to get items from
             * @return The number of items successfully proccessed
            public static final <F extends File> int addAll(
                    final DuplicatesStore<F> me,
                    final Iterable<F> itr) {
                int totalAdded = 0;
                if (itr instanceof List) {
                    for (F element : (List<F>)itr)
                        if (me.add(element))
                            totalAdded++;
                } else {
                    for (F element : itr)
                        if (me.add(element))
                            totalAdded++;
                return totalAdded;
             * Wraps a given {@code DuplicatesStore} in a
             * {@link GroupingAddable} that passes calls to the given store</p>
             * @param <F> The type accepted by the given store
             * @param store The object to wrap
             * @return An {@code Addable} wrapper for the given store
            public static final <F extends File> GroupingAddable<F>
                    asGroupingAddable(final DuplicatesStore<F> store) {
                return new GroupingAddable<F>() {
                    public int group(Object... keys) {
                        return store.group(keys);
                    public boolean add(F addMe) {
                        return store.add(addMe);
                    public int addAll(Iterable<F> itr) {
                        return store.addAll(itr);
            protected DefaultBehavior() {
                throw new UnsupportedOperationException("Class has no instance members");
    }Note that the following class exposes the same public API as GroupingAddable, but the aforementioned name clash requires this copy
    public interface DuplicatesStore<F extends File> {
         * Adds a duplicate to the current group of duplicates</p>
         * @param addMe The duplicate to add to the current group of duplicates
         * @return true if the add operation succeeded, false otherwise
        public boolean add(F addMe);
         * Ensures that this {@code Addable} takes appropriate action on all the
         * items returned by the iterator of the specified iterable object</p>
         * @param itr The object to get items from
         * @return The number of items successfully proccessed
        public int addAll(Iterable<F> itr);
         * Marks the previous file {@code add}ed as the last of a group of files
         * that are duplicates.</p>
         * @param keys Ignored
         * @return The number of files in the group that was just marked
        public int group(Object... keys);
         * Supplies some default implementations of the methods in this interface
         * </p><p>
         * This member would be more suited to {@code static protected} access, but
         * the JLS does not allow protected members of interfaces.<p>
        public static class DefaultBehavior {
             * Ensures that this {@code Addable} takes appropriate action on all the
             * items returned by the iterator of the specified iterable object</p>
             * @param <F> The type contained by the iterator and target
             * @param me The target to add to (typically the caller)
             * @param itr The object to get items from
             * @return The number of items successfully proccessed
            public static final <F extends File> int addAll(
                    final DuplicatesStore<F> me,
                    final Iterable<F> itr) {
                int totalAdded = 0;
                if (itr instanceof List) {
                    for (F element : (List<F>)itr)
                        if (me.add(element))
                            totalAdded++;
                } else {
                    for (F element : itr)
                        if (me.add(element))
                            totalAdded++;
                return totalAdded;
             * Wraps a given {@code DuplicatesStore} in a
             * {@link GroupingAddable} that passes calls to the given store</p>
             * @param <F> The type accepted by the given store
             * @param store The object to wrap
             * @return An {@code Addable} wrapper for the given store
            public static final <F extends File> GroupingAddable<F>
                    asGroupingAddable(final DuplicatesStore<F> store) {
                return new GroupingAddable<F>() {
                    public int group(Object... keys) {
                        return store.group(keys);
                    public boolean add(F addMe) {
                        return store.add(addMe);
                    public int addAll(Iterable<F> itr) {
                        return store.addAll(itr);
            protected DefaultBehavior() {
                throw new UnsupportedOperationException("Class has no instance members");
    }And we're getting closer to an actual implementation. I have both a LinkedList and ArrayList implementation of this interface, but I'm only posting the ArrayList. This would also be a good candidate for an abstract class, but then I wouldn' be able to inherit from java.util classes. The methods specified by this interface have the same implenation in both the ArrayList and LinkedList versions.
    * A list of {@link LinkedList} specically for storing and grouping
    * duplicate files</p>
    * @param <F> The type contained by this list
    public interface DuplicatesList<F extends File> extends List<LinkedList<F>>,
            DuplicatesStore<F> {
         * Adds a duplicate to the current group of duplicates</p>
         * @param file The duplicate to add to the current group of duplicates
         * @return true if the add operation succeeded, false otherwise
        public boolean add(F file);
         * Marks the previous file {@code add}ed as the last of a group of files
         * that are duplicates.</p>
         * @param keys Ignored
         * @return The number of files in the group that was just marked
        public int group(Object... keys);
         * Retreives the number of files added to this collection.</p>
         * <p>
         * This is not the number of collections contained immediately within
         * this collection, but the count of all files contained in this
         * collection's collections</p>
         * @return The count of files contained
        public int records();
         * {@inheritDoc}
         * @param <F> The type contained by the object that contains an instance of
         *      this class
        public class DefaultBehavior<F extends File> extends
                DuplicatesStore.DefaultBehavior {
             * Temporary storage for duplicate files until {@code group} is called,
             * at which point this variable is added to {@code this}, then cleared
            protected LinkedList<F> innerStore = new LinkedList<F>();
            /** The number of files added to {@code this} */
            protected int records = 0;
            protected DefaultBehavior() {
             * Adds a duplicate to the current group of duplicates</p>
             * @param me Ignored
             * @param file The duplicate to add to the current group of duplicates
             * @return true if the add operation succeeded, false otherwise
            public final boolean add(DuplicatesList<F> me, final F file) {
                records++;
                return innerStore.add(file);
             * Marks the previous file {@code add}ed as the last of a group of files
             * that are duplicates.</p>
             * This particular implementation will remove the first element added to
             * the group, sort the group according to its natural order, add the
             * element that was removed to the beginning of the group, then add the
             * linked list representing the group to this {@code LinkedList}.</p>
             * @param me The object to operate on (typically "this")
             * @param keys Ignored
             * @return The number of files in the group that was just marked
            public final int group(final DuplicatesList<F> me,
                    final Object... keys) {
                int innerSize = innerStore.size();
                if (innerSize > 1) {
                    F base = innerStore.pop();
                    sort(innerStore);
                    innerStore.addLast(base);
                if (me.add(innerStore)) {
                    innerStore = new LinkedList<F>();
                    return innerSize;
                } else return -1;
    }And the implentation
    * An {@code ArrayList} implementation of {@link DuplicatesList}</p>
    * <p>
    * Groups are contained in {@code LinkedList}s stored within this
    * {@code ArrayList}.</p>
    * @param <F> {@inheritDoc}
    public class DuplicatesArrayList<F extends File>
            extends ArrayList<LinkedList<F>> implements DuplicatesList<F> {
         * Constructs a list containing the elements of the specified
         * collection, in the order they are returned by the collection's
         * iterator</p>
         * <p>
         * (Documentation copied from {@link ArrayList})</p>
         * @param addMe The collection whose elements are to be placed into this
         *      list
         * @throws NullPointerException If the specified collection is null
        protected DuplicatesArrayList(Collection<? extends LinkedList<F>> addMe) {
            super(addMe);
            def.records = super.size();
         * {@inheritDoc}
         * @param itr {@inheritDoc}
         * @return {@inheritDoc}
        @SuppressWarnings("static-access")
        public int addAll(Iterable<F> itr) {
            return def.addAll(this, itr);
         * {@inheritDoc}
         * @param file {@inheritDoc}
         * @return {@inheritDoc}
        public boolean add(F file) {
            return def.add(this, file);
         * {@inheritDoc}
         * <p>
         * This particular implementation will remove the first element added to
         * the group, sort the group according to its natural order, add the
         * element that was removed to the beginning of the group, then add the
         * linked list representing the group to this {@code ArrayList}.</p>
         * @param keys {@inheritDoc}
         * @return {@inheritDoc}
        public int group(Object... keys) {
            return def.group(this, keys);
         * {@inheritDoc}
         * @return {@inheritDoc}
        public int records() {
            return def.records;
    }Here's an alternative to the collection-type DuplicatesStore I just showed you
    * An object that prints duplicates as they are grouped</p>
    * <p>
    * The first file added to the group is appended to the {@link Appendable}
    * provided at construction.  If specified at construction time, the system-
    * specific path separator (as specified by {@link File#pathSeparator} then
    * the file's length are also appended.  Then the previous text is followed
    * by the system line separator (as specified by
    * {@code System.getProperty("line.separator")}).  Any files
    * that were added after it are appended in the same way, but are preceded
    * by a horizontal tab, are not followed by their length.</p>
    public class PrintingDuplicatesStore
            implements DuplicatesStore<File>, GroupingAddable<File> {
         * The system-specific line separator
        public static final String LINE_SEPARATOR =
                System.getProperty("line.separator");
         * The exception that contains any uncaught {@code Throwable}s thrown
         * during a call to {@code group} or {@code add}
        public static class AppendException extends RuntimeException {
             * Creates a new AppendException with it's cause set to the given
             * {@code Throwable} and messages set to the parameter's messages
             * @param cause The {@code Throwable} that caused this
             *      {@code AppendException} to be thrown
            public AppendException(final Throwable cause) {
                super(cause);
             * {@inheritDoc}
             * @return {@inheritDoc}
            public String getMessage() {
                return getCause().getMessage();
             * {@inheritDoc}
             * @return {@inheritDoc}
            public String getLocalizedMessage() {
                return getCause().getMessage();
         * This object to send output to
        protected Appendable out;
         * Whether this object is appending unique files (files in a group that
         * was only added to once) to the output
        protected boolean printingUniques;
         * Whether this object is appending files that have copies (groups with
         * more than one file) to the output
        protected boolean printingCopies;
         * Whether this object appends a path separator and the file's length
         * to the output after the first file of a group is appended
        protected boolean printingLength;
        /**The first file addded to the current group (null if the group is new)
        protected File currentBase = null;
        /** The number of files in the current group*/
        protected int groupSize = 0;
         * Creates a new instance whose behavior is specified by the given
         * parameters</p>
         * @param out The output to append to
         * @param printUniques Specifies if this object should append unique
         *      files
         * @param printCopies Specifies if this object should append files that
         *      have copies
         * @param printLength Specifies if this object should append the lengths
         *      of the files in a goup
        public PrintingDuplicatesStore(final Appendable out,
                final boolean printUniques, final boolean printCopies,
                final boolean printLength) {
            this.out = out;
            this.printingUniques = printUniques;
            this.printingCopies = printCopies;
            this.printingLength = printLength;
         * Add a file to the current group</p>
         * @param addMe The file to add
         * @return {@code true} always
         * @throws AppendException if an IOException occurs whilst attempting to
         *      append to the output.  The AppendException's cause is set to
         *      the IOException that was thrown.
        public boolean add(final File addMe) {
            try {
                if (currentBase == null) {
                    currentBase = addMe;
                    groupSize++;
                } else
                if (printingCopies) {
                    out.append(addMe.toString());
                    groupSize++;
                return true;
            } catch (final IOException ioe) {
                throw new AppendException(ioe);
         * Appends the file paths added since the last call to this method to
         * the output designated at construction</p>
         * @param keys Ignored
         * @return The number of files added between the last call and this call
         *      to this method
         * @throws AppendException if an IOException occurs whilst attempting to
         *      append to the output.  The AppendException's cause is set to
         *      the IOException that was thrown.
        public int group(final Object... keys) {
            try {
                if (groupSize == 1 && printingUniques)
                    appendBase(currentBase);
            } catch (IOException ioe) {
                throw new AppendException(ioe);
            int rv = groupSize;
            groupSize = 0;
            return rv;
         * Called to append the base file to the output (follow the file name
         * with a path separator, a space, and the file's length, if neccessary)
         * </p>
         * @param base The file to add that is the base file for the group
         * @throws IOException If an IOException occurs whilst attempting to
         *      append to the output
        protected void appendBase(final File base) throws IOException {
            out.append(base.toString());
            if (printingLength)
                out.append(File.pathSeparator).append(" ")
                        .append(Long.toString(base.length()));
            out.append(LINE_SEPARATOR);
         * {@inheritDoc}
         * @param itr {@inheritDoc}
         * @return {@inheritDoc}
        public int addAll(final Iterable<File> itr) {
            return GroupingAddable.DefaultBehavior.addAll(this, itr);
    * An object that prints duplicates, in order, as they are grouped</p>
    * <p>
    * The only difference between this and its superclass is that this removes
    * and prints the first element in the group, then sorts the remaining
    * elements before printing them.</p>
    public class SortPrintingDuplicatesStore extends PrintingDuplicatesStore {
        /** Temporary storage for the current group */
        LinkedList<File> duplicates = new LinkedList<File>();
         * Creates a new instance whose behavior is specified by the given
         * parameters
         * @param out The output to append to
         * @param printUniques Specifies if this object should append unique
         *      files
         * @param printCopies Specifies if this object should append files that
         *      have copies
         * @param printLength Specifies if this object should append the lengths
         *      of the files in a goup
        public SortPrintingDuplicatesStore(final Appendable out,
                final boolean printUniques, final boolean printCopies,
                final boolean printLength) {
            super(out, printUniques, printCopies, printLength);
         * {@inheritDoc}
         * @param addMe {@inheritDoc}
         * @return {@inheritDoc}
        public boolean add(File addMe) {
            return duplicates.add(addMe);
         * {@inheritDoc}
         * @param keys {@inheritDoc}
         * @return {@inheritDoc}
        public int group(Object... keys) {
            try {
                groupSize = duplicates.size();
                if (groupSize > 1)
                    if (printingCopies) {
                        appendBase(duplicates.pop());
                        sort(duplicates);
                        while (duplicates.size() > 0)
                            out.append("\t")
                                    .append(duplicates.pop().toString())
                                    .append(LINE_SEPARATOR);
                        return groupSize;
                    } else
                        duplicates = new LinkedList<File>();
                else
                if (printingUniques)
                        appendBase(duplicates.pop());
                return groupSize;
            } catch (IOException ioe) {
                throw new AppendException(ioe);
    }And the method that spawned all those interfaces and classes above
    * Find identical files.</p>
    * <p>
    * Functions like {@code getDuplicates(bases, order, exceptions, subjects)},
    * except that files in {@code subjects} that are found to be duplicates of
    * files in {@code bases} are added to the given {@code store} instead of
    * returned.</p>
    * <p>
    * If {@code bases} is not null, then the first file added to {@code store}
    * after each call to {@link DuplicatesStore#group} is from {@code bases}.
    * </p>
    * @param <F> The desired type the returned collection should contain.  It
    *      must be {@link File} or a subtype, and all elements in both
    *      {@code bases} and {@code subjects} must be assignable to it.
    * @param bases The only files to look for duplicates of
    * @param order A comparator to apply to files
    * @param exceptions The collection to add exceptions to, if they occur
    * @param store The collection to store duplicate files in
    * @param subjects The files to search for duplicates in.  Must implement
    *      hasNext, next, hasPrevious, previous, and remove
    * @see #getDuplicates(Collection, Comparator, Collection, ListIterator)
    public static final <F extends File> void getDuplicates(
            final Collection<? extends F> bases, final Comparator<File> order,
            final Collection<? super IOException> exceptions,
            final GroupingAddable<? super F> store,
            final ListIterator<? extends F> subjects) {...}

  • How do I override "error code -61" when attempting to put things in the Trash? Cannot empty Trash or use Secure Empty Trash.

    How do I override "error code -61" when attempting to put items in the Trash?  Cannot empty Trash or use Secure Empty Trash. I have a MacBook OS X 10.5.8

    The reason why some of the files are blocking the trash from emptying is because of specific ".app" files from third party companies like Adobe products. Not the user files or the various help documents but instead the actual mother program. Here's how to fix this problem:
    1) remove from the trash all the actual software programs like Photoshop, InDesign, DreamWeaver and so on and put them on the desktop.
    2) Command "I" (info) and when the dialog box opens go to the "Name & Extension" text box and remove the ".app" from the software name. Example: Photoshop.app change to Photoshop.
    3) the program icon will change to a "folder icon".
    4) put the folder icon back into the trash and you should be able to now empty the trash.
    If you continue to get the error code 8003 it's because you may still have one or more software programs in the trash that needs to go through this process. Remember - it's not the user files or help documents or supporting files that is causing this but instead the "actual product programs".
    JKai

  • When attempting to print with HP P2015 cabled to AirPort Extreme, error message is "Network host (name) is busy".  What's happening?

    When attempting to print with an HP P2015 cabled to an AirPort Extreme, the network won't connect to printer.  The Print Que message is "Network host (name) is busy; will retry in (number) seconds."  When I delete the file to be printed, the Print Queue screen says "Printer Ready".
    More Information:
    The printer's Queue Name is Hewlett-Packard HP LaserJet P2015 Series
    The Location is "(my name) AirPort Extreme"
    URL is "Hewlett_Packard%20%HP%20LaserJet%20P2015%20Series._pdl-datastream._tcp.local./ ?bidi" (for whatever that means)
    Driver Version is 18.4
    Printer Software is HP LaserJet P2015 Series
    The printer is listed as a printer on System Preferences/Print&Fax screen
    If I connect the printer cable directly to the iMac, the printer works fine.
    Any helpful directions would be greatly appreciated.

    I came across an Apple article last modified 6/2/08 (Printer troubleshooting for AirPort Base Stations and Time Capsule).  It suggested the old standby, i.e., disconnect the AirPort Extreme Base Station from its power source, turn off the printer, turn on the printer, and reconnect the AirPort to its power source.  It worked.  I guess disconnecting the AirPort cleared out the network host.  Yea. 

  • Compressor crash when attempting import files with 00* in name

    I produce several short video files every day and name them using a sequential five digit numerical naming convention.
    I'm finding that whenever I'm near, at or shortly after crossing a 100 mark Compressor crashes when I try and import single files with the following filenames (these are the most recent examples):
    20993
    21000
    21001
    21005
    The only way to import these problematic files is to select the file before, or after, then Command click on the filename causing the crash. Click Open to import both into the batch, and then click on the file I first clicked on and hit Delete to remove it from the batch, leaving the file with the problematic name.
    For Example. I want to import 21005 into Compressor for processing, but every time I try and import it Compressor crashes. So I re-launch Compressor, click the little Q button and click on 21004, then press Command and click on 21005. Click Open, import window goes away to reveal the Batch window. Click on 21004, press Delete button on keyboard leaving me with the file that was causing the crash.
    FWIW apart from the file duration/size, there's no difference between these files. In fact I can change the names and the files that used to import fine now crash Compressor when attempt to import with any of the filenames above.
    Here's the info behind two of the problem files and also that of the two adjacent files that import fine:
    (all files: Dimension: 720 x 480. Codecs: DV/DVCPRO - NTSC. Channel Count: 2. Kind: Final Cut Pro Movie File. No color labels.
    20999 (Imports Fine):
    File Size: 394,475,469 bytes
    Duration: 01'44
    21000 (Compressor Crasher):
    File Size: 324,052,925 bytes
    Duration: 01'26
    21001 (Compressor Crasher):
    File Size: 339.730.909 bytes
    Duration: 01'30
    21002 (Imports Fine):
    File Size: 348,707,181 bytes
    Duration: 01'32
    Compressor 2 - 2.0.1
    Dual 2 GHz PowerPC G5
    1.5 B DDR SDRAM
    Mac OS X 10.4.8

    Hello,
    Thanks for the replies/info.
    Yes the Panther and Jaguar install disks are retail versions, not specific machine versions. And the Jaguar ones worked for the Powerbook before.
    The Powerbook I have is the Firewire 500mhz one, Pismo I think it's called. The hard drive is a 60GB one. I didn't have to partition it before.
    Reviewing all the above, it would appear that the problem is me not being able to use an internal, built in CD/DVD drive to install from this time? The only other thing it could be I think is the crash I recently had has had some bad effect -- but that's unlikely right? So, I need to get a new DVD drive? Or is there any other way to get the OS onto the Powerbook without getting another internal DVD/CD drive? Is there anyway to install onto the PB from another machine maybe?
    Does that sound right?: not being able to use internal DVD/CD drive is the source of my current problem?
    Thanks.

  • No warning for 'name clash' of static methods

    The background is that I am trying to design a package which allows conversion methods to be 'plugged-in' to a class within a class hierarchy so that users can choose how objects are converted to double values. (For example, a 'city-block' conversion might be used instead of the Euclidean-distance one for class TwoD below.) I am trying to use generics to ensure that only converters specific to the appropriate class can be 'plugged-in' and also to simplify the definition of new converters.
    The issue that has arisen is a case which is not 'type-safe', in that the behaviour is not what I would expect from the type specifications, yet no warning is given. The full code is below.
    public abstract class Base {
        public abstract Converter getConverter();
        public double convert() {
            return this.getConverter().convert(this); // produces a warning
    public class OneD extends Base {
        static Converter<OneD> converter;
        int x;
        public OneD(int x) {
            this.x = x;
        public static void setConverter(Converter<OneD> c) {
            converter = c;
        public Converter getConverter() {
            return converter;
    public class TwoD extends OneD {
        static Converter<TwoD> converter;
        int y;
        public TwoD(int x, int y) {
            super(x);
            this.y = y;
        public static void setConverter(Converter<TwoD> c) {
            converter = c;
        }                                   // compiles OK with no warning
        public Converter getConverter() {
            return converter;
    public abstract class Converter<T> {
        public abstract double convert(T val);
    public class OneDConverter extends Converter<OneD> {
         public double convert(OneD val) {
            return val.x;
    public class TwoDConverter extends Converter<TwoD> {
        public double convert(TwoD val) {
            return Math.sqrt(val.x * val.x + val.y * val.y);
    public class Test {
        public static void main(String[] args) {
            OneD x1d = new OneD(1);
            TwoD x2d = new TwoD(1, 1);
            OneD.setConverter(new OneDConverter());
            TwoD.setConverter(new TwoDConverter());
            System.out.println("Convert OneD(1): " + x1d.convert() +
                               ", Convert TwoD(1, 1): " + x2d.convert());
            TwoD.setConverter(new OneDConverter());
              // wrong type of converter; should not be allowed
            System.out.println("Convert OneD(1): " + x1d.convert() +
                               ", Convert TwoD(1, 1): " + x2d.convert());
    }This produces the output:
    Convert OneD(1): 1.0, Convert TwoD(1, 1): 1.4142135623730951
    Convert OneD(1): 1.0, Convert TwoD(1, 1): 1.0The first line of this shows that the all is working OK, but in the second line we see that the wrong type of converter has been plugged-in to class TwoD, with no complaints or warnings at compile or run-time. I understand why this is so (as a result of erasure), but I am surprised that no warning is given that the static method setConverter() in class TwoD clashes with the one in OneD. Is this really type-safe behaviour? (If the two methods are made instance methods instead of static, the code does not compile because of a 'name clash' error.)
    Incidentally, an 'unchecked warning' arises because of the use of the raw class Converter in class Base, but I cannot figure out how to avoid this. The warning is right, and signals that we cannot be sure that the converter is the appropriate type for the argument. It is up to subclasses to ensure this and I cannot figure out how to guarantee that it will be so.

    public abstract class Base {
    public abstract Converter getConverter();
    public double convert() {
    return this.getConverter().convert(this); // produces a warning
    }Some of the problems you're seeing can be resolved
    by organizing your code better:
    abstract class Base<T extends Base<T>> {
        public abstract Converter<T> getConverter();
        public double convert() {
            return this.getConverter().convert(getThis());
        abstract protected T getThis();
    class OneD extends Base<OneD> {
        static Converter<OneD> converter;
        int x;
        public OneD(int x) {
            this.x = x;
        public static void setConverter(Converter<OneD> c) {
            converter = c;
        public Converter<OneD> getConverter() {
            return converter;
        protected OneD getThis() { return this; }
    class TwoD extends Base<TwoD> {
        static Converter<TwoD> converter;
        int y;
        int x;
        public TwoD(int x, int y) {
            this.x = x;
            this.y = y;
        public static void setConverter(Converter<TwoD> c) {
            converter = c;
        public Converter<TwoD> getConverter() {
            return converter;
        protected TwoD getThis() { return this; }
    abstract class Converter<T> {
        public abstract double convert(T val);
    class OneDConverter extends Converter<OneD> {
         public double convert(OneD val) {
            return val.x;
    class TwoDConverter extends Converter<TwoD> {
        public double convert(TwoD val) {
            return Math.sqrt(val.x * val.x + val.y * val.y);
    class Test {
        public static void main(String[] args) {
            OneD x1d = new OneD(1);
            TwoD x2d = new TwoD(1, 1);
            OneD.setConverter(new OneDConverter());
            TwoD.setConverter(new TwoDConverter());
            System.out.println("Convert OneD(1): " + x1d.convert() +
                               ", Convert TwoD(1, 1): " + x2d.convert());
            TwoD.setConverter(new OneDConverter());  // error
            System.out.println("Convert OneD(1): " + x1d.convert() +
                               ", Convert TwoD(1, 1): " + x2d.convert());
    }

  • When do we override our own clone method not the Object class clone method

    Hi,
    I have a confusion in overriding clone method.We can create clone object by writing Object.clone() but some times I have seen writing our own clone method ,when do we write this,also clone() is defined protected and when we write our own clone it is said to write it public,why?
    Thanks
    Sumit

    protected methods can only be called in the same class and it subclass. You can make clone protected if this is all you need.
    However if you need to clone() the object from another class, it need to be public.
    This is the same for any method.
    Also as Object.clone() is protected you cannot make it private or package-local (this is true of any protected method)

  • Overriding doSelect method in EO

    I have attempted to override the doSelect method in my EO then create a VO based on that EO and execute queries on the VO. My doSelect does not execute. I've attached my code from EO below... can someone tell me how to get the doSelect method to execute?
    protected void doSelect(boolean lock)
    System.out.println("overridden doSelect");
    try
    System.out.println("EadCodelistEO:doSelect Starting...");
    String pTableName = "UOM"; // test only
    EdtInstanceOty pInstance = new EdtInstanceOty();
    EdtLovTitleOty xLovTitle[] = new EdtLovTitleOty[] {new EdtLovTitleOty()};
    EdtLovToty xLovTo[] = new EdtLovToty[] {new EdtLovToty()};
    BigDecimal rowCount = new BigDecimal(0);
    pInstance.setCode("%"); // test only
    // get connection
    oracle.jbo.server.DBTransaction myDBT = this.getDBTransaction();
    TransactionContainer conn = new TransactionContainer(myDBT);
    // instantiate api object
    EdtBlLib1PvtOF edtLib1Api = new EdtBlLib1PvtOF(conn);
    rowCount = edtLib1Api.getlistofvalue (
    pTableName,
    pInstance,
    xLovTitle,
    xLovTo);
    System.out.println("rowCount = " + rowCount);
    if (rowCount.intValue() > 0)
    for (int i = 0; i < xLovTo[0].length(); ++i)
    EdtInstanceOty outInstance = xLovTo[0].getElement(i);
    populateAttribute(CODE,outInstance.getCode(),true,false);
    populateAttribute(NAME,outInstance.getName(),true,false);
    populateAttribute(DESCN,outInstance.getDescn(),true,false);
    populateAttribute(STARTDATE,outInstance.getStartDate(),true,false);
    populateAttribute(ENDDATE,outInstance.getEndDate(),true,false);
    populateAttribute(CODEID,outInstance.getId(),true,false);
    System.out.println("LOV Loop: "+i);
    System.out.println(" ID = " + outInstance.getId() +
    " CODE = " + outInstance.getCode() +
    " NAME = " + outInstance.getName());
    catch (SQLException sqlE)
    sqlE.printStackTrace();

    doSelect() is not related to view object functionality.
    View Object's perform their own query, but coordinate via attribute mapping metadata, with underlying EO's.
    doSelect() is invoked on an Entity instance when:
    [list]
    [*]The entity instance needs to lock its row in the database (the lock boolean flag will be true if this is the case)
    [*]The entity instance needs to be faulted into memory either because of a findByPrimaryKey() in progress, or because business logic has referenced an attribute of the entity that was not already in the cache due to some view object's querying it.
    [list]

  • Is not abstract and does not override abstract method ERROR

    Hello. I'm new at all this, and am attempting to recreate a sample code out of my book (Teach Yourself XML in 24 Hours), and I keep getting an error. I appriciate any help.
    This is the Error that I get:
    DocumentPrinter is not abstract and does not override abstract method skippedEntity(java.lang.String) in org.xml.sax.ContentHandler
    public class DocumentPrinter implements  ContentHandler, ErrorHandler
            ^This is the sourcecode:
    import org.xml.sax.Attributes;
    import org.xml.sax.ContentHandler;
    import org.xml.sax.ErrorHandler;
    import org.xml.sax.Locator;
    import org.xml.sax.SAXParseException;
    import org.xml.sax.XMLReader;
    public class DocumentPrinter implements  ContentHandler, ErrorHandler
    // A Constant containing the name of the SAX parser to use.
    private static final String PARSER_NAME = "org.apache.xerces.parsers.SAXParser";
    public static void main(String[] args)
       // Check to see whether the user supplied any command line arguments.  If not, print an error and exit.
       if (args.length == 0)
         System.out.println("No XML document path specified.");
         System.exit(1);
       // Create a new instance of the DocumentPrinter class.
       DocumentPrinter dp = new DocumentPrinter();
       try
         // Create a new instance of the XML Parser.
         XMLReader parser = (XMLReader)Class.forName(PARSER_NAME).newInstance();
         // Set the parser's content handler
        // parser.setContentHandler(dp);
         // Set the parsers error handler
         parser.setErrorHandler(dp);
         // Parse the file named in the argument
         parser.parse(args[0]);
       catch (Exception ex)
         System.out.println(ex.getMessage());
         ex.printStackTrace();
    public void characters(char[] ch, int start, int length)
       String chars ="";
       for (int i = start; i < start + length; i++)
         chars = chars + ch;
    System.out.println("Recieved characters: " + chars);
    public void startDocument()
    System.out.println("Start Document.");
    public void endDocument()
    System.out.println("End of Document.");
    public void startElement(String namespaceURI, String localName, String qName, Attributes atts)
    System.out.println("Start element: " + localName);
    for (int i = 0; i < atts.getLength(); i++)
    System.out.println(" Attribute: " + atts.getLocalName(i));
    System.out.println(" Value: " + atts.getValue(i));
    public void endElement(String namespaceURI, String localName, String qName)
    System.out.println("End of element: " + localName);
    public void startPrefixMapping(String prefix, String uri)
    System.out.println("Prefix mapping: " + prefix);
    System.out.println("URI: " + uri);
    public void endPrefixMapping(String prefix)
    System.out.println("End of prefix mapping: " + prefix);
    public void ignorableWhitespace(char[] ch, int start, int length)
    System.out.println("Recieved whitespace.");
    public void processingInstruction(String target, String data)
    System.out.println("Recieved processing instruction:");
    System.out.println("Target: " + target);
    System.out.println("Data: " + data);
    public void setDocumentLocation(Locator locator)
    // Nada
    public void error(SAXParseException exception)
    System.out.println("Parsing error on line " + exception.getLineNumber());
    public void fatalError(SAXParseException exception)
    System.out.println("Fatal parsing error on line " + exception.getLineNumber());
    public void warning(SAXParseException exception)
    System.out.println("Warning on line " + exception.getLineNumber());

    Check to make sure that the arguments are consistent with your ContentHandler class. Probably the wrong type.
    I think you forgot to include the skippedEntity method, it seems to be missing. Even if an implemented class has a method that you are not using, you still have to include the method in your code even if it doesn't do anything.
    Message was edited by:
    ChargersTule1

  • Product is not abstract and does not override abstract method

    Received the following errors.
    Product.java:3: Product is not abstract and does not override abstract method ge
    tDisplayText() in Displayable
    public class Product implements Displayable
    ^
    Product.java:16: getDisplayText() in Product cannot implement getDisplayText() i
    n Displayable; attempting to use incompatible return type
    found : void
    required: java.lang.String
    public void getDisplayText()
    ^
    2 errors
    Code reads as follows
    import java.text.NumberFormat;
    public class Product implements Displayable
         private String code;
         private String description;
         private double price;
         public Product()
              this.code = "";
              this.description = "";
              this.price = 0;
    public void getDisplayText()
    String message =
    "Code: " + code + "\n" +
    "Description: " + description + "\n" +
    "Price: " + this.getFormattedPrice() + "\n";
         public Product(String code, String description, double price)
              this.code = code;
              this.description = description;
              this.price = price;
         public void setCode(String code)
              this.code = code;
         public String getCode(){
              return code;
         public void setDescription(String description)
              this.description = description;
         public String getDescription()
              return description;
         public void setPrice(double price)
              this.price = price;
         public double getPrice()
              return price;
         public String getFormattedPrice()
              NumberFormat currency = NumberFormat.getCurrencyInstance();
              return currency.format(price);
    Please help!

    Received the following errors.
    Product.java:3: Product is not abstract and does not
    override abstract method ge
    tDisplayText() in Displayable
    public class Product implements Displayable
    ^
    Product.java:16: getDisplayText() in Product cannot
    implement getDisplayText() i
    n Displayable; attempting to use incompatible return
    type
    found : void
    required: java.lang.String
    public void getDisplayText()
    ^
    2 errors
    Code reads as follows
    Please use the code tags when posting code. There is a code button right above the text box where you enter your post. Click on it and put the code between the code tags.
    These error messages are quite clear in telling what is wrong. You have an Interface called Displayable that specifies a method something like thispublic String getDisplayText() {But in your Product source code, you created thismethodpublic void getDisplayText() {The compiler is complaining because the methods are not the same.
    You also need to return a String in the method probalby like thisreturn message;

  • After upgrade SP-Crawl Error: The SharePoint item being crawled returned an error when attempting to download the item.

    Hi All - After the upgrade, I am getting SP-Crawl Error for certain links. I check the Crawl component has proper permission.
    Google is showing some article like
    http://blog.karstein-consulting.com/2012/04/20/error-in-crawl-log-the-sharepoint-item-being-crawled-returned-an-error-when-attempting-to-download-the-item/
    not sure if this resolution is referring to 2010 and/or 2013. 
    I checked the registery editor. I couldn't find 14.0 under the Office Server.
    Any clue?
    Regards,
    Khushi
    Khushi

    I checked the web application policy the search crawl account has full read permission.
    Crawl
    Fiddler
    Log Error referring the Correlation ID
    01/06/2014 13:05:06.14  w3wp.exe (0x1698)                        0x0118 SharePoint Foundation        
     Monitoring                     nasq Medium   Entering monitored scope (Request (GET:/sites/HR/Shared%20Documents/Benefits/Insurance%20Benefits/Life%20Insurance/Basic%20Life%20and%20ADD)).
    Parent No 
    01/06/2014 13:05:06.14  w3wp.exe (0x1698)                        0x0118 SharePoint Foundation        
     Logging Correlation Data       xmnv Medium   Name=Request (GET:<SiteURL>/sites/HR/Shared%20Documents/Benefits/Insurance%20Benefits/Life%20Insurance/Basic%20Life%20and%20ADD) e8b1679c-0476-70d4-9fcd-2cef5be44461
    01/06/2014 13:05:06.14  w3wp.exe (0x1698)                        0x0118 SharePoint Foundation        
     Authentication Authorization   agb9s Medium   Non-OAuth request. IsAuthenticated=True, UserIdentityName=, ClaimsCount=0 e8b1679c-0476-70d4-9fcd-2cef5be44461
    01/06/2014 13:05:06.15  w3wp.exe (0x1698)                        0x1738 SharePoint Foundation        
     General                        af71 Medium   HTTP Request method: GET e8b1679c-0476-70d4-9fcd-2cef5be44461
    01/06/2014 13:05:06.15  w3wp.exe (0x1698)                        0x1738 SharePoint Foundation        
     General                        af75 Medium   Overridden HTTP request method: GET e8b1679c-0476-70d4-9fcd-2cef5be44461
    01/06/2014 13:05:06.15  w3wp.exe (0x1698)                        0x1738 SharePoint Foundation        
     General                        af74 Medium   HTTP request URL: /sites/HR/Shared%20Documents/Benefits/Insurance%20Benefits/Life%20Insurance/Basic%20Life%20and%20ADD e8b1679c-0476-70d4-9fcd-2cef5be44461
    01/06/2014 13:05:06.17  w3wp.exe (0x1698)                        0x1738 SharePoint Foundation        
     Files                          aise3 Medium   Failure when fetching document. 0x80070090 e8b1679c-0476-70d4-9fcd-2cef5be44461
    01/06/2014 13:05:06.17  w3wp.exe (0x1698)                        0x1960 SharePoint Foundation        
     Monitoring                     b4ly Medium   Leaving Monitored Scope (Request (GET:<SiteURL>/sites/HR/Shared%20Documents/Benefits/Insurance%20Benefits/Life%20Insurance/Basic%20Life%20and%20ADD)).
    Execution Time=20.5461867360237 e8b1679c-0476-70d4-9fcd-2cef5be44461
    01/06/2014 13:05:06.17  w3wp.exe (0x1698)                        0x1960 SharePoint Foundation        
     Monitoring                     b4ly Medium   Leaving Monitored Scope (Request (GET:<SiteURL>/sites/HR/Shared%20Documents/Benefits/Insurance%20Benefits/Life%20Insurance/Basic%20Life%20and%20ADD)).
    Execution Time=29.917489513332 e8b1679c-0476-70d4-9fcd-2549ba3ee9d4
    01/06/2014 13:05:06.17  w3wp.exe (0x1698)                        0x1960 SharePoint Foundation        
     Monitoring                     nasq Medium   Entering monitored scope (Request (GET:<SiteURL>nsurance%20Benefits%2fLife%20Insurance%2fBasic%20Life%20and%20ADD&FolderCTID=0x01200039DA632EEACF264685CF39D68A18F7C8)).
    Parent No 
    Any clue?
    Regards,
    Khushi
    Khushi

  • How to override truncateToFit method for SuperTabNavigator

    Hi All,
               How to override truncateToFit method for SuperTabNavigator.
    we have editableLabel method for changing the tab name.
    it is dispalying the ... elipse when entered characters grater than the tab width. it is ok.
    but if the entered characters less than the tab width it is also appending the ... elipse.
    i dont want that . how to remove those. i dont want completely truncateToFit option.
    how to override .
    Can any help me regarding this?
    Thanks in Advance
    Raghu.

    Give me a sample codeNo. Read the links provided by Yannix, try it out for yourself, and if you still have a question, post the code you tried.
    db

Maybe you are looking for

  • Links to documents behave differently (ie11)

    I have an excel sheet , sheet.xlsx, in a sharepoint 2010 library, http://sharepoint, which is in trusted sites. I have an IE (11) favorite for that excel sheet. I have a desktop shortcut.url if I browse to http://sharepoint/library/AllItems.aspx, and

  • Checked Exception and Anonymous classes

    Hi I am refering to java certification book that says : If a checked exception is thrown during the execution of initializer expression, then it has to be caught and handled. This restriction does not apply to instance initializer expressions in anon

  • How can I get more storage on my iPhone 5?

    I have an iPhone 5 with the smallest amount of storage. I'm not sure exactly how much I have, but I keep filling it up and am often finding myself unable to download apps, music or take videos. I don't t want to delete anything from my phone, but I w

  • Balance order confirmed qty in PI sheet

    Dear experts, Pls suggest while performing confirmation in PI sheet system shows the confirmed qty in the field not the balance confirmed qty that system useually shows while performing good mvt using co11n or cor6. Thanks in advance for your inputs

  • How can I create my own Print App?

    We'd like to create a Print App for our business-focused product.  How do we do that / become a Print App developer?  Who can we get in touch with to get more info? Thanks!