Lines 1328-1333
Link Here
|
1328 |
} |
1328 |
} |
1329 |
|
1329 |
|
1330 |
/* |
1330 |
/* |
|
|
1331 |
Handle a single warning token. |
1332 |
*/ |
1333 |
protected void handleWarningToken(String token, boolean isEnabling, |
1334 |
boolean useEnableJavadoc) throws InvalidInputException { |
1335 |
if (token.equals("constructorName")) { //$NON-NLS-1$ |
1336 |
this.options.put( |
1337 |
CompilerOptions.OPTION_ReportMethodWithConstructorName, |
1338 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1339 |
} else if (token.equals("pkgDefaultMethod") || token.equals("packageDefaultMethod")/*backward compatible*/ ) { //$NON-NLS-1$ //$NON-NLS-2$ |
1340 |
this.options.put( |
1341 |
CompilerOptions.OPTION_ReportOverridingPackageDefaultMethod, |
1342 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1343 |
} else if (token.equals("maskedCatchBlock") || token.equals("maskedCatchBlocks")/*backward compatible*/) { //$NON-NLS-1$ //$NON-NLS-2$ |
1344 |
this.options.put( |
1345 |
CompilerOptions.OPTION_ReportHiddenCatchBlock, |
1346 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1347 |
} else if (token.equals("deprecation")) { //$NON-NLS-1$ |
1348 |
this.options.put( |
1349 |
CompilerOptions.OPTION_ReportDeprecation, |
1350 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1351 |
this.options.put( |
1352 |
CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, |
1353 |
CompilerOptions.DISABLED); |
1354 |
this.options.put( |
1355 |
CompilerOptions.OPTION_ReportDeprecationWhenOverridingDeprecatedMethod, |
1356 |
CompilerOptions.DISABLED); |
1357 |
} else if (token.equals("allDeprecation")) { //$NON-NLS-1$ |
1358 |
this.options.put( |
1359 |
CompilerOptions.OPTION_ReportDeprecation, |
1360 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1361 |
this.options.put( |
1362 |
CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, |
1363 |
isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED); |
1364 |
this.options.put( |
1365 |
CompilerOptions.OPTION_ReportDeprecationWhenOverridingDeprecatedMethod, |
1366 |
isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED); |
1367 |
} else if (token.equals("unusedLocal") || token.equals("unusedLocals")/*backward compatible*/) { //$NON-NLS-1$ //$NON-NLS-2$ |
1368 |
this.options.put( |
1369 |
CompilerOptions.OPTION_ReportUnusedLocal, |
1370 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1371 |
} else if (token.equals("unusedArgument") || token.equals("unusedArguments")/*backward compatible*/) { //$NON-NLS-1$ //$NON-NLS-2$ |
1372 |
this.options.put( |
1373 |
CompilerOptions.OPTION_ReportUnusedParameter, |
1374 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1375 |
} else if (token.equals("unusedImport") || token.equals("unusedImports")/*backward compatible*/) { //$NON-NLS-1$ //$NON-NLS-2$ |
1376 |
this.options.put( |
1377 |
CompilerOptions.OPTION_ReportUnusedImport, |
1378 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1379 |
} else if (token.equals("unusedPrivate")) { //$NON-NLS-1$ |
1380 |
this.options.put( |
1381 |
CompilerOptions.OPTION_ReportUnusedPrivateMember, |
1382 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1383 |
} else if (token.equals("unusedLabel")) { //$NON-NLS-1$ |
1384 |
this.options.put( |
1385 |
CompilerOptions.OPTION_ReportUnusedLabel, |
1386 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1387 |
} else if (token.equals("localHiding")) { //$NON-NLS-1$ |
1388 |
this.options.put( |
1389 |
CompilerOptions.OPTION_ReportLocalVariableHiding, |
1390 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1391 |
} else if (token.equals("fieldHiding")) { //$NON-NLS-1$ |
1392 |
this.options.put( |
1393 |
CompilerOptions.OPTION_ReportFieldHiding, |
1394 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1395 |
} else if (token.equals("specialParamHiding")) { //$NON-NLS-1$ |
1396 |
this.options.put( |
1397 |
CompilerOptions.OPTION_ReportSpecialParameterHidingField, |
1398 |
isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED); |
1399 |
} else if (token.equals("conditionAssign")) { //$NON-NLS-1$ |
1400 |
this.options.put( |
1401 |
CompilerOptions.OPTION_ReportPossibleAccidentalBooleanAssignment, |
1402 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1403 |
} else if (token.equals("syntheticAccess") //$NON-NLS-1$ |
1404 |
|| token.equals("synthetic-access")) { //$NON-NLS-1$ |
1405 |
this.options.put( |
1406 |
CompilerOptions.OPTION_ReportSyntheticAccessEmulation, |
1407 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1408 |
} else if (token.equals("nls")) { //$NON-NLS-1$ |
1409 |
this.options.put( |
1410 |
CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, |
1411 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1412 |
} else if (token.equals("staticReceiver")) { //$NON-NLS-1$ |
1413 |
this.options.put( |
1414 |
CompilerOptions.OPTION_ReportNonStaticAccessToStatic, |
1415 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1416 |
} else if (token.equals("indirectStatic")) { //$NON-NLS-1$ |
1417 |
this.options.put( |
1418 |
CompilerOptions.OPTION_ReportIndirectStaticAccess, |
1419 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1420 |
} else if (token.equals("noEffectAssign")) { //$NON-NLS-1$ |
1421 |
this.options.put( |
1422 |
CompilerOptions.OPTION_ReportNoEffectAssignment, |
1423 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1424 |
} else if (token.equals("intfNonInherited") || token.equals("interfaceNonInherited")/*backward compatible*/) { //$NON-NLS-1$ //$NON-NLS-2$ |
1425 |
this.options.put( |
1426 |
CompilerOptions.OPTION_ReportIncompatibleNonInheritedInterfaceMethod, |
1427 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1428 |
} else if (token.equals("charConcat") || token.equals("noImplicitStringConversion")/*backward compatible*/) {//$NON-NLS-1$ //$NON-NLS-2$ |
1429 |
this.options.put( |
1430 |
CompilerOptions.OPTION_ReportNoImplicitStringConversion, |
1431 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1432 |
} else if (token.equals("semicolon")) {//$NON-NLS-1$ |
1433 |
this.options.put( |
1434 |
CompilerOptions.OPTION_ReportEmptyStatement, |
1435 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1436 |
} else if (token.equals("serial")) {//$NON-NLS-1$ |
1437 |
this.options.put( |
1438 |
CompilerOptions.OPTION_ReportMissingSerialVersion, |
1439 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1440 |
} else if (token.equals("emptyBlock")) {//$NON-NLS-1$ |
1441 |
this.options.put( |
1442 |
CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, |
1443 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1444 |
} else if (token.equals("uselessTypeCheck")) {//$NON-NLS-1$ |
1445 |
this.options.put( |
1446 |
CompilerOptions.OPTION_ReportUnnecessaryTypeCheck, |
1447 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1448 |
} else if (token.equals("unchecked") || token.equals("unsafe")) {//$NON-NLS-1$ //$NON-NLS-2$ |
1449 |
this.options.put( |
1450 |
CompilerOptions.OPTION_ReportUncheckedTypeOperation, |
1451 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1452 |
} else if (token.equals("raw")) {//$NON-NLS-1$ |
1453 |
this.options.put( |
1454 |
CompilerOptions.OPTION_ReportRawTypeReference, |
1455 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1456 |
} else if (token.equals("finalBound")) {//$NON-NLS-1$ |
1457 |
this.options.put( |
1458 |
CompilerOptions.OPTION_ReportFinalParameterBound, |
1459 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1460 |
} else if (token.equals("suppress")) {//$NON-NLS-1$ |
1461 |
this.options.put( |
1462 |
CompilerOptions.OPTION_SuppressWarnings, |
1463 |
isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED); |
1464 |
} else if (token.equals("warningToken")) {//$NON-NLS-1$ |
1465 |
this.options.put( |
1466 |
CompilerOptions.OPTION_ReportUnhandledWarningToken, |
1467 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1468 |
} else if (token.equals("unnecessaryElse")) {//$NON-NLS-1$ |
1469 |
this.options.put( |
1470 |
CompilerOptions.OPTION_ReportUnnecessaryElse, |
1471 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1472 |
} else if (token.equals("javadoc")) {//$NON-NLS-1$ |
1473 |
if (!useEnableJavadoc) { |
1474 |
this.options.put( |
1475 |
CompilerOptions.OPTION_DocCommentSupport, |
1476 |
isEnabling ? CompilerOptions.ENABLED: CompilerOptions.DISABLED); |
1477 |
} |
1478 |
// if disabling then it's not necessary to set other javadoc options |
1479 |
if (isEnabling) { |
1480 |
this.options.put( |
1481 |
CompilerOptions.OPTION_ReportInvalidJavadoc, |
1482 |
CompilerOptions.WARNING); |
1483 |
this.options.put( |
1484 |
CompilerOptions.OPTION_ReportInvalidJavadocTags, |
1485 |
CompilerOptions.ENABLED); |
1486 |
this.options.put( |
1487 |
CompilerOptions.OPTION_ReportInvalidJavadocTagsDeprecatedRef, |
1488 |
CompilerOptions.DISABLED); |
1489 |
this.options.put( |
1490 |
CompilerOptions.OPTION_ReportInvalidJavadocTagsNotVisibleRef, |
1491 |
CompilerOptions.DISABLED); |
1492 |
this.options.put( |
1493 |
CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, |
1494 |
CompilerOptions.PRIVATE); |
1495 |
this.options.put( |
1496 |
CompilerOptions.OPTION_ReportMissingJavadocTags, |
1497 |
CompilerOptions.WARNING); |
1498 |
this.options.put( |
1499 |
CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, |
1500 |
CompilerOptions.PRIVATE); |
1501 |
} |
1502 |
} else if (token.equals("allJavadoc")) { //$NON-NLS-1$ |
1503 |
if (!useEnableJavadoc) { |
1504 |
this.options.put( |
1505 |
CompilerOptions.OPTION_DocCommentSupport, |
1506 |
isEnabling ? CompilerOptions.ENABLED: CompilerOptions.DISABLED); |
1507 |
} |
1508 |
// if disabling then it's not necessary to set other javadoc options |
1509 |
if (isEnabling) { |
1510 |
this.options.put( |
1511 |
CompilerOptions.OPTION_ReportInvalidJavadoc, |
1512 |
CompilerOptions.WARNING); |
1513 |
this.options.put( |
1514 |
CompilerOptions.OPTION_ReportInvalidJavadocTags, |
1515 |
CompilerOptions.ENABLED); |
1516 |
this.options.put( |
1517 |
CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, |
1518 |
CompilerOptions.PRIVATE); |
1519 |
this.options.put( |
1520 |
CompilerOptions.OPTION_ReportMissingJavadocTags, |
1521 |
CompilerOptions.WARNING); |
1522 |
this.options.put( |
1523 |
CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, |
1524 |
CompilerOptions.PRIVATE); |
1525 |
this.options.put( |
1526 |
CompilerOptions.OPTION_ReportMissingJavadocComments, |
1527 |
CompilerOptions.WARNING); |
1528 |
} |
1529 |
} else if (token.startsWith("tasks")) { //$NON-NLS-1$ |
1530 |
String taskTags = ""; //$NON-NLS-1$ |
1531 |
int start = token.indexOf('('); |
1532 |
int end = token.indexOf(')'); |
1533 |
if (start >= 0 && end >= 0 && start < end){ |
1534 |
taskTags = token.substring(start+1, end).trim(); |
1535 |
taskTags = taskTags.replace('|',','); |
1536 |
} |
1537 |
if (taskTags.length() == 0){ |
1538 |
throw new InvalidInputException(this.bind("configure.invalidTaskTag", token)); //$NON-NLS-1$ |
1539 |
} |
1540 |
this.options.put( |
1541 |
CompilerOptions.OPTION_TaskTags, |
1542 |
isEnabling ? taskTags : ""); //$NON-NLS-1$ |
1543 |
} else if (token.equals("assertIdentifier")) { //$NON-NLS-1$ |
1544 |
this.options.put( |
1545 |
CompilerOptions.OPTION_ReportAssertIdentifier, |
1546 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1547 |
} else if (token.equals("enumIdentifier")) { //$NON-NLS-1$ |
1548 |
this.options.put( |
1549 |
CompilerOptions.OPTION_ReportEnumIdentifier, |
1550 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1551 |
} else if (token.equals("finally")) { //$NON-NLS-1$ |
1552 |
this.options.put( |
1553 |
CompilerOptions.OPTION_ReportFinallyBlockNotCompletingNormally, |
1554 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1555 |
} else if (token.equals("unusedThrown")) { //$NON-NLS-1$ |
1556 |
this.options.put( |
1557 |
CompilerOptions.OPTION_ReportUnusedDeclaredThrownException, |
1558 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1559 |
} else if (token.equals("unqualifiedField") //$NON-NLS-1$ |
1560 |
|| token.equals("unqualified-field-access")) { //$NON-NLS-1$ |
1561 |
this.options.put( |
1562 |
CompilerOptions.OPTION_ReportUnqualifiedFieldAccess, |
1563 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1564 |
} else if (token.equals("typeHiding")) { //$NON-NLS-1$ |
1565 |
this.options.put( |
1566 |
CompilerOptions.OPTION_ReportTypeParameterHiding, |
1567 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1568 |
} else if (token.equals("varargsCast")) { //$NON-NLS-1$ |
1569 |
this.options.put( |
1570 |
CompilerOptions.OPTION_ReportVarargsArgumentNeedCast, |
1571 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1572 |
} else if (token.equals("null")) { //$NON-NLS-1$ |
1573 |
this.options.put( |
1574 |
CompilerOptions.OPTION_ReportNullReference, |
1575 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1576 |
} else if (token.equals("boxing")) { //$NON-NLS-1$ |
1577 |
this.options.put( |
1578 |
CompilerOptions.OPTION_ReportAutoboxing, |
1579 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1580 |
} else if (token.equals("over-ann")) { //$NON-NLS-1$ |
1581 |
this.options.put( |
1582 |
CompilerOptions.OPTION_ReportMissingOverrideAnnotation, |
1583 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1584 |
} else if (token.equals("dep-ann")) { //$NON-NLS-1$ |
1585 |
this.options.put( |
1586 |
CompilerOptions.OPTION_ReportMissingDeprecatedAnnotation, |
1587 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1588 |
} else if (token.equals("intfAnnotation")) { //$NON-NLS-1$ |
1589 |
this.options.put( |
1590 |
CompilerOptions.OPTION_ReportAnnotationSuperInterface, |
1591 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1592 |
} else if (token.equals("enumSwitch") //$NON-NLS-1$ |
1593 |
|| token.equals("incomplete-switch")) { //$NON-NLS-1$ |
1594 |
this.options.put( |
1595 |
CompilerOptions.OPTION_ReportIncompleteEnumSwitch, |
1596 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1597 |
} else if (token.equals("hiding")) { //$NON-NLS-1$ |
1598 |
this.options.put( |
1599 |
CompilerOptions.OPTION_ReportHiddenCatchBlock, |
1600 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1601 |
this.options.put( |
1602 |
CompilerOptions.OPTION_ReportLocalVariableHiding, |
1603 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1604 |
this.options.put( |
1605 |
CompilerOptions.OPTION_ReportFieldHiding, |
1606 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1607 |
this.options.put( |
1608 |
CompilerOptions.OPTION_ReportTypeParameterHiding, |
1609 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1610 |
} else if (token.equals("static-access")) { //$NON-NLS-1$ |
1611 |
this.options.put( |
1612 |
CompilerOptions.OPTION_ReportNonStaticAccessToStatic, |
1613 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1614 |
this.options.put( |
1615 |
CompilerOptions.OPTION_ReportIndirectStaticAccess, |
1616 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1617 |
} else if (token.equals("unused")) { //$NON-NLS-1$ |
1618 |
this.options.put( |
1619 |
CompilerOptions.OPTION_ReportUnusedLocal, |
1620 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1621 |
this.options.put( |
1622 |
CompilerOptions.OPTION_ReportUnusedParameter, |
1623 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1624 |
this.options.put( |
1625 |
CompilerOptions.OPTION_ReportUnusedImport, |
1626 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1627 |
this.options.put( |
1628 |
CompilerOptions.OPTION_ReportUnusedPrivateMember, |
1629 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1630 |
this.options.put( |
1631 |
CompilerOptions.OPTION_ReportUnusedDeclaredThrownException, |
1632 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1633 |
this.options.put( |
1634 |
CompilerOptions.OPTION_ReportUnusedLabel, |
1635 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1636 |
} else if (token.equals("paramAssign")) { //$NON-NLS-1$ |
1637 |
this.options.put( |
1638 |
CompilerOptions.OPTION_ReportParameterAssignment, |
1639 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1640 |
} else if (token.equals("discouraged")) { //$NON-NLS-1$ |
1641 |
this.options.put( |
1642 |
CompilerOptions.OPTION_ReportDiscouragedReference, |
1643 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1644 |
} else if (token.equals("forbidden")) { //$NON-NLS-1$ |
1645 |
this.options.put( |
1646 |
CompilerOptions.OPTION_ReportForbiddenReference, |
1647 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1648 |
} else if (token.equals("fallthrough")) { //$NON-NLS-1$ |
1649 |
this.options.put( |
1650 |
CompilerOptions.OPTION_ReportFallthroughCase, |
1651 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1652 |
} else { |
1653 |
throw new InvalidInputException(this.bind("configure.invalidWarning", token)); //$NON-NLS-1$ |
1654 |
} |
1655 |
} |
1656 |
|
1657 |
/* |
1658 |
Handle extdirs processing |
1659 |
*/ |
1660 |
protected ArrayList handleExtdirs(ArrayList extdirsClasspaths) { |
1661 |
final File javaHome = getJavaHome(); |
1662 |
|
1663 |
/* |
1664 |
* Feed endorsedDirClasspath according to: |
1665 |
* - -extdirs first if present; |
1666 |
* - else java.ext.dirs if defined; |
1667 |
* - else default extensions directory for the platform. |
1668 |
*/ |
1669 |
if (extdirsClasspaths == null) { |
1670 |
extdirsClasspaths = new ArrayList(DEFAULT_SIZE_CLASSPATH); |
1671 |
String extdirsStr = System.getProperty("java.ext.dirs"); //$NON-NLS-1$ |
1672 |
if (extdirsStr == null) { |
1673 |
extdirsClasspaths.add(javaHome.getAbsolutePath() + "/lib/ext"); //$NON-NLS-1$ |
1674 |
} else { |
1675 |
StringTokenizer tokenizer = new StringTokenizer(extdirsStr, File.pathSeparator); |
1676 |
while (tokenizer.hasMoreTokens()) |
1677 |
extdirsClasspaths.add(tokenizer.nextToken()); |
1678 |
} |
1679 |
} |
1680 |
|
1681 |
/* |
1682 |
* Feed extdirsClasspath with the entries found into the directories listed by |
1683 |
* extdirsNames. |
1684 |
*/ |
1685 |
if (extdirsClasspaths.size() != 0) { |
1686 |
File[] directoriesToCheck = new File[extdirsClasspaths.size()]; |
1687 |
for (int i = 0; i < directoriesToCheck.length; i++) |
1688 |
directoriesToCheck[i] = new File((String) extdirsClasspaths.get(i)); |
1689 |
extdirsClasspaths.clear(); |
1690 |
File[][] extdirsJars = getLibrariesFiles(directoriesToCheck); |
1691 |
if (extdirsJars != null) { |
1692 |
for (int i = 0, max = extdirsJars.length; i < max; i++) { |
1693 |
File[] current = extdirsJars[i]; |
1694 |
if (current != null) { |
1695 |
for (int j = 0, max2 = current.length; j < max2; j++) { |
1696 |
FileSystem.Classpath classpath = |
1697 |
FileSystem.getClasspath( |
1698 |
current[j].getAbsolutePath(), |
1699 |
null, null); |
1700 |
if (classpath != null) { |
1701 |
extdirsClasspaths.add(classpath); |
1702 |
} |
1703 |
} |
1704 |
} else if (directoriesToCheck[i].isFile()) { |
1705 |
this.logger.logIncorrectExtDirsEntry(directoriesToCheck[i].getAbsolutePath()); |
1706 |
} |
1707 |
} |
1708 |
} |
1709 |
} |
1710 |
|
1711 |
return extdirsClasspaths; |
1712 |
} |
1713 |
|
1714 |
/* |
1331 |
Decode the command line arguments |
1715 |
Decode the command line arguments |
1332 |
*/ |
1716 |
*/ |
1333 |
public void configure(String[] argv) throws InvalidInputException { |
1717 |
public void configure(String[] argv) throws InvalidInputException { |
Lines 1811-2136
Link Here
|
1811 |
while (tokenizer.hasMoreTokens()) { |
2195 |
while (tokenizer.hasMoreTokens()) { |
1812 |
String token = tokenizer.nextToken(); |
2196 |
String token = tokenizer.nextToken(); |
1813 |
tokenCounter++; |
2197 |
tokenCounter++; |
1814 |
if (token.equals("constructorName")) { //$NON-NLS-1$ |
2198 |
handleWarningToken(token, isEnabling, useEnableJavadoc); |
1815 |
this.options.put( |
|
|
1816 |
CompilerOptions.OPTION_ReportMethodWithConstructorName, |
1817 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1818 |
} else if (token.equals("pkgDefaultMethod") || token.equals("packageDefaultMethod")/*backward compatible*/ ) { //$NON-NLS-1$ //$NON-NLS-2$ |
1819 |
this.options.put( |
1820 |
CompilerOptions.OPTION_ReportOverridingPackageDefaultMethod, |
1821 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1822 |
} else if (token.equals("maskedCatchBlock") || token.equals("maskedCatchBlocks")/*backward compatible*/) { //$NON-NLS-1$ //$NON-NLS-2$ |
1823 |
this.options.put( |
1824 |
CompilerOptions.OPTION_ReportHiddenCatchBlock, |
1825 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1826 |
} else if (token.equals("deprecation")) { //$NON-NLS-1$ |
1827 |
this.options.put( |
1828 |
CompilerOptions.OPTION_ReportDeprecation, |
1829 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1830 |
this.options.put( |
1831 |
CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, |
1832 |
CompilerOptions.DISABLED); |
1833 |
this.options.put( |
1834 |
CompilerOptions.OPTION_ReportDeprecationWhenOverridingDeprecatedMethod, |
1835 |
CompilerOptions.DISABLED); |
1836 |
} else if (token.equals("allDeprecation")) { //$NON-NLS-1$ |
1837 |
this.options.put( |
1838 |
CompilerOptions.OPTION_ReportDeprecation, |
1839 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1840 |
this.options.put( |
1841 |
CompilerOptions.OPTION_ReportDeprecationInDeprecatedCode, |
1842 |
isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED); |
1843 |
this.options.put( |
1844 |
CompilerOptions.OPTION_ReportDeprecationWhenOverridingDeprecatedMethod, |
1845 |
isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED); |
1846 |
} else if (token.equals("unusedLocal") || token.equals("unusedLocals")/*backward compatible*/) { //$NON-NLS-1$ //$NON-NLS-2$ |
1847 |
this.options.put( |
1848 |
CompilerOptions.OPTION_ReportUnusedLocal, |
1849 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1850 |
} else if (token.equals("unusedArgument") || token.equals("unusedArguments")/*backward compatible*/) { //$NON-NLS-1$ //$NON-NLS-2$ |
1851 |
this.options.put( |
1852 |
CompilerOptions.OPTION_ReportUnusedParameter, |
1853 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1854 |
} else if (token.equals("unusedImport") || token.equals("unusedImports")/*backward compatible*/) { //$NON-NLS-1$ //$NON-NLS-2$ |
1855 |
this.options.put( |
1856 |
CompilerOptions.OPTION_ReportUnusedImport, |
1857 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1858 |
} else if (token.equals("unusedPrivate")) { //$NON-NLS-1$ |
1859 |
this.options.put( |
1860 |
CompilerOptions.OPTION_ReportUnusedPrivateMember, |
1861 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1862 |
} else if (token.equals("unusedLabel")) { //$NON-NLS-1$ |
1863 |
this.options.put( |
1864 |
CompilerOptions.OPTION_ReportUnusedLabel, |
1865 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1866 |
} else if (token.equals("localHiding")) { //$NON-NLS-1$ |
1867 |
this.options.put( |
1868 |
CompilerOptions.OPTION_ReportLocalVariableHiding, |
1869 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1870 |
} else if (token.equals("fieldHiding")) { //$NON-NLS-1$ |
1871 |
this.options.put( |
1872 |
CompilerOptions.OPTION_ReportFieldHiding, |
1873 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1874 |
} else if (token.equals("specialParamHiding")) { //$NON-NLS-1$ |
1875 |
this.options.put( |
1876 |
CompilerOptions.OPTION_ReportSpecialParameterHidingField, |
1877 |
isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED); |
1878 |
} else if (token.equals("conditionAssign")) { //$NON-NLS-1$ |
1879 |
this.options.put( |
1880 |
CompilerOptions.OPTION_ReportPossibleAccidentalBooleanAssignment, |
1881 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1882 |
} else if (token.equals("syntheticAccess") //$NON-NLS-1$ |
1883 |
|| token.equals("synthetic-access")) { //$NON-NLS-1$ |
1884 |
this.options.put( |
1885 |
CompilerOptions.OPTION_ReportSyntheticAccessEmulation, |
1886 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1887 |
} else if (token.equals("nls")) { //$NON-NLS-1$ |
1888 |
this.options.put( |
1889 |
CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, |
1890 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1891 |
} else if (token.equals("staticReceiver")) { //$NON-NLS-1$ |
1892 |
this.options.put( |
1893 |
CompilerOptions.OPTION_ReportNonStaticAccessToStatic, |
1894 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1895 |
} else if (token.equals("indirectStatic")) { //$NON-NLS-1$ |
1896 |
this.options.put( |
1897 |
CompilerOptions.OPTION_ReportIndirectStaticAccess, |
1898 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1899 |
} else if (token.equals("noEffectAssign")) { //$NON-NLS-1$ |
1900 |
this.options.put( |
1901 |
CompilerOptions.OPTION_ReportNoEffectAssignment, |
1902 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1903 |
} else if (token.equals("intfNonInherited") || token.equals("interfaceNonInherited")/*backward compatible*/) { //$NON-NLS-1$ //$NON-NLS-2$ |
1904 |
this.options.put( |
1905 |
CompilerOptions.OPTION_ReportIncompatibleNonInheritedInterfaceMethod, |
1906 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1907 |
} else if (token.equals("charConcat") || token.equals("noImplicitStringConversion")/*backward compatible*/) {//$NON-NLS-1$ //$NON-NLS-2$ |
1908 |
this.options.put( |
1909 |
CompilerOptions.OPTION_ReportNoImplicitStringConversion, |
1910 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1911 |
} else if (token.equals("semicolon")) {//$NON-NLS-1$ |
1912 |
this.options.put( |
1913 |
CompilerOptions.OPTION_ReportEmptyStatement, |
1914 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1915 |
} else if (token.equals("serial")) {//$NON-NLS-1$ |
1916 |
this.options.put( |
1917 |
CompilerOptions.OPTION_ReportMissingSerialVersion, |
1918 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1919 |
} else if (token.equals("emptyBlock")) {//$NON-NLS-1$ |
1920 |
this.options.put( |
1921 |
CompilerOptions.OPTION_ReportUndocumentedEmptyBlock, |
1922 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1923 |
} else if (token.equals("uselessTypeCheck")) {//$NON-NLS-1$ |
1924 |
this.options.put( |
1925 |
CompilerOptions.OPTION_ReportUnnecessaryTypeCheck, |
1926 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1927 |
} else if (token.equals("unchecked") || token.equals("unsafe")) {//$NON-NLS-1$ //$NON-NLS-2$ |
1928 |
this.options.put( |
1929 |
CompilerOptions.OPTION_ReportUncheckedTypeOperation, |
1930 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1931 |
} else if (token.equals("raw")) {//$NON-NLS-1$ |
1932 |
this.options.put( |
1933 |
CompilerOptions.OPTION_ReportRawTypeReference, |
1934 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1935 |
} else if (token.equals("finalBound")) {//$NON-NLS-1$ |
1936 |
this.options.put( |
1937 |
CompilerOptions.OPTION_ReportFinalParameterBound, |
1938 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1939 |
} else if (token.equals("suppress")) {//$NON-NLS-1$ |
1940 |
this.options.put( |
1941 |
CompilerOptions.OPTION_SuppressWarnings, |
1942 |
isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED); |
1943 |
} else if (token.equals("warningToken")) {//$NON-NLS-1$ |
1944 |
this.options.put( |
1945 |
CompilerOptions.OPTION_ReportUnhandledWarningToken, |
1946 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1947 |
} else if (token.equals("unnecessaryElse")) {//$NON-NLS-1$ |
1948 |
this.options.put( |
1949 |
CompilerOptions.OPTION_ReportUnnecessaryElse, |
1950 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
1951 |
} else if (token.equals("javadoc")) {//$NON-NLS-1$ |
1952 |
if (!useEnableJavadoc) { |
1953 |
this.options.put( |
1954 |
CompilerOptions.OPTION_DocCommentSupport, |
1955 |
isEnabling ? CompilerOptions.ENABLED: CompilerOptions.DISABLED); |
1956 |
} |
1957 |
// if disabling then it's not necessary to set other javadoc options |
1958 |
if (isEnabling) { |
1959 |
this.options.put( |
1960 |
CompilerOptions.OPTION_ReportInvalidJavadoc, |
1961 |
CompilerOptions.WARNING); |
1962 |
this.options.put( |
1963 |
CompilerOptions.OPTION_ReportInvalidJavadocTags, |
1964 |
CompilerOptions.ENABLED); |
1965 |
this.options.put( |
1966 |
CompilerOptions.OPTION_ReportInvalidJavadocTagsDeprecatedRef, |
1967 |
CompilerOptions.DISABLED); |
1968 |
this.options.put( |
1969 |
CompilerOptions.OPTION_ReportInvalidJavadocTagsNotVisibleRef, |
1970 |
CompilerOptions.DISABLED); |
1971 |
this.options.put( |
1972 |
CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, |
1973 |
CompilerOptions.PRIVATE); |
1974 |
this.options.put( |
1975 |
CompilerOptions.OPTION_ReportMissingJavadocTags, |
1976 |
CompilerOptions.WARNING); |
1977 |
this.options.put( |
1978 |
CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, |
1979 |
CompilerOptions.PRIVATE); |
1980 |
} |
1981 |
} else if (token.equals("allJavadoc")) { //$NON-NLS-1$ |
1982 |
if (!useEnableJavadoc) { |
1983 |
this.options.put( |
1984 |
CompilerOptions.OPTION_DocCommentSupport, |
1985 |
isEnabling ? CompilerOptions.ENABLED: CompilerOptions.DISABLED); |
1986 |
} |
1987 |
// if disabling then it's not necessary to set other javadoc options |
1988 |
if (isEnabling) { |
1989 |
this.options.put( |
1990 |
CompilerOptions.OPTION_ReportInvalidJavadoc, |
1991 |
CompilerOptions.WARNING); |
1992 |
this.options.put( |
1993 |
CompilerOptions.OPTION_ReportInvalidJavadocTags, |
1994 |
CompilerOptions.ENABLED); |
1995 |
this.options.put( |
1996 |
CompilerOptions.OPTION_ReportInvalidJavadocTagsVisibility, |
1997 |
CompilerOptions.PRIVATE); |
1998 |
this.options.put( |
1999 |
CompilerOptions.OPTION_ReportMissingJavadocTags, |
2000 |
CompilerOptions.WARNING); |
2001 |
this.options.put( |
2002 |
CompilerOptions.OPTION_ReportMissingJavadocTagsVisibility, |
2003 |
CompilerOptions.PRIVATE); |
2004 |
this.options.put( |
2005 |
CompilerOptions.OPTION_ReportMissingJavadocComments, |
2006 |
CompilerOptions.WARNING); |
2007 |
} |
2008 |
} else if (token.startsWith("tasks")) { //$NON-NLS-1$ |
2009 |
String taskTags = ""; //$NON-NLS-1$ |
2010 |
int start = token.indexOf('('); |
2011 |
int end = token.indexOf(')'); |
2012 |
if (start >= 0 && end >= 0 && start < end){ |
2013 |
taskTags = token.substring(start+1, end).trim(); |
2014 |
taskTags = taskTags.replace('|',','); |
2015 |
} |
2016 |
if (taskTags.length() == 0){ |
2017 |
throw new InvalidInputException(this.bind("configure.invalidTaskTag", token)); //$NON-NLS-1$ |
2018 |
} |
2019 |
this.options.put( |
2020 |
CompilerOptions.OPTION_TaskTags, |
2021 |
isEnabling ? taskTags : ""); //$NON-NLS-1$ |
2022 |
} else if (token.equals("assertIdentifier")) { //$NON-NLS-1$ |
2023 |
this.options.put( |
2024 |
CompilerOptions.OPTION_ReportAssertIdentifier, |
2025 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
2026 |
} else if (token.equals("enumIdentifier")) { //$NON-NLS-1$ |
2027 |
this.options.put( |
2028 |
CompilerOptions.OPTION_ReportEnumIdentifier, |
2029 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
2030 |
} else if (token.equals("finally")) { //$NON-NLS-1$ |
2031 |
this.options.put( |
2032 |
CompilerOptions.OPTION_ReportFinallyBlockNotCompletingNormally, |
2033 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
2034 |
} else if (token.equals("unusedThrown")) { //$NON-NLS-1$ |
2035 |
this.options.put( |
2036 |
CompilerOptions.OPTION_ReportUnusedDeclaredThrownException, |
2037 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
2038 |
} else if (token.equals("unqualifiedField") //$NON-NLS-1$ |
2039 |
|| token.equals("unqualified-field-access")) { //$NON-NLS-1$ |
2040 |
this.options.put( |
2041 |
CompilerOptions.OPTION_ReportUnqualifiedFieldAccess, |
2042 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
2043 |
} else if (token.equals("typeHiding")) { //$NON-NLS-1$ |
2044 |
this.options.put( |
2045 |
CompilerOptions.OPTION_ReportTypeParameterHiding, |
2046 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
2047 |
} else if (token.equals("varargsCast")) { //$NON-NLS-1$ |
2048 |
this.options.put( |
2049 |
CompilerOptions.OPTION_ReportVarargsArgumentNeedCast, |
2050 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
2051 |
} else if (token.equals("null")) { //$NON-NLS-1$ |
2052 |
this.options.put( |
2053 |
CompilerOptions.OPTION_ReportNullReference, |
2054 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
2055 |
} else if (token.equals("boxing")) { //$NON-NLS-1$ |
2056 |
this.options.put( |
2057 |
CompilerOptions.OPTION_ReportAutoboxing, |
2058 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
2059 |
} else if (token.equals("over-ann")) { //$NON-NLS-1$ |
2060 |
this.options.put( |
2061 |
CompilerOptions.OPTION_ReportMissingOverrideAnnotation, |
2062 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
2063 |
} else if (token.equals("dep-ann")) { //$NON-NLS-1$ |
2064 |
this.options.put( |
2065 |
CompilerOptions.OPTION_ReportMissingDeprecatedAnnotation, |
2066 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
2067 |
} else if (token.equals("intfAnnotation")) { //$NON-NLS-1$ |
2068 |
this.options.put( |
2069 |
CompilerOptions.OPTION_ReportAnnotationSuperInterface, |
2070 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
2071 |
} else if (token.equals("enumSwitch") //$NON-NLS-1$ |
2072 |
|| token.equals("incomplete-switch")) { //$NON-NLS-1$ |
2073 |
this.options.put( |
2074 |
CompilerOptions.OPTION_ReportIncompleteEnumSwitch, |
2075 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
2076 |
} else if (token.equals("hiding")) { //$NON-NLS-1$ |
2077 |
this.options.put( |
2078 |
CompilerOptions.OPTION_ReportHiddenCatchBlock, |
2079 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
2080 |
this.options.put( |
2081 |
CompilerOptions.OPTION_ReportLocalVariableHiding, |
2082 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
2083 |
this.options.put( |
2084 |
CompilerOptions.OPTION_ReportFieldHiding, |
2085 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
2086 |
this.options.put( |
2087 |
CompilerOptions.OPTION_ReportTypeParameterHiding, |
2088 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
2089 |
} else if (token.equals("static-access")) { //$NON-NLS-1$ |
2090 |
this.options.put( |
2091 |
CompilerOptions.OPTION_ReportNonStaticAccessToStatic, |
2092 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
2093 |
this.options.put( |
2094 |
CompilerOptions.OPTION_ReportIndirectStaticAccess, |
2095 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
2096 |
} else if (token.equals("unused")) { //$NON-NLS-1$ |
2097 |
this.options.put( |
2098 |
CompilerOptions.OPTION_ReportUnusedLocal, |
2099 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
2100 |
this.options.put( |
2101 |
CompilerOptions.OPTION_ReportUnusedParameter, |
2102 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
2103 |
this.options.put( |
2104 |
CompilerOptions.OPTION_ReportUnusedImport, |
2105 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
2106 |
this.options.put( |
2107 |
CompilerOptions.OPTION_ReportUnusedPrivateMember, |
2108 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
2109 |
this.options.put( |
2110 |
CompilerOptions.OPTION_ReportUnusedDeclaredThrownException, |
2111 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
2112 |
this.options.put( |
2113 |
CompilerOptions.OPTION_ReportUnusedLabel, |
2114 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
2115 |
} else if (token.equals("paramAssign")) { //$NON-NLS-1$ |
2116 |
this.options.put( |
2117 |
CompilerOptions.OPTION_ReportParameterAssignment, |
2118 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
2119 |
} else if (token.equals("discouraged")) { //$NON-NLS-1$ |
2120 |
this.options.put( |
2121 |
CompilerOptions.OPTION_ReportDiscouragedReference, |
2122 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
2123 |
} else if (token.equals("forbidden")) { //$NON-NLS-1$ |
2124 |
this.options.put( |
2125 |
CompilerOptions.OPTION_ReportForbiddenReference, |
2126 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
2127 |
} else if (token.equals("fallthrough")) { //$NON-NLS-1$ |
2128 |
this.options.put( |
2129 |
CompilerOptions.OPTION_ReportFallthroughCase, |
2130 |
isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); |
2131 |
} else { |
2132 |
throw new InvalidInputException(this.bind("configure.invalidWarning", token)); //$NON-NLS-1$ |
2133 |
} |
2134 |
} |
2199 |
} |
2135 |
if (tokenCounter == 0) |
2200 |
if (tokenCounter == 0) |
2136 |
throw new InvalidInputException( |
2201 |
throw new InvalidInputException( |
Lines 2438-2444
Link Here
|
2438 |
customEncoding); |
2503 |
customEncoding); |
2439 |
} |
2504 |
} |
2440 |
|
2505 |
|
2441 |
private void disableWarnings() { |
2506 |
protected void disableWarnings() { |
2442 |
Object[] entries = this.options.entrySet().toArray(); |
2507 |
Object[] entries = this.options.entrySet().toArray(); |
2443 |
for (int i = 0, max = entries.length; i < max; i++) { |
2508 |
for (int i = 0, max = entries.length; i < max; i++) { |
2444 |
Map.Entry entry = (Map.Entry) entries[i]; |
2509 |
Map.Entry entry = (Map.Entry) entries[i]; |