BUG: 'Remove unused import' operation modifies access modifiers

Bug in 10.1.3 Production:
In the code below
import java.util.*;
<u>abstract public</u> class Class1 {
}after an 'Remove Unused Import java.util.*' operation (or 'Organize Imports', there’s no difference) applying (at a line gutter) code becomes as below:
<u>public public</u> class Class1 {
}Public twice.
If the class is declared as 'public abstract' then all goes right.

Well, here it goes,
* This is java docs
* @author Sérgio Gameiro
* @since 12/04/2006
package br.com.gameiro.jdev.extension;
import javax.swing.JOptionPane;
import oracle.ide.Addin;
import java.io.*;
public class TestingAddin implements Addin{
public TestingAddin() {
public void initialize() {
JOptionPane.showMessageDialog(null, "Testing");
Becomes:
* This is java docs
* @author Sérgio Gameiro
* @since 12/04/2006
package br.com.gameiro.jdev.extension;
package br.com.gameiro.jdev.extension;
import javax.swing.JOptionPane;
import
public class
TestingAddin class TestingAddin implements Addin{
public TestingAddin() {
public void initialize() {
JOptionPane.showMessageDialog(null, "Testing");
Oh yeah, that's messy. I think it is something similar to what happens here:
"Organize Imports" feature in Jdev10g will totally mess up my source code
BUG: 5006753
Javasocs' to blame. If you put Javadocs before the package, or between package and import declarations, this what's going to happen to you!
Otherwise (Javadoc on top of the class declaration), no problem.
null

Similar Messages

  • Bug in JDeveloper Remove Unused Imports feature

    Hi,
    I just detected the following funny behavior in the Remove Unused Imports feature in JDeveloper:
    Let's take the following dummy code:
    package mypackage;
    import oracle.jbo.domain.Date;
    public class MyClass {
    public MyClass() {
    oracle.jbo.domain.Date oracleDate;
    Date.getCurrentDate();
    If I'm applying Remove Unused Imports on this code, import oracle.jbo.domain.Date will be eliminated.
    Regards,
    Dan

    Hi Dan,
    This is the expected behavior. Since you have explicitly referenced the Date class by its fully qualified name in the MyClass constructor, the import is not required, and hence is unused.
    Thanks,
    Brian
    JDev Team

  • Bug in organize imports

    Hi,
    There seem to be a couple of past bugs on organize imports- I'm not sure if this problem falls into the previous issues or not (or if they have been corrected.. ..as I side note, how does one access the list of open bugs? I can only find past fix lists)... ...any way, the issue:
    * I had to import some legacy code which cotains a) unused imports and b) imports to vendor-specific classes (e.g. com.ibm.websphere.ldap.serializer.ModificationItem, rather then java.naming.directory.ModificationItem )
    * if I choose to ogranize imports it generates malformed code, specifically:
    --the class level javadoc is repeated (occurrs each time)
    --often an empty import statement is put before the class-level javadoc
    --"public class LDAPHelper" becomes
    "public class LDAPHelper class LDAPHelper" (this problem occurrs each time)
    Seeing how this code with its vendor specific implementations can't compile any way, it's not as annoying as it normally would be, but still a little surprising. Take care.

    Sean,
    does this happen with JDeveloper 10.1.3 ? Open bugs can be looked up in metalink.oracle.com if you have a support contract
    Frank

  • Finding and removing unused replica virtual machines in the VMware Horizon

    Hello All,
    I found this tutorial : http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2009844#determining
    and I was trying this command : SviConfig.exe -operation=FindUnusedReplica -DsnName=ComposerDB -Username=sa -Password=secret -Move=true
    but I dont know right password of DSN, how can I get ? or is it another tutorial how to remove unused replica virtual machine ?

    Hi,
    So what you are trying to do is drill into the Composer Database and find un-used replicas? Do you not know the DSN credentials when you set up the ODBC connection? Was it not documented?
    If not, then I do not know if there is a way to crowbar that password information out. Do you have access to the SQL database via Management studio? There are possibly a few options:
    1)  You could create a NEW user who has permissions on the composer DB and create a NEW ODBC DSN and use this user and password to access the database from the same server using the sviconfig. You are just providing another way of access the same database really without interupting the existing composer connection.
    2) You could try resetting the password on the account (and update the ODBC connection on the composer server) - I'd stop the composer service first and then edit ODBC and then resume composer and check everything works!
    3) Try and find the information of your account (who set it up?) as this would be the best way moving forward.
    My preferred options would be to try 3, 1  and finally 2. I'd always recommend testing things like this in a development environment first so you can really understand the impact/consequence to what you are doing.
    Happy to help!

  • Access modifiers ignored !?!

    Hi
    please, have a look at the code below and let me know your opinions
    // ------------- source file 1 ------------------------
    package pckg1;
    public class Dog {
         final public static void main (String[] args) {
              pckg2.Puppy puppy = new pckg2.Puppy("Spot");
              System.out.println(puppy.getName());
    // ------------- source file 2 --------------------
    package pckg2;
    class Puppy {
         String name;
         public Puppy(String name) {
              this.name = name;
         String getName() {return name;}
    Each class belongs to a different package. Obviously if you compile Puppy first and attempt compiling Dog the compiler will complain about several things (class Puppy not being public, method getName() not being public, etc...).
    Now,
    if you change the Puppy class so that the necessary bits are public, re-compile Puppy and then Dog it will work.
    When you subsequently go back to Puppy and remove the added public access modifiers and re-compile JUST the Puppy class and try running Dog IT WILL STILL WORK AS IF EVERYTHING IN THE PUPPY CLASS WERE PUBLIC.
    I don't thing this is right. If the access modifiers cannot be relied on then the whole system is flawed.
    PS: Running on W2K, the behaviour observed on JRE 1.2.2_007, 1.3.0_02 as well as on 1.4.0-beta-b65.
    Cheers
    Ales Krestan

    Thanks for the response, but I hold different views on the matter. Although performance surely is of a great importance, it should not come at the expense of consistency.
    A few more thoughts on the same:
    1/ my understanding is that it is responsibility of the class loader to decide what to do in such cases during the resolution case. Apparently the application class loader of SUN's JVM ignores it and so does the extension class loader of the same JVM.
    2/ surprisingly (or rather expectedly) when attempting to load both classes (with the dodged version of Puppy) using the system class loader the JVM throws java.lang.IllegalAccessError.
    3) the same trick cannot be done with an interface. If you try to dodge an interface using the same principle and try to load it using the application class loader JVM will refuse to run (or load) the class that uses the dodged interface.
    4/ the class loader DOES other things, so why not to check the access modifiers as well. It should check if the class can be instantiated, for example. See the section 2.17.3 Linking: Verification, Preparation, and Resolution of the JVM specification.

  • [svn:fx-trunk] 12001: Make List itemEditor work with FTETextInput via textInputClass style and remove unused _itemEditor from Tree .

    Revision: 12001
    Revision: 12001
    Author:   [email protected]
    Date:     2009-11-19 11:47:24 -0800 (Thu, 19 Nov 2009)
    Log Message:
    Make List itemEditor work with FTETextInput via textInputClass style and remove unused _itemEditor from Tree.
    QE notes:
    Doc notes:
    Bugs: SDK24172
    Reviewer: Gordon
    Tests run: checkintests, list tests
    Is noteworthy for integration: no
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/List.as
        flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Tree.as
        flex/sdk/trunk/frameworks/projects/spark/MXFTEText.css

    This is a duplicate post.  This should be locked to avoid further confusion.
    My CSS wont change
    Nancy O.

  • Default/package/none access modifier

    Hi,
    I was hoping for some discussion on the default/package/none access modifier. It's always really bugged me that we have public, private, protected, and then "none", while it seems to me that it would be less confusing, and more consistent to use the keyword "package", or maybe even "default".
    Then, source code would look like
    public class MyClass{
        public int getValue() {}
        private void setValue() {}
        protected void someMethod() {}
        package int justForPackage() {}
    }I know this concept has come up before, but the books I've read which mention this topic haven't offered any actaul justification/explanation for why there isn't some keyword.
    Anyway, are there any insights as to why java is this way, and any reasons why java should or shouldn't be changed to include the package access modifier.

    A good example is within a tightly grouped package (usually should be this way) you may have some cooperative classes that access methods.
    // one .java file
    public class SomeHelper {
       private void method() {
         new ClassForUsers().accessHiddenLogic();
    // next .java file in same package
    public ClassForUsers {
        /* default-access */ void accessHiddenLogic() {
    }But, you may want to allow users to subclass your ClassForUsers, without giving them access to the hidden logic method directly:
    // another .java file in a different package
    public class UsersSubclass extends ClassForUsers {
        public void userMethod() {
            // can't do this
            accessHiddenLogic();
    }This could be for either business logic or security reasons. So, package level access can be very useful. However, I've seen that in practice it is avoided because it isn't obvious what is going on.

  • IDCS6 MACOSX JS: "remove unused layer" script doesn't see masters based on masters

    Hello everybody.
    I have an old script that I have used many times to remove unused layers. Until today I thought it worked well:
    var layers = app.documents[0].layers.everyItem().getElements();
    for(var i=layers.length-1;i>=0;i--){
      if(layers[i].pageItems.length==0){
        layers[i].remove();
    However, today I used the script on a document that had a layer that was only ever used once on a master page that the other master pages were based upon. To my surprise, when the script was run, this specific layer was deleted.
    my scripting knowledge is poor, but looking at the script it looks like the script is looking at all layers that have anything in them, and any layer that has no item is to be deleted. however, I think that pageItems only refers to regular pages or master pages, not masters BASED ON other masters.
    I think the problem is similar to another that I had recently where I had a script that removed unused masters, but removed masters that other masters were based on, and I think the principles are the same. That thread can be found at:
    http://forums.adobe.com/message/5922004#5922004
    in short, the script that worked there was as follows:
    xUnusedMasters(myDoc);
    function xUnusedMasters( docRef ) {
    var mpNames = new Object () ;
    var allPages = docRef.pages ;
    for ( var pIndex = allPages.length - 1 ; pIndex >= 0 ; pIndex-- ) {
    mpNames = addMasterName ( mpNames , allPages[pIndex] ) ;
    var allMasterPages = docRef.masterSpreads ;
    for ( var mpIndex = allMasterPages.length - 1 ; mpIndex >= 0 ; mpIndex-- ) {
    if ( ! mpNames[allMasterPages[mpIndex].name] ) {
    allMasterPages[mpIndex].remove() ;
    return ;
    function addMasterName ( MPDB , pageRef ) {
    if ( pageRef == null ) { return MPDB ; }
    if ( pageRef.constructor.name == 'MasterSpread' ) {
    MPDB[pageRef.name] = true ;
    return addMasterName ( MPDB , pageRef.appliedMaster ) ;
    is it possible to modify the above script so that instead of removing unused master pages, it removes unused layers in a similar fashion?
    Many thanks,
    Colly

    Hi,
    Maybe a little bit different way...:
    Array.prototype.filter = function(collection) {
              var k, i, con, ids = collection.everyItem().id;
              con: for (k = ids.length - 1; k >=0; k--)
                        for (i = 0; i < this.length; i++)
                        if (this[i].id == ids[k]) {
                             ids.splice(k, 1);
                             continue con;
              return ids;     // array with unmatched ids from collection
    var
              mL = app.activeDocument.pageItems.everyItem().itemLayer,
              mUnusedLayersID = mL.filter(app.activeDocument.layers),
              len = mUnusedLayersID.length;
    while (len-->0)
              app.activeDocument.layers.itemByID(mUnusedLayersID[len]).remove();
    mL is an array with each pageItem's layer;
    filter compares it to doc.layers collections;
    unmatched means unused so are removed.
    Jarek

  • Be abble to automatically remove unused resultLists, after onTheFly reporting, onTheFly DB writing ...

    Hello,
    If you get memory problems, you had to tune your reports options, result collecting, load / unload modules  .... 
    These tasks are very long, you have to point all memory consumers first ... It pollutes your test sequence only for memory purposes ! 
    When you try to modify the result reccording, you will also have problems for your report generation ... 
    It should be nice to add a new feature allowing an automatic result list removing, after onTheFly reporting, ontheFly database writing have treted them ...
    A kind of "OnTheFly and remove unused results"
    When ontheFly reporting, and The OnTheFly database writing are over, the treated resultList should be put in a garbage structure !
    Older test results could be removed if memory is needed ... 
    I know this could be not simple ... but this could help very much, for big sequences creation. 
    Thanks a lot.
    Manu.net (TestStand memory dustman !)
     

    Guys, I think I've found the strange thing.
    First, in the recovery shell, when I type "lvm lvscan", it prints:
    WARNING: lvmetad is running but disabled. Restart lvmetad before enabling it!
    and then it says that all four my logical volumes root,boot,home and var are inactive.
    So I tried to set them up manually, with "lvm vgchange -a y", and guess what happened: I was able to boot!
    I still haven't managed to understand the real causes of this problem, but basically it seems that I have the same problem explained here: https://bbs.archlinux.org/viewtopic.php?id=184340.
    The only difference is that there the OP says to have solved the problem with an upgrade to Linux 3.15.7, while it appeared to me with the upgrade to 3.18.3, and as I said it doesn't go away neither with a downgrade nor with another upgrade to version 3.18.4
    Last edited by rdm (2015-01-29 21:55:44)

  • How to remove unused objects from the webcatalog In OBIEE11g

    Hi,
    I want to delete unused objects from obiee11g catalog, i know in obiee10g it's working fine (i.e: we can do it via manage catalog then delete the unused objects) is there any way to do it automatically like RPD utility --->removing unused objects from Physical layer in RPD
    fyi: I don't want to delete manualy. i need somethink like button/link to find unused objects(report,filter,folder..etc) from my obiee11g catalog.
    Thanks
    Deva
    Edited by: Devarasu on Nov 29, 2011 12:06 PM
    Edited by: Devarasu on Nov 29, 2011 3:15 PM

    Hi,
    Checked with Oracle Support team and confirmed below points
    --> incorporated into the Current product and consider as BUG it may resolve future release
    --> Currently there isnt any automatic method to remove the unused objects like reports, filters,folder etc from catalog.
    Treated as Bug
    Bug 13440888 - AUTOMATICALLY REMOVE OF UNUSED CATALOG OBJECTS FROM WEBCATALOG
    FYI:
    SR 3-4984291131: How to remove unused objects from the webcatalog in obiee11g
    Thanks
    Deva

  • Removing unused IDOC fields

    Hi All ,
    Removing unused IDOC fields using an XSLT editor is possible? If so, we can import them the IDOC as XSD correct? What will be the immediate benefit of such a tweak?
    Thanks
    XA

    Hi,
    When the Idoc definition itself is huge enough to cause the XI message mapping
    editor to consume a lot of memory and at times even end up giving an Out of Memory error, only while displaying
    the mapping. SAP recommends that a Reduced XSD feature provided by the Integration repository should be
    used in place of actual Idoc structure to avoid memory issues.
    If it is imported as an IDoc and used thereafter directly in mapping still results into an XSD of
    around more than 3 MB and causes trouble during opening of the mapping and also gives errors during mapping
    edit leaving the work in a vulnerable state.
    To overcome issues in the design editor to a considerable extent by using Reduced XSDs.
    you can find more details in Note # 709400.
    Regards,
    Harish

  • Remote Desktop Services Properties - Operation failed: Access is denied

    Hi
    when i try to change the Remote Desktop Services User Profile Path with ADUC i get the error "Operation failed: Access is denied"
    This error occurs in a subdomain with the Domain Admin of the Subdomain. I'm able to change this attribute with the Enterprise Admin.
    As far as I understand this attribute is set in the userParameters but I don't know what permissions must be set to allow the Domain Admin to change this Attribute and why the Enterprise Admin is allowed to change the Attribute and the subdomain Admin not.
    Our AD Schema is 2003.

    Hi,
    As per I know, this is by design because enterprise admin has full control in every domain within the forest but sub domain admin only has full control in its own domain. SO when subdomain admin try to modify they receive error instead of enterprise admin.
    But still if you want to assign the permission to subdomain user to change then you can delegate below permission to user.
    Read msTSProfilePath
    Write msTSProfilePath
    Snap:
    Hope it helps!
    Thanks.
    Dharmesh Solanki
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Removing unused media from Sequence cause crashing

    I am trying to remove unused media from projects prior to archiving to free up/clean up finished projects. Each project I have tried to do this with I am having the program close during process. Then when I try to reopen project it will not open and keeps crashing. Firstly are these project now corrupt, and can I still archive them somehow or get the project back?? Please help as the projects I have tried to do this with aren't of huge importance but I do need to try to clean up and archive others that are.

    It is safe to use the media manager...
    Check your hard drive for space...for 30 mins means you'll need at least another 6.5 GB of free space... make it 8GB to be safe...
    In media manager (NOTE : also read the manual carefully) use the COPY option...
    Using COPY, ensure the 'duplicate selected items and place into a new project' box IS ticked, this will set up a completely new project and folder, containing ONLY EVERYTHING you have in your 30 min sequence... and will not delete or change anything from the origonal... If you go to the new folder you'll see another folder called 'media'... this will contain all the clips etc.
    Then, open up the new COPIED project, watch it to check it's ok... if it's cool (which it should be) then you now have a completely independant project that is nothing to do with the origonal... and contains only used media.
    Then, open up final cut pro docs>capture scratch> 'project name' and you can simply delete ALL your old media manually, knowing that everything you need is now in a new folder elsewhere....
    Of course, this only works if you have that little bit of extra space left on your drive for the new media to be copied to... but i find it's the safest, and easiest way of removing unused media.

  • [svn] 3817: Remove unused file, SandboxBridgeGroup.as.

    Revision: 3817
    Author: [email protected]
    Date: 2008-10-22 10:49:10 -0700 (Wed, 22 Oct 2008)
    Log Message:
    Remove unused file, SandboxBridgeGroup.as.
    QE Notes: None
    Doc Notes: None
    Bugs: SDK-17721
    Reviewer: pfarland
    tests: checkintests
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-17721
    Removed Paths:
    flex/sdk/branches/3.2.0/frameworks/projects/framework/src/mx/core/SandboxBridgeGroup.as

    From The Bin, Hit EDIT, then click Select Unused. Is That what you are looking for?

  • [svn:osmf:] 10528: Removing obsolete import statements.

    Revision: 10528
    Author:   [email protected]
    Date:     2009-09-23 02:47:21 -0700 (Wed, 23 Sep 2009)
    Log Message:
    Removing obsolete import statements.
    Modified Paths:
        osmf/trunk/framework/MediaFramework/org/openvideoplayer/media/IContainerGateway.as
        osmf/trunk/framework/MediaFramework/org/openvideoplayer/media/IMediaGateway.as

Maybe you are looking for

  • How can I delete an E-Mail account in Nokia 6300

    I have setup an E-Mail account (e.g Gmail) on my Nokia 6300. I would like to delete this account which is no longer needed. I couldn't find any delete option there. Before Nokia 6300, I have used Nokia E-50. It has a very simple option in Connect fol

  • Problem with my X7-00 display

    Hi guys, I have big problem with my X7-00 display... like it has been magnetized, but I'm not sure is that even possible. It is discolored, like on old CRT television displays. Any ideas?

  • Multi File Find/Replace: XP

    Good afternoon, When trying to do a find and replace (or just a find) across multiple files, HS is no longer working. It will not find any instances of the search string in any document. If the search is done on a single document, then it does indeed

  • Error message in Freehand 9.0.2

    I am running FreeHand 9.0.2 on a windows 2000 pro machine. All of a sudden I am getting 'Could not complete your request because an unknown command was encountered' when I try to open new and existing files. I would be grateful for any ideas.

  • What are function modules used in alv,and its explanation

    what are function modules used in alv,and its explanation