This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Using 7.2 beta or 7.2 RC1 , this method produces the error The type of identify(null, resource, null) is erroneous This problem does not occur in versions lower than 7.2 , ie 7.1 The same source tree is used in both cases as is the VM. Java on osx 10.6.8 java version "1.6.0_33" Java(TM) SE Runtime Environment (build 1.6.0_33-b03-424-10M3720) Java HotSpot(TM) Client VM (build 20.8-b03-424, mixed mode) Code protected String getMimeType(String resource) { MagicMimeTypeIdentifierFactory factory = new MagicMimeTypeIdentifierFactory(); MimeTypeIdentifier mimeTypeIdentifier = factory.get(); return mimeTypeIdentifier.identify(null, resource, null); <--- ERROR } /* * Copyright (c) 2005 - 2008 Aduna and Deutsches Forschungszentrum fuer Kuenstliche Intelligenz DFKI GmbH. * All rights reserved. * * Licensed under the Aperture BSD-style license. */ package org.semanticdesktop.aperture.mime.identifier; import org.ontoware.rdf2go.model.node.URI; /** * Identifies the MIME type of a binary resource. Implementations typically use heuristics such as magic * numbers, file name extension, etc. to perform the identification. */ public interface MimeTypeIdentifier { /** * Identifies the MIME type of a binary resource based on the specified characteristics. Any of the * parameters may be null. * * @param firstBytes The first bytes of the resource's binary contents. The getMinArrayLength method * will return how big this array should minimally be for this MimeTypeIdentifier to do * its job. * @param fileName The resource's file name. * @param uri the URI used to typically identify the resource. * @return the detected MIME type of the resource, or null when the MIME type could not be * determined. * * @see #getMinArrayLength() */ public String identify(byte[] firstBytes, String fileName, URI uri); /** * Returns the minimum length needed by the identify method for its array parameter. * * @see #identify(byte[], String, URI) */ public int getMinArrayLength(); }
Jan, you might know more..
This error was added in 7.2 to mark cases when the return of of the invoked method is erroneous (missing). So we need to find out why the IDE believes the return type is erroneous - I tried to reproduce using the provided code, but the error did not appear. Is there a way to get the IDE to the broken state? Thanks.
Created attachment 121859 [details] request project to show error zip format project to show error as requested
Thank you very much for the project, I can reproduce now. The immediate cause (in the attached project) seems to be that "org.ontoware.rdf2go.model.node.URI" is inaccessible in the project that does "mimeTypeIdentifier.identify(null, resource, null)". Some versions of javac might accept such source, but some definitely don't, so I would generally recommend to avoid such situation. The error should be obviously be more specific, though.
I'll try to improve the error message
Fixed in jet-main#ba2c757b7ee8 The actual missing type(s) are printed in the error hint.
Integrated into 'main-silver', will be available in build *201409191429* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/ba2c757b7ee8 User: Svata Dedic <sdedic@netbeans.org> Log: #215210: improved error message, the actual missing type is printed