|
Link Here
|
| 1781 |
"}\n" |
1781 |
"}\n" |
| 1782 |
); |
1782 |
); |
| 1783 |
} |
1783 |
} |
|
|
1784 |
|
| 1785 |
/** |
| 1786 |
* @bug 239719: [formatter] Code formatter destroys pre formatted javadoc comments |
| 1787 |
* @test Ensure that annotations inside <pre>...</pre> tags are not considered as javadoc tags |
| 1788 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=239719" |
| 1789 |
*/ |
| 1790 |
public void testBug239719() throws JavaModelException { |
| 1791 |
String source = |
| 1792 |
"/**\n" + |
| 1793 |
" * <pre>\n" + |
| 1794 |
" * public class Test implements Runnable\n" + |
| 1795 |
" * {\n" + |
| 1796 |
" * @Override\n" + |
| 1797 |
" * public void run()\n" + |
| 1798 |
" * { \n" + |
| 1799 |
" * // Hello really bad Ganymede formatter !!!\n" + |
| 1800 |
" * // Shit happens when somebody tries to change a running system\n" + |
| 1801 |
" * System.out.println(\"Press Shift+Ctrl+F to format\");\n" + |
| 1802 |
" * }\n" + |
| 1803 |
" * }</pre>\n" + |
| 1804 |
" */\n" + |
| 1805 |
" public class Test \n" + |
| 1806 |
" {\n" + |
| 1807 |
" }\n"; |
| 1808 |
formatSource(source, |
| 1809 |
"/**\n" + |
| 1810 |
" * <pre>\n" + |
| 1811 |
" * public class Test implements Runnable {\n" + |
| 1812 |
" * @Override\n" + |
| 1813 |
" * public void run() {\n" + |
| 1814 |
" * // Hello really bad Ganymede formatter !!!\n" + |
| 1815 |
" * // Shit happens when somebody tries to change a running system\n" + |
| 1816 |
" * System.out.println("Press Shift+Ctrl+F to format");\n" + |
| 1817 |
" * }\n" + |
| 1818 |
" * }\n" + |
| 1819 |
" * </pre>\n" + |
| 1820 |
" */\n" + |
| 1821 |
"public class Test {\n" + |
| 1822 |
"}\n" |
| 1823 |
); |
| 1824 |
} |
| 1825 |
public void testBug239719b() throws JavaModelException { |
| 1826 |
String source = |
| 1827 |
"public class X01 {\n" + |
| 1828 |
" \n" + |
| 1829 |
" private int fLength;\n" + |
| 1830 |
" private int fOffset;\n" + |
| 1831 |
"\n" + |
| 1832 |
" /**\n" + |
| 1833 |
" * Returns the inclusive end position of this edit. The inclusive end\n" + |
| 1834 |
" * position denotes the last character of the region manipulated by\n" + |
| 1835 |
" * this edit. The returned value is the result of the following\n" + |
| 1836 |
" * calculation:\n" + |
| 1837 |
" * <pre>\n" + |
| 1838 |
" * getOffset() + getLength() - 1;\n" + |
| 1839 |
" * <pre>\n" + |
| 1840 |
" * \n" + |
| 1841 |
" * @return the inclusive end position\n" + |
| 1842 |
" */\n" + |
| 1843 |
" public final int getInclusiveEnd() {\n" + |
| 1844 |
" return fOffset + fLength - 1;\n" + |
| 1845 |
" }\n" + |
| 1846 |
"}\n"; |
| 1847 |
formatSource(source, |
| 1848 |
"public class X01 {\n" + |
| 1849 |
"\n" + |
| 1850 |
" private int fLength;\n" + |
| 1851 |
" private int fOffset;\n" + |
| 1852 |
"\n" + |
| 1853 |
" /**\n" + |
| 1854 |
" * Returns the inclusive end position of this edit. The inclusive end\n" + |
| 1855 |
" * position denotes the last character of the region manipulated by this\n" + |
| 1856 |
" * edit. The returned value is the result of the following calculation:\n" + |
| 1857 |
" * \n" + |
| 1858 |
" * <pre>\n" + |
| 1859 |
" * getOffset() + getLength() - 1;\n" + |
| 1860 |
" * \n" + |
| 1861 |
" * <pre>\n" + |
| 1862 |
" * \n" + |
| 1863 |
" * @return the inclusive end position\n" + |
| 1864 |
" */\n" + |
| 1865 |
" public final int getInclusiveEnd() {\n" + |
| 1866 |
" return fOffset + fLength - 1;\n" + |
| 1867 |
" }\n" + |
| 1868 |
"}\n" |
| 1869 |
); |
| 1870 |
} |
| 1784 |
} |
1871 |
} |