Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9196197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:47:55+00:00 2026-06-17T21:47:55+00:00

Remove code statement from for loop block… for( UIComponent currentMenuItemComponent : menuBarComponent.getChildren() ) {

  • 0

Remove code statement from for loop block…

  for( UIComponent currentMenuItemComponent : menuBarComponent.getChildren() ) {
     String style = "";
     String selectedViewName = ( String )currentMenuItemComponent.getAttributes().get( ATTRIBUTE_View );
     logger.info( "Value of selectedViewName =" + selectedViewName );
     if( selectedViewName.equals( targetView ) ) {
        style = "selected";
        logger.info( "Value of style =" + style );
     }

I want to remove logger.info statements from for loop block. Is this possible ?

I have already used the expression

(if|else)(.*)(\r?\n)([\s-]*)(logger.info)(\( \")(.*)(\" \);) 

to remove them from if statements in Notepad++. I am looking for a way to remover from the for block

Update: If possible with a python script please help me out.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T21:47:56+00:00Added an answer on June 17, 2026 at 9:47 pm

    This is very similar to the other question you asked on locating System.out.println here: Remove System.out statements from For Loops blocks only.

    Referring to my answer, the only difference is the PMD query is different. Here is the new one:

    //ForStatement/Statement/descendant-or-self::
           Statement[./StatementExpression/PrimaryExpression/PrimaryPrefix/Name[@Image="logger.info"]]
    

    Replace the other query in the <![CDATA[ ... ]]> element in custom.xml in my answer. All other steps are the same.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I used the following code to remove script, link tags from my string, $contents='<script>inside
I need to find the mentioned lambda statement and remove it from my code.
I need a way to remove ALL using statements from code and fully qualify
I have a problem where I need to remove all code and triggers from
I am using the following code to remove a attribute from session List<User> l=(List<User>)
I have the following PHP code to remove special characters from a variable; <?php
I have following code to remove group from collection. Technically, there should be no
I have a loop statement that displays my annotations on the mapView from an
How do I remove emoji code using JavaScript? I thought I had taken care
I have realy strange behavior. I have this code (I remove unrelated code). $(function()

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.