UnusedPrivateMethod - bug when using static private method?

Hi,
I get the following violation:UnusedPrivateMethod. This private method (createDefaultSolidColors) does not seem to be used.
For the foloowing code snippet:
private  static const defaultSolidColors:Array = createDefaultSolidColors(); 
private static function createDefaultSolidColors():Array { 
     var _a:Array = new Array(); 
     for each (var color:uint in defaultColors) {          _a.push(
new SolidColor(color, 0.8));     }
     return _a;}
Why is it a violation? the function is used by the defaultSolidColors property.
Is it a bug or am I missing something?
Thanks,
-ilan

This is a known issue, which has been fixed on trunk.
The fix will be in the next release:
https://bugs.adobe.com/jira/browse/FLEXPMD-173

Similar Messages

  • Use of private methods

    Can someone tell me when a java program would use private methods? I understand that use of private instance variables is the norm and when extending a class, the use of the public methods is required to access the data. But when would it be necessary to use a private method? Thanks.

    Okay, so you create a class. And some other class uses that class.
    public class Useful {
      public void doSomethingUseful() {
    public class User {
      // Use a Useful to do something useful
      Useful u = new Useful();
      u.doSomethingUseful();
    }Now, you could put a whole bunch of krap into the single doSomethingUseful method, or you could be smart and break its work down into smaller methods, which each method having it's own responsibility. Those methods would be private, because there's no reason to expose the implementation details of the public method.

  • Bug when using JComboBox as JTable CellEditor

    Hello! I have a JTable that displays database information, and one of the columns is editable using a JComboBox. When the user selects an item from the JComboBox, the database (and consequently the JTable) is updated with the new value.
    Everything works fine except for a serious and subtle bug. To explain what happens, here is an example. If Row 1 has the value "ABC" and the user selects the editable column on that row, the JComboBox drops down with the existing value "ABC" already selected (this is the default behavior, not something I implemented). Now, if the user does not select a new value from the JComboBox, and instead selects the editable column on Row 2 that contains "XYZ", Row 1 gets updated to contain "XYZ"!
    The reason that is happening is because I'm updating the database by responding to the ActionListener.actionPerformed event in the JComboBox, and when a new row is selected, the actionPerformed event gets fired BEFORE the JTable's selected row index gets updated. So the old row gets updated with the new row's information, even though the user never actually selected a new item in the JComboBox.
    If I use ItemListener.itemStateChanged instead, I get the same results. If I use MouseListener.mousePressed/Released I get no events at all for the JComboBox list selection. If anyone else has encountered this problem and found a workaround, I would very much appreciate knowing what you did. Here are the relavent code snippets:
    // In the dialog containing JTable:
    JComboBox cboRouteType = new JComboBox(new String[]{"ABC", "XYZ"));
    cboRouteType.addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent ev) {
              doCboRouteTypeSelect((String)cboRouteType.getSelectedItem());
    private void doCboRouteTypeSelect(String selItem) {
         final RouteEntry selRoute = tblRoutes.getSelectedRoute();
         if (selRoute == null) { return; }
         RouteType newType = RouteType.fromString(selItem);
         // Only update the database if the value was actually changed.
         if (selRoute.getRouteType() == newType) { return; }
         RouteType oldType = selRoute.getRouteType();
         selRoute.setRouteType(newType);
         // (update the db below)
    // In the JTable:
    public RouteEntry getSelectedRoute() {
         int selIndx = getSelectedRow();
         if (selIndx < 0) return null;
         return model.getRouteAt(selIndx);
    // In the TableModel:
    private Vector<RouteEntry> vRoutes = new Vector<RouteEntry>();
    public RouteEntry getRouteAt(int indx) { return vRoutes.get(indx); }

    Update: I was able to resolve this issue. In case anyone is curious, the problem was caused by using the actionPerformed method in the first place. Apparently when the JComboBox is used as a table cell editor, it calls setValueAt on my table model and that's where I'm supposed to respond to the selection.
    Obviously the table itself shouldn't be responsible for database updates, so I had to create a CellEditListener interface and implement it from the class that actually does the DB update in a thread and is capable of reporting SQL exceptions to the user. All that work just to let the user update the table/database with a dropdown. Sheesh!

  • REP-0069 error when using static includes.

    I am trying to use static include files in my report JSP file. Such as...
    <%@ include file="ServerName.jsp" %>
    Although they seem to work when I run the report, Report Builder doesn't like them. When I open the report in Report Builder I get an REP-0069 error. When I then try to display the data model it is blank. If I remove the static include the report opens fine. Beans also have this same problem.
    Dynamic includes don't generate an message. However, scriptlette variables set in the included file are not visiable to the including file.
    Jim

    Hi Jim
    I tried this with Reports 9.0.2 latest patch. When a open a .jsp report where I have put a statis include tag, I get a builder crash. I am filing a bug on this. Please let me know your mail address, I would update you once the issue is resolved.
    Thanks
    Rohit
    Oracle Reports Team

  • BPC Office Client : No data retrieval when using static dimensions

    Hello,
    We have used static dimensions to build reports / input schedules, but the data range remains empty when refreshing the workbook after the column - and row key ranges have been filled. There is definitely data in the application for the combination of the current view members and range members chosen. I have put 3 dimensions in the row key range and 4 dimensions in the column key range.
    What are the common solutions for this problem ? I don't receive any errors while refreshing the workbook.

    Have you checked security member access profiles to know that the user has access to that slice of data?
    You might also double-check your data in BW by running the Shared Query Engine test program UJQ_SQE_TEST from transaction SA38 or SE38.  Just select your AppSet and Application, along with matching in the filters the static members you've set in your report.
    If you still have issue, try to replicate the issue with a delivered template report and confirm no data is shown.
    Otherwise, please create a customer [message|http://service.sap.com/message] in the SAP Service Marketplace and report your issue as a potential bug. To expedite a solution it would be helpful if you detail the steps exactly for the Support team to recreate, verify and troubleshoot the problem.
    Best regards,
    [Jeffrey Holdeman|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/profile/jeffrey+holdeman]
    SAP BusinessObjects
    Enterprise Performance Management
    Regional Implementation Group

  • There is no printer output when using the PrintOut method

    I have a VB6 app with CR XI, and a customer found a situation that when printing a report directly to the printer using the PrintOut method, there is no printer output or error message.
    Some reports using the same code print normally, but a report that is preceded by another print call, presents this behavior.
    And when the output is directed to the screen, we can see the report.
    Could someone give me an idea of what is the problem?
    Thanks,
    Isis
    SP - Brazil
    The code used is below:
                       Set rpt = applic.OpenReport(App.Path & "SEFoto" + TipoRPT + ".rpt")
                       rpt.FormulaSyntax = crCrystalSyntaxFormula
                       rpt.FormulaFields.GetItemByName("Empresa").Text = "'" + Company + "'"
                       rpt.FormulaFields.GetItemByName("Idioma").Text = "'" + Idioma + "'"
                       rpt.FormulaFields.GetItemByName("Versao").Text = "'" + Versao + "'"
                       ' ... Some lines to compose the selection formula
                       rpt.RecordSelectionFormula = Cond
                       ' To evaluate the image length:
                       Arq = rsTMP3!FT_Arquivo
                       ImageScaling = FatorDeReducao(Arq, "F")
                       ' To reduce the image length:
                       AchouOLE = False
                       For Each oSection In rpt.Sections
                           For Each oObject In oSection.ReportObjects
                               If oObject.Name = "PictureFoto" Then
                                  Set oOleObject = oObject
                                  AchouOLE = True
                                  Exit For
                               End If
                           Next oObject
                           If AchouOLE Then Exit For
                       Next oSection
                       With oOleObject
                            .Suppress = True
                            .XScaling = ImageScaling    ' 0.5 = 50%, 1 = 100%
                            .YScaling = ImageScaling
                            .Suppress = False
                       End With
                       Aguarde.Show 1
                       If DestinoRel = 9 Or DestinoRel = 1 Then ' Padrão ou impressora
                          rpt.PrintOut True              ' <<<---- Here using true or false nothing happens
                       Else
                          PrintRPTtela rpt, "Fotos"   ' <<<--- Here it works fine
                       End If

    Hi Isis,
    Not sure if you have applied any service Packs to CR? If please do so and test again. Then you can upgrade to CR XI R2 for free, use your XI Keycode and download Service Pack 4 from this link:
    https://smpdl.sap-ag.de/~sapidp/012002523100011802732008E/crxir2_sp4_full_build.exe
    You'll find the distribution files for your app also from that same download area.
    If you don't want to upgrade to XI R2 then download all patches from XI and test again. This issues rings a bell that it may have been fixed.
    Thank you
    Don

  • Bug when using IBOT

    Hi all,
    has anyone had this kind of error?
    I am using IBOT, and I set Schedule_ to Start Date=21/09/2009, Time of Day=08:00, Set Time Zone=GMT+01:01, and Recurrence_ to Every 1 week(s) on  MON.
    When I look overview of this IBOT, everything is fine, but when I go Show IBOTs acting on my behalf Next Run is not date that I had set. And IBOT is not running in time that he should. But when I set Recurrence_ Daily Every 7 day(s) every thing is OK. IBOT is running and Next Run shows correct date and time.
    Thanks

    This looks the same as bug 5539348 "Schedule an iBot to run immediately and weekly, the immediate run doesn't take place". According to that bug when you say start immediately and run every 1 week you are actually saying start the schedule now not start the ibot?! So a schedule is created in the scheduler to run your ibot every week on Mon but it does not run it immediately.
    I think this is a bug with the weekly schedule though as setting it to 7 days seems to fix it. The bug database seems in infer that later releases of 10g fixed this problem so it might be worth upgrading to a newer patch release if it becomes a problem and seeing if this fixes it.

  • Data refresh bug when using inheritance?

    I am getting unexpected behaviour when using the pm.refresh(Object) method.
    Refresh works correctly and reloads data if the lock has been updated on
    tables/objects with no inheritance. However, if I try to use refresh on an
    object that is part of an inheritance hierarchy, the query that is executed
    to get the jdolockx value is missing the table join.
    Example:
    Table Entity
    id
    displayname
    jdolockx
    jdoclassx
    Table Individual (inherits from Entity)
    id
    firstName
    lastName
    jdolockx
    Query executed when calling refresh and passing in Individual
    SELECT
    t0.JDOLOCKX
    FROM
    ENTITY t0,
    INDIVIDUAL t1
    WHERE
    t1.ID = 1151
    Problem
    Missing crucial join t1.ID = t0.ID
    These classes work correctly with correct SQL when inserting/selecting.
    Any help is greatly appreciated.
    Regards
    Nathan Boyes

    Sorry, forgot to mention Kodo version
    Kodo 2.5.3
    SQLServer2000
    "nathan boyes" <[email protected]> wrote in message
    news:bmj215$qq3$[email protected]..
    I am getting unexpected behaviour when using the pm.refresh(Object)method.
    Refresh works correctly and reloads data if the lock has been updated on
    tables/objects with no inheritance. However, if I try to use refresh onan
    object that is part of an inheritance hierarchy, the query that isexecuted
    to get the jdolockx value is missing the table join.
    Example:
    Table Entity
    id
    displayname
    jdolockx
    jdoclassx
    Table Individual (inherits from Entity)
    id
    firstName
    lastName
    jdolockx
    Query executed when calling refresh and passing in Individual
    SELECT
    t0.JDOLOCKX
    FROM
    ENTITY t0,
    INDIVIDUAL t1
    WHERE
    t1.ID = 1151
    Problem
    Missing crucial join t1.ID = t0.ID
    These classes work correctly with correct SQL when inserting/selecting.
    Any help is greatly appreciated.
    Regards
    Nathan Boyes

  • Potential bug when using Parsley 2.4.1 and Cairngorm's module 0.17 in Flex 4.5.1

    Hi
    I have an issue when using cairngorm's ModuleViewLoader along with ParsleyModuleDescriptor to load a simple module consistig mainly of HBoxes, VBoxes and Datagrids.
    The module consists of one child (let's call it ViewA) and that child consists of several children as its components.
    When I use cairngorm's ModuleViewLoader along with the ParsleyModuleDescriptor and Parlsey to inject the modulemanager in my main app, the module loads, as well as ViewA but some nearly all of ViewA's children are not loaded (in fact they're initialized but creationComplete is not invoked).
    When I use Flex's mx:ModuleLoader all ViewA's chikldren are initialized and creation complete is also invoked.
    I will attach the source as a zip file  later on....
    but for now...this is all I can give http://dpaste.com/713503/
    Thanks
    Andreas

    Did you ever find an answer to this?  I am running into the same issue with needing to upgrade parsley to 2.4.x, but with parts of application heavily relying on cairngorm module, upgrading it from module-0.11 to 0.17 seems to break compile! 

  • How to specify term file when using static html to run webforms 10g

    I'm using static HTML to run forms
    document.writeln('<PARAM NAME="serverArgs" ');
    document.writeln(' VALUE="escapeParams=true module=genoa.fmx userid= sso_userid=%20 sso_formsid= sso_subDN= sso_usrDN= debug=no host= port= term=/forms90/hsd65html/genoa.res"> ');
    I'm specifying the term as term=/forms90/hsd65html/genoa.res.
    During forms startup I get the message unable to read the file. I can bwoense the file by http://server/forms90/hsd65html/genoa.res
    Any idea how to specify the term file in static html.
    Thanks

    term is not a http address, but a directory address. So, you have to specify the path on the server:
    term=c:\oracle\forms90\.....

  • Strange UI bug when using People view/face recognition

    I've started playing with the face recognition in LR6/CC and have encountered an odd display bug when viewing the groups of 'named people':
    The thumbnail for each named person includes a count of how many images (or perhaps that should be faces) are attributed to their specific name. However, once the number of images for a person exceeds 100, LR only displays the first two digits in the thumbnail and drops off the third one, e.g. 254 is displayed as 25. If you hover over the thumbnail, the full count (e.g. 254) is displayed so long as the mouse cursor is kept on the thumbnail. Interestingly, once the number of images attributed to a named person exceeds 1000, it does the same thing, only it adds an extra digit (so 1400 becomes 140).
    I'm running this on Win7.
    Anyone else seeing this?
    M

    I guess I was primarily "testing the water" to see if the problem was specific to my configuration in some way, but you make a fair point John.
    Here's my (possible) bug report: LIGHTROOM Facial recognition: thumbnails not displaying full number
    M

  • Error occurs when using DBDataSource.SetValue method in sales order

    Is it possiable to use the DBDataSource.SetValue method to update a cell in the Sales Order document
    My code , but I am getting an error
    Dim oDBDataSource As SAPbouiCOM.DBDataSource
    oDBDataSource = oform.DataSources.DBDataSources.Item("RDR1")
    oDBDataSource.SetValue("Price", 1, "111.22")
    The following code works, but I do not want to use it because the cursor need to move to  the cell before changing the value.
    oMatrix.Columns.Item("14").Cells.Item(RowNum).Specific.value = 111.22
    Sincerely yours
    Riade Asleh

    Well , I do not want to do it this way
    I want to change the value using the setvalue method of the DBDatasource Object
    I want to avoid the cursor from going to the cell for update or read.
    Refer to orignal question (first question)
    Sincerely yours
    Riade Asleh

  • Call to a possibly undefined method displays when using static function in Unit Test

    Hello!
    This has been driving me nuts. I am setting up unit tests for a static class which manages a collection of songs. This is how my unit test class looks:
    //START CODE
    package flexUnitTests {
              import com.myapp.managers.MusicManager;
              import flash.utils.Dictionary;
              import flexunit.framework.Assert;
              public class MyAppManagerTest {
                        [Before]
                        public function setUp():void {
                                  var songData:Dictionary = new Dictionary();
                                  songData["mn0012345"] = new Dictionary();
                                  songData["mn0012345"]["title"] = "All the Pretty Little Horses";
                                  songData["mn0012345"]["description"] = "by: American Traditional | Voice, Piano | 3 pages";
                                  MusicManager.setSongData(songData);
                        [Test]
                        public function test_getAuthorsBySKU():void {
                                  var expected:String = "American Traditional";
                                  var given:String = MusicManager.getAuthorsBySKU("mn0012345");
                                  Assert.assertEquals(expected, given);
    //END OF CODE
    You will notice two calls in red above. When I leave them in the code I see a variety of errors which look like this:
    "Call to a possibly undefined method '' through a reference with a static type com.myapp..."
    And
    "Access of possible undefined property '' through a reference with static type com.myapp..."
    Then, when I comment out the two lines in red above, these errors go away. Flash Builder seems really flakey to me. Often I notice that the error list varies, how can it just no longer be an error? Where did this new access error come from, in a no related part of the code, by adding or removing a function call to a static class which remains in the import statement.
    Note that the MusicManager contains no references to any of the UI mxml that is throwing these errors. It just simply loads data into a few globals and allows you to grab info.
    How is my usage of this function making foreign objects inaccessible?
    Please help!!! I am really hoping there is an answer but I have a bad feeling the answer is just that Flash Builder is flakey.

    I did some more work on the issue above. There are functions with in the MusicManager that call the UserManager to get a user's ID. When I comment out these calls then the access errors go away. Well the user manager has some calls back to mxml that tell the class that changes where made. My best guess is this is where it stems into the code that is randomly throwing errors. But, it compiles fine and runs fine on a device. Is there something with test cases which doesn't invoke the UI?

  • Using static .values() method of Enum in Generic Class

    Hi *,
    I tried to do the following:
    public class AClass<E extends Enum<E> >  {
         public AClass() {
              E[] values = E.values(); // this DOESN'T work
              for (E e : values) { /* do something */ }
    }This is not possible. But how can I access all Enum constants if I use
    an Enum type parameter in a Generic class?
    Thanks for your help ;-) Stephan

    Here's a possible workaround. The generic class isn't adding much in this case; I originally wrote it as a static method that you simply passed the class to:
    public class Test21
      public static enum TestEnum { A, B, C };
      public static class AClass<E extends Enum<E>>
        private Class<E> clazz;
        public AClass(Class<E> _clazz)
        {  clazz = _clazz;  }
        public Class<E> getClazz()
        {  return clazz;  }
        public void printConstants()
          for (E e : clazz.getEnumConstants())
            System.out.println(e.toString());
      public static void main(String[] argv)
        AClass<TestEnum> a = new AClass<TestEnum>(TestEnum.class);
        a.printConstants();
    }

  • Bug when using a Map for SelectItems?

    Hi there,
    I think I found a pretty bad bug.... I don't think this behaviour is intended:
    I create a selectOneListbox which uses a map for storing the selectItems. The property holding the value is type compatible with the value in the map. When the component is shown, the wrong item is selected (ie NOT The one that is returned by the value property). If I use SelectItem[] for the selectItems, it works. Here is some sample code:
    The methods in the bean (managed bean with the name helloBean). The value property always returns 12 .....
      public Map getItems(){
        Map map = new HashMap();
        map.put("Hello_11", new Integer(11));
        map.put("Hello_12", new Integer(12));
        map.put("Hello_13", new Integer(13));
        map.put("Hello_14", new Integer(14));
        return map;
      public SelectItem[] getItems2(){
        SelectItem[] items = {
            new SelectItem(new Integer(11), "Hello_11"),
            new SelectItem(new Integer(12), "Hello_12"),
            new SelectItem(new Integer(13), "Hello_13"),
            new SelectItem(new Integer(14), "Hello_14"),       
        return items;
      public Integer getValue(){
        return new Integer(12);
      }..... here is how the selectOneListboxes are initialized ......
    <h:form id="helloForm">
            <h:selectOneListbox size="1" value="#{helloBean.value}">
              <f:selectItems value="#{helloBean.items}"/>
            </h:selectOneListbox>
            <h:selectOneListbox size="1" value="#{helloBean.value}">
              <f:selectItems value="#{helloBean.items2}"/>
            </h:selectOneListbox>
    </h:form>.... so both boxes refer to the same value property but their selectItems are taken from a map and a SelectItem[] array respectively. I would expect to see in both boxes the text "Hello_12", BUT:
    <select name="welcomeForm:_id0" size="1">     
         <option value="14">Hello_14</option>
         <option value="12">Hello_12</option>
         <option value="13">Hello_13</option>
         <option value="11">Hello_11</option>
    </select>
    <select name="welcomeForm:_id2" size="1">     
         <option value="11">Hello_11</option>
         <option value="12" selected="selected">Hello_12</option>
         <option value="13">Hello_13</option>
         <option value="14">Hello_14</option>
    </select>as you can see, only for the array the correct value is initially selected.
    Can anyone confirm this is a bug - or - what i would prefer tell me how to get around this?
    Thanks a lot!

    If getValue returns "12" (a String value), the situation is reversed.
    See the page 9-31 of the specification. It says:
    4. A java.util.Map where the keys are
    converted to Strings and used as labels, and
    the corresponding values are converted to
    Strings and used as values for newly
    created javax.faces.model.SelectItem
    instances. The instances are created in the
    order of the iterator over the keys provided
    by the Map.

Maybe you are looking for