BUG: JDeveloper code editor shows valid static import call as error

I've noticed what appears to be a bug in the JDeveloper code validator when dealing with static imports.
The following classes demonstrate the problem:
package test;
public class Parent {
  public static void parentMethod() {
    System.out.println("called parentMethod.");
package test;
public class Child extends Parent {
  public static void childMethod() {
    System.out.println("called childMethod.");
package test;
import static test.Child.*;
public class StaticInheritanceTest {
  public static void main(String[] args) {
    Child.childMethod();
    Child.parentMethod();
    childMethod();
    parentMethod();  //<-- this line is highlighted as an error
}Notice how on lines 7 and 8 of StaticInheritanceTest, the code validator does recognise that both parentMethod and childMethod are static methods of the Child class.
Since 'Child' has been statically imported, then parentMethod should be available. Although parentMethod is presented as an 'auto-suggest' at line 11 in StaticInheritanceTest, when you try to call it the code editor shows the call as an error and the Ctrl-Click (to drill down into the method) doesn't work.
When I run the class, it compiles successfully and runs with the following output:
called childMethod.
called parentMethod.
called childMethod.
called parentMethod.This might seem like an obscure and theoretical problem, but I've hit this whilst using Mockito, which uses exactly this kind of inherited static method to provide matchers.

Hi,
thanks. Will file a bug. This seems to be a designtime only issue that does not present a show stopper.
Frank

Similar Messages

  • Bug report: code editor shows false PHP error

    I'm using Dreamweaver CC on an iMac.  The problem is that the PHP line error indicates an error in the code when there is no error.  This happens regularly when adding new values to an arrays that's formatted across multiple lines.  Please see the attached screenshot.

    When uploading an image on this forum, it seems to dramatically reduce the quality of the upload.  Here is a zoomed in image.

  • JDeveloper Code Editor doesn't do ClearType font anti-aliasing

    I can't seem to get the Code Editor in JDeveloper (11.1.1.5.0) to do ClearType sub-pixel font anti-aliasing. Everything else in the IDE is doing proper sub-pixel anti-aliasing, it's only the Code Editor that's not doing it. It's doing "normal" pixel anti-aliasing which isn't nearly as good and still leaves the font looking quite jaggy.
    I've got the following lines in my jdev.conf:
    AddVMOption  -Dswing.aatext=true
    AddVMOption  -Dawt.useSystemAAFontSettings=lcd
    And I've checked "Enable Text Anti-Aliasing" in Preferences->Code Editor->Display.
    Is sub-pixel antialiasing in the JDeveloper code editor possible? If so, how? I'm running Windows 7 btw.

    No problem Timo.
    I don't think it's worth opening an SR for this. It looks like sub-pixel anti-aliasing isn't supported in the JDeveloper Code Editor, which is a shame, because that's the place where it's most needed.
    Michael.

  • Enhancement Suggestion - Jdeveloper Code Editor

    Hello,
    I would like to make an enhancements suggestion for the JDeveloper code editor. I find the "history" tab of the source editor extremely useful when I'm trying new things and not sure if they would work. This tab helps me revert changes to a last known version. However, I see myself having to identify the previous correct version by date and time, which is kind of dicey. I do see there is also a description column, however, I'm not able to edit the description with a meaningful message that would help identify as last know good version quickly. Hence, my suggestion is that the history tab of the code editor allow the user to add tags / comments against each version for quick identification.
    Hope the Oracle development is listening, and you'll have to excuse me for posting if this forum is the wrong place to make suggestion ( i didn't quite find any feedback feature on the Jdeveloper product page).
    regards,
    Rehan Yusuf

    No problem Timo.
    I don't think it's worth opening an SR for this. It looks like sub-pixel anti-aliasing isn't supported in the JDeveloper Code Editor, which is a shame, because that's the place where it's most needed.
    Michael.

  • BUG?: Code Editor – Completion Insight  - Autogenerate GROUP BY clause

    With the “Autogenerate GROUP BY clause” enabled the following problem occurs:
    Coding an inline select in an aggregate query:
      SELECT   (SELECT   DEPARTMENT_NAME
                  FROM   departments d
                 WHERE   d.department_id = e.department_id) dep
            , JOB_ID
            , SUM (salary)
        FROM   employees e
    GROUP BY   department_id, job_idCode group-by-autogenerate transforms this from time to time into:
      SELECT   (SELECT   DEPARTMENT_NAME
                  FROM   departments d
                 WHERE   d.department_id = e.department_id) dep
                 , JOB_ID
                 , SUM (salary)
        FROM   employees e
        GROUP BY (SELECT   DEPARTMENT_NAME
                  FROM   departments d
                 WHERE   d.department_id = e.department_id), JOB_IDWhich results in:
    ORA-22818. 00000 - "subquery expressions not allowed here"
    *Cause:    An attempt was made to use a subquery expression where these
    are not supported.
    *Action:   Rewrite the statement without the subquery expression.
    when trying to run it.
    (version 2.1.0.6.3; build MAIN-63.73; Windows XP)

    Duplicate of
    2.1 EA1 - Auto Group By inserted when unwanted/expected

  • Problems with cut and paste within the code editor in JDeveloper 10.1.3 EA

    Copy and pasting doesn't work as expected. If I copy some code and paste it somewhere else, i get completely different code, (it seems to paste a piece of code from somewhere else in the source).
    I tried expanding + signs, this didn't help.
    I'am running JDeveloper on Windows XP Professional.
    Does anybody else have the same problem.
    Is this a bug?

    We've tracked down this issue thanks to Tullio's supplying us with a reproducible testcase. It's related to the "Automatically Copy Paste Imports" preference (which is on by default) in the Tools->Preferences->Code Editor category of IDE preferences. It seems to also be related to having renamed a source path directory to have a name that is only different by case from the name it originally had. Disabling this preference is a workaround for EA1.
    For example, if you started out by creating your workspace with a source directory named "Src", then later renamed it to "src", this seems related to the situation when this issue can occur. Renaming the directory back to match what it was before is another workaround for EA1.

  • BUG: EA 2.1 code editor: completion insight doesn't work in opened files

    I just migrated from SQLDEV 1.5.5 to EA 2.1. It's nice that I colud find so many of my suggestions implemented in this new version. THANKX :-)
    code editor:
    When I'm working in SQL Worksheet the "completion insight" feature is working well, but when I try to use it in an opened file, it doesn't work.
    Is there a special preference to turn on for use with files?
    Edited by: @chris on 12.11.2009 10:57

    Correct it did work in 1.5. on .sql files, when connected, so I have updated the ER to bug. We also need to expand this to support PL/SQL files.
    Sue

  • Jdeveloper visual editor do not show images and other component shapes

    I used jdeveloper(10.1.3.3.0) to create an ADF BC application, I create a jsf jsp file and drag and drop components from ADF Faces Core to this file visual editor, but jdeveloper visual editor do not show images and other component shapes.
    Could you tell me how I can fix this problem?
    Thanks,
    Mike

    Actually, I need to make a dummy change to the jsp file and then it will display boxes representing the objects in the visual editor whereas I get an exception in the log:
    javax.servlet.jsp.JspException: Cannot find FacesContext
    This does not talk much to me !
    Thanks

  • Static import bug?

    Hey just discovered something new...does this sound like a bug to you guys?
    I have a class with a static method called, say, omgMethod()
    and I have another class with a method (not static) with the same name (omgMethod) but different signature.
    now when I try to use import static classA.omgMethod in the second class, it generates a compiler error:
    cannot find symbol method omgMethod( etc...)
    any thoughts? i'm thinking about adding it to the bug report.
    -Cuppo

    I'm not so sure about that. I have never used static import so I checked out Sun's tutorial which is here:
    http://java.sun.com/j2se/1.5.0/docs/guide/language/static-import.html
    It talks about importing "members" and says you can import "members" individually. And (I had to look this up too in the JLS), "members" means classes, interfaces, fields, and methods.
    So that says to me that you can indeed import a static method from another class, and then use it without qualification. Yeah, I'm surprised too. But you're just importing the method's name, not its signature. So if that name conflicts with a name of a method in your class, then I don't know what is supposed to happen. I looked through the JLS a bit and section 6.5.7.1 says
    "The Identifier must name at least one visible (�6.3.1) method that is in scope at the point where the Identifier appear or a method imported by a single-static-import declaration (�7.5.3) or static-import-on-demand declaration (�7.5.4) within the compilation unit within which the Identifier appears.
    See �15.12 for further discussion of the interpretation of simple method names in method invocation expressions."
    Possibly section 15.12 discusses conflict resolution in this case. But I will let you carry on from there.

  • Java code editor bug

    JDev Team
    The code editor highlights the string inside split() in red. The message displayed is " String literal contains illegal escape character '.' "
    String prodID = "10.5.1";
    String[] prodLevelId = prodID.split("\\.");
    Thanks

    balar1,
    Thanks for the feedback. I checked your testcase in more current builds and the error is no longer present, so this issue is isolated to the preview. Thanks again for making us aware of this problem.
    --RiC                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • BUG - Process Code Validator isn't working when creating a plsql process

    Steps to reproduce:
    1. New Process
    2. Type: PL/SQL
    3. Give it a name
    4. Enter process body (note I have just entered a random value which obviously isnt valid plsql code - no semi-colon, no procedure called abc, etc.)
    abc5. Click Create Process
    It succeeds!
    Alternatively, if I click next - the validator fires properly.
    Ta,
    Trent

    Some more observations in this regard
    <li>After opening the saved invalid PLSQL code for edit , it doesn't let you save it again , so the validation is firing at this point.
    <li>If you click on next and then click on back to return to PLSQL code page, and then press next once again, it validates and hence is working as expected.
    Now the weird part
    <li> If you check and then uncheck the "Do not validate PL/SQL code (parse PL/SQL code at runtime only)." checkbox the first time itself when creating , the validation will be fired.
    So my guess is that, the validation is fired based on the value of some item which is not set correctly during the first arrival on the PLSQL code page,possibly the item is null without any default value and the SQL query doesn't handle the null case (like an equals to check with NULL).

  • Bug: syntax error in code editor breaks layout and redrawing windows incorrect

    I'm working with "SQL Developer" version:
    Oracle IDE    4.0.0.13.80
    Plataforma Java(TM)    1.7.0_45
    installed on windows 7  64 bits.
    when I execute some ddl command in the code editor with syntax error, all layout windows are incorrectly drawn, and I have to close "SQL Developer" application to go on.
    Example:
       COMMENT ON COLUMN "TABLE"."COLUMN1" IS 'comments on column 1';
       COMMENT ON COLUMN "TABLE"."COLUMN2" AS 'comments on column 2';
    First comment is correctly aplied but second comment has a syntax error (AS is wrong) but you no receive error output, layout it hangs.
    I tested with thick/OCI and using jdbc, and I always go to the same problem.

    Good Morning
    Did you ever get this working without restoring ?
    Kind Regards
    Marius

  • Trouble finding schema type in JDeveloper XPath editor

    Has anyone seen an issue where the JDeveloper XPath editor does not expose all XML schema types from a WSDL? The WSDL in question has a flattened WSDL with 4 different schema's (all having a different namespace). The xml elements in question have the nillable attribute set to "true" so I'm not sure if this could be causing the issue. Each schema does include namespace imports (<import namespace="" />) as well.
    note: I will be unable to post wsdls as they contain proprietary info however they do validate in a XML validation tool.
    JDeveloper version 10.1.3.3

    It seems as if the xsd:extension element is not properly interpreted in JDeveloper. Post XPath query error - xml extension in schema gives a bug number but that was initiated in 2006 and it does not seem to be resolved. Does anyone know if this will be fixed in JDeveloper 11G. A workaround is to put all extension types within their parent or base type but it will probably break the web service and is almost impossible with size of the WSDLs I am working with.
    Basically if this functionality is not fixed, it would eliminate developers from implementing any type of inheritance within web services. This needs to be fixed!

  • Static imports in 1.5

    same static variable and same static method exists in two diffrent classes, while importing these two in my own implementation class follwing different output is coming why? Using j2se version1.5
    while using variable imports like
    import static package.Class1.variable1;
    import static package.Class2.variable1;
    //giving compilation errros
    while using method imports like
    import static package.Class1.method1;
    import static package.Class2.method1;
    //it is not giving any compilation error.
    Can anyone explain?

    >
    ah ok, when i wrote "Clearly" above i was assuming
    that the spec. when it does arrive (or when i can find
    it..) will disallow static imports of same signature
    methods (or possibly even just same named methods?) -
    and clearly any contravention of the spec should be
    reported to the userIf the spec says is should do something then it should do that.
    >
    on the other hand, the more the compiler can do the
    better since its a single point used by lots of
    people, so any small extra only has to be done once
    and is multiplied in the payoff - any individual
    trivial error message or warning might be
    questionable, but if lots are done then it saves time
    I doubt that a lot of people are going to be attempting to apply static imports to the same named item.
    not completely the same things, but i like the jikes
    feature where it says something like "it look like
    you're trying to invoke <SOME API METHOD> - this
    doesn't exist but a similar method does with
    signature: ... "
    I suspect that happens and is going to continue to happen far more frequently than duplicate static imports.
    And of course a compiler can add additional things like that. But that is rather different than suggesting that it is required.
    when a case is left in the grey area then at the very
    least a dozen developers will come across it and
    because of the lack of some text saying ERROR will
    start to question themselves - i don't see this as
    pandering to the developers laziness
    And yet none of the compilers warn against the "i = i++" construct.
    i've not verified this, and also the lang. spec does
    not seem to have been updated for 1.5???
    it sounds like the compiler should just complain in
    both cases?Yes but given that neither has been used I suspect
    that it will complain once they are used. If it
    doesn't then that is a bug.hm, a similar piece of code
    import java.util.List; import java.awt.List;
    complains immediately if you try to compile it - i guess this
    isn't that important but i like the
    complain-loudly-and-early approach - i think they also
    possibly made unused imports or duplicate imports
    errors or warnings for 1.5?Could be. However, the spec itself drags significantly behind the additional material. For example note that the 'current' spec doesn't have assert. So tracking down what should really be in the spec can be somewhat complicated.
    Note also that I haven't really seen the OP clarify that they expect an error for both cases rather than that they expect that no error at all should show up (because they really want to use both.) And although the first is nice the second is clearly wrong. Hopefully that point is clear.

  • Ugly fonts in code editor

    I am using JDeveloper 11.1.1.6.0 with Win 7 or Win 8 and the font I choose (Consolas 12) does not display well in the code editor. The text in sample text looks good, but in the editor it's not the same. You can't distinguish the m in bold. See screenshot with anti-aliasing enabled. With and without the anti-aliasing, it's the same.
    See https://www.dropbox.com/s/g6f0pma9z92nh4r/jdev.png

    I choose Consolas because it's the one I used to use in Eclipse, and it's a good programming font. I also try to use Inconsolata or Source Code Pro. The first one is installed on my Windows but does not show up in the list, and the other one displays all characters as crossed square.
    I also noticed that the sample text display looks good for all fonts but in the code editor, the rendering is different. Is it just me or my eye?
    What monospaced (fixed-width) font do you advise?
    Thanks

Maybe you are looking for

  • List of All Ports in Use.

    Is there any way to know / obtain a list of all the ports in use for all the components of an Application Server? Thanks, Nirav

  • R/3 not coming up.

    Hi, I'm trying to do a system start using startsap. Just to give a background, I ran SGEN and the archive logs directory went full. Its currently 100% full with around 24 mb left. I disabled the archive log by the following commands in SQL. SQL> SHUT

  • Import problem form 8i to 10g express

    I have done a export from oracle 8i(unix), and now when i do the import, he give me always the same error : imp-000038. In the source system the character set is AMERICAN_AMERICA.WE8ISO8859P9, and in the destination i instaled the oracle x10g xe univ

  • Roll Over Events on Icloud

    HOw can you set roll over events on the icloud calendar?

  • Mountain Lion Didn't Install Recovery Partition

    So here's a weird one... Upgarded my harddrive a while back while I was still on Lion and in the process of cloning from my 500gb drive to my new 750gb drive I didn't end up getting the recovery partition cloned over. Didn't really think much of it,