|
Link Here
|
| 1722 |
"}\n" |
1722 |
"}\n" |
| 1723 |
); |
1723 |
); |
| 1724 |
} |
1724 |
} |
|
|
1725 |
|
| 1726 |
/** |
| 1727 |
* @bug 239719: [formatter] Code formatter destroys pre formatted javadoc comments |
| 1728 |
* @test Ensure that annotations inside <pre>...</pre> tags are not considered as javadoc tags |
| 1729 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=239719" |
| 1730 |
*/ |
| 1731 |
public void testBug239719() throws JavaModelException { |
| 1732 |
String source = |
| 1733 |
"/**\n" + |
| 1734 |
" * <pre>\n" + |
| 1735 |
" * public class Test implements Runnable\n" + |
| 1736 |
" * {\n" + |
| 1737 |
" * @Override\n" + |
| 1738 |
" * public void run()\n" + |
| 1739 |
" * { \n" + |
| 1740 |
" * // Hello really bad Ganymede formatter !!!\n" + |
| 1741 |
" * // Shit happens when somebody tries to change a running system\n" + |
| 1742 |
" * System.out.println(\"Press Shift+Ctrl+F to format\");\n" + |
| 1743 |
" * }\n" + |
| 1744 |
" * }</pre>\n" + |
| 1745 |
" */\n" + |
| 1746 |
" public class Test \n" + |
| 1747 |
" {\n" + |
| 1748 |
" }\n"; |
| 1749 |
formatSource(source, |
| 1750 |
"/**\n" + |
| 1751 |
" * <pre>\n" + |
| 1752 |
" * public class Test implements Runnable {\n" + |
| 1753 |
" * @Override\n" + |
| 1754 |
" * public void run() {\n" + |
| 1755 |
" * // Hello really bad Ganymede formatter !!!\n" + |
| 1756 |
" * // Shit happens when somebody tries to change a running system\n" + |
| 1757 |
" * System.out.println("Press Shift+Ctrl+F to format");\n" + |
| 1758 |
" * }\n" + |
| 1759 |
" * }\n" + |
| 1760 |
" * </pre>\n" + |
| 1761 |
" */\n" + |
| 1762 |
"public class Test {\n" + |
| 1763 |
"}\n" |
| 1764 |
); |
| 1765 |
} |
| 1766 |
public void testBug239719b() throws JavaModelException { |
| 1767 |
String source = |
| 1768 |
"public class X01 {\n" + |
| 1769 |
" \n" + |
| 1770 |
" private int fLength;\n" + |
| 1771 |
" private int fOffset;\n" + |
| 1772 |
"\n" + |
| 1773 |
" /**\n" + |
| 1774 |
" * Returns the inclusive end position of this edit. The inclusive end\n" + |
| 1775 |
" * position denotes the last character of the region manipulated by\n" + |
| 1776 |
" * this edit. The returned value is the result of the following\n" + |
| 1777 |
" * calculation:\n" + |
| 1778 |
" * <pre>\n" + |
| 1779 |
" * getOffset() + getLength() - 1;\n" + |
| 1780 |
" * <pre>\n" + |
| 1781 |
" * \n" + |
| 1782 |
" * @return the inclusive end position\n" + |
| 1783 |
" */\n" + |
| 1784 |
" public final int getInclusiveEnd() {\n" + |
| 1785 |
" return fOffset + fLength - 1;\n" + |
| 1786 |
" }\n" + |
| 1787 |
"}\n"; |
| 1788 |
formatSource(source, |
| 1789 |
"public class X01 {\n" + |
| 1790 |
"\n" + |
| 1791 |
" private int fLength;\n" + |
| 1792 |
" private int fOffset;\n" + |
| 1793 |
"\n" + |
| 1794 |
" /**\n" + |
| 1795 |
" * Returns the inclusive end position of this edit. The inclusive end\n" + |
| 1796 |
" * position denotes the last character of the region manipulated by this\n" + |
| 1797 |
" * edit. The returned value is the result of the following calculation:\n" + |
| 1798 |
" * \n" + |
| 1799 |
" * <pre>\n" + |
| 1800 |
" * getOffset() + getLength() - 1;\n" + |
| 1801 |
" * \n" + |
| 1802 |
" * <pre>\n" + |
| 1803 |
" * \n" + |
| 1804 |
" * @return the inclusive end position\n" + |
| 1805 |
" */\n" + |
| 1806 |
" public final int getInclusiveEnd() {\n" + |
| 1807 |
" return fOffset + fLength - 1;\n" + |
| 1808 |
" }\n" + |
| 1809 |
"}\n" |
| 1810 |
); |
| 1811 |
} |
| 1725 |
} |
1812 |
} |