Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Bug 470977: Formatter Removes Space between Assert and Unary(https://bugs.eclipse.org/bugs/show_bug.cgi?id=470977)
Bug 470977: Formatter Removes Space between Assert and Unary [message #1700764] Mon, 06 July 2015 22:01 Go to next message
Eclipse UserFriend
This is a bug I would really like to get a fix for, so I have been looking around the source myself to see if I can figure anything out.

This looks like the relevant method:
	public boolean visit(AssertStatement assertStatement, BlockScope scope) {
		
		this.scribe.printNextToken(TerminalTokens.TokenNameassert);
		this.scribe.space();
		assertStatement.assertExpression.traverse(this, scope);
		
		if (assertStatement.exceptionArgument != null) {
			this.scribe.printNextToken(TerminalTokens.TokenNameCOLON, this.preferences.insert_space_before_colon_in_assert);
			if (this.preferences.insert_space_after_colon_in_assert) {
				this.scribe.space();
			}
			assertStatement.exceptionArgument.traverse(this, scope);
		}
		this.scribe.printNextToken(TerminalTokens.TokenNameSEMICOLON, this.preferences.insert_space_before_semicolon);		
		this.scribe.printTrailingComment();
		return false;
	}


I would like to play around a bit with the code and run some tests on the formatter's behavior, but I can't figure out how to actually run any of the existing tests?

The launcher configuration launches an instance of Eclipse without the ability to create a Java project... so I have no way of running the formatter manually, either.

Are there any devs who have worked on the formatter who might be able to help me out?
Re: Bug 470977: Formatter Removes Space between Assert and Unary [message #1701050 is a reply to message #1700764] Wed, 08 July 2015 19:29 Go to previous message
Eclipse UserFriend
This code sample is from Eclipse Luna, where did you find it? Smile
Did you start with this https://wiki.eclipse.org/JDT_Core_Committer_FAQ ? A few things need updating to be honest (e.g. you need jre7, not jre4 and jre6), but it's a good place to start and you should be able to google a solution when you have a problem.

To run tests, right click on /org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunFormatterTests.java and run as JUnit plugin test.
Previous Topic:Wrong IJavaProject returned
Next Topic:Execute main class in a package from a button - Eclipse RCP
Goto Forum:
  


Current Time: Fri Apr 25 02:03:02 EDT 2025

Powered by FUDForum. Page generated in 0.02986 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top