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 7564171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:50:55+00:00 2026-05-30T13:50:55+00:00

Given a start position, I can find a node by passing it to org.eclipse.jdt.core.dom.NodeFinder

  • 0

Given a start position, I can find a node by passing it to org.eclipse.jdt.core.dom.NodeFinder class.

NodeFinder node = new NodeFinder(root, m.getSourceStart(), m.getSourceEnd() - m.getSourceStart() + 1);
ASTNode n = node.getCoveredNode();

Let assume that this node has a parent and get the node’s parent n.getParent(); does anyone know why it prints out the parent node and the node?

For instance we know the starting point of foo() in bar.foo() so if I do System.Out.Println(n.getParent().toString()); it prints bar.foo(). Shouldn’t it print only bar?

Thanks in advance for your insight.

  • 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-05-30T13:50:56+00:00Added an answer on May 30, 2026 at 1:50 pm

    The behavior you are seeing is expected.

    In this example:

    foo.bar
    

    bar is a SimpleName and its parent is a QualifiedName that contains both foo and bar. So the parent node will contain more than one AST node and calling toString on it will print out all of this node’s children.

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

Sidebar

Related Questions

Given the code: new Thread(new BackgroundWorker()).start(); Intuitively it feels like the BackgroundWorker instance should
In an given Android activity, I would like to start a new activity for
how do I compute the business days in a week given the parameters: start
Given the following Contribution model: class Contribution(models.Model): start_time = models.DateTimeField() end_time = models.DateTimeField(null=True) is
Given the code below ... Net::HTTP.start('localhost', 4000) do |http| # # usual stuff omitted
Given just a std::string iterator, is it possible to determine the start and end
I need to determine if a given selection is in between a start line
I'm working on a tool that will find the closest latitude/longitude position from a
I have a code below that try to identify the position of start and
How can I get the start and end positions of all matches using the

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.