View | Details | Raw Unified | Return to bug 203609 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/compiler/regression/ClassFileReaderTest_1_5.java (+16 lines)
Lines 410-413 Link Here
410
			"}";
410
			"}";
411
		checkClassFile("", "X", source, expectedOutput, ClassFileBytesDisassembler.SYSTEM);
411
		checkClassFile("", "X", source, expectedOutput, ClassFileBytesDisassembler.SYSTEM);
412
	}
412
	}
413
	/**
414
	 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=203609
415
	 */
416
	public void test012() throws ClassFormatException, IOException {
417
		String source =
418
			"@Deprecated\n" +
419
			"package p;";
420
		String expectedOutput =
421
			"abstract interface p.package-info {\n" + 
422
			"}";
423
		if (this.complianceLevel.compareTo(COMPLIANCE_1_5) > 0) {
424
			expectedOutput = "abstract synthetic interface p.package-info {\n" + 
425
			"}";
426
		}
427
		checkClassFile("p", "package-info", source, expectedOutput, ClassFileBytesDisassembler.DEFAULT);
428
	}
413
}
429
}
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java (-2 / +8 lines)
Lines 451-456 Link Here
451
						problemReporter().illegalModifierForInterface(sourceType);
451
						problemReporter().illegalModifierForInterface(sourceType);
452
				}
452
				}
453
			}
453
			}
454
			/*
455
			 * AccSynthetic must be set if the target is greater than 1.5. 1.5 VM don't support AccSynthetics flag.
456
			 */
457
			if (sourceType.sourceName == TypeConstants.PACKAGE_INFO_NAME && this.compilerOptions().targetJDK > ClassFileConstants.JDK1_5) {
458
				modifiers |= ClassFileConstants.AccSynthetic;
459
			}
454
			modifiers |= ClassFileConstants.AccAbstract;
460
			modifiers |= ClassFileConstants.AccAbstract;
455
		} else if ((realModifiers & ClassFileConstants.AccEnum) != 0) {
461
		} else if ((realModifiers & ClassFileConstants.AccEnum) != 0) {
456
			// detect abnormal cases for enums
462
			// detect abnormal cases for enums
Lines 473-479 Link Here
473
					if ((referenceContext.bits & ASTNode.HasAbstractMethods) != 0) {
479
					if ((referenceContext.bits & ASTNode.HasAbstractMethods) != 0) {
474
						modifiers |= ClassFileConstants.AccAbstract;
480
						modifiers |= ClassFileConstants.AccAbstract;
475
						break checkAbstractEnum;
481
						break checkAbstractEnum;
476
					} 					
482
					}
477
					// body of enum constant must implement any inherited abstract methods
483
					// body of enum constant must implement any inherited abstract methods
478
					// enum type needs to implement abstract methods if one of its constants does not supply a body
484
					// enum type needs to implement abstract methods if one of its constants does not supply a body
479
					TypeDeclaration typeDeclaration = this.referenceContext;
485
					TypeDeclaration typeDeclaration = this.referenceContext;
Lines 519-525 Link Here
519
						}
525
						}
520
					}
526
					}
521
					modifiers |= ClassFileConstants.AccFinal;
527
					modifiers |= ClassFileConstants.AccFinal;
522
				}			
528
				}
523
			}
529
			}
524
		} else {
530
		} else {
525
			// detect abnormal cases for classes
531
			// detect abnormal cases for classes

Return to bug 203609