我遇到了以下javac编译失败,其中javac无法识别具有公共枚举的静态嵌套类上的注释.一旦我将枚举移出静态嵌套类,就解决了编译错误.有谁知道为什么javac失败了?这是一个java编译器错误吗?还是有一个我不知道的java细微差别?
下面是一个独立的测试用例.
无法编译:
package test;
import test.AnnotationBug.NestedClassWithEnum.ParticipantType;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.googlecode.objectify.annotation.Embed;
public class AnnotationBug {
ParticipantType type;
@Embed
@Data
@NoArgsConstructor
public static final class NestedClassNoEnum {
}
@Embed
@Data
@NoArgsConstructor
public static final class NestedClassWithEnum {
ParticipantType type;
public enum ParticipantType {
ORGANIZER,
REGISTERED,
WAIT_LISTED
}
}
}
Run Code Online (Sandbox Code Playgroud)
编译输出:
$ javac -classpath /home/avaliani/projects/jars/objectify-4.0b2.jar:/home/avaliani/projects/jars/lombok.jar test/AnnotationBug.java
test/AnnotationBug.java:20: error: cannot find symbol
@Embed
^
symbol: class Embed
location: class AnnotationBug
test/AnnotationBug.java:21: error: cannot find symbol
@Data
^
symbol: class Data
location: …Run Code Online (Sandbox Code Playgroud) 我正在尝试扩展angular-ui tabset功能,我遇到了包装它的问题.
这个plunker是未包装的tabset指令:
http://plnkr.co/edit/AhG3WVNxCal5fZOUbSu6?p=preview
这个plunker包含我第一次尝试包装tabset指令:
http://plnkr.co/edit/naKXbeVOS8nizwDPUrkT?p=preview
最初的包装方法是直接包装.但是......我在替换模板中引入了额外的div,以避免"多个指令要求隔离范围"和"多个指令要求转换"角度错误并确保发生转换.
关键代码段:
.directive('urlTabset', function() {
return {
restrict: 'E',
transclude: true,
replace: true,
scope: {
tabManager: '='
},
controller: [ "$scope", function($scope) {
var tabManager = $scope.tabManager;
}],
template:
'<div>' +
'<tabset>' +
'<div ng-transclude>' +
'</div>' +
'</tabset>' +
'</div>'
};
})
.directive('urlTab', function() {
return {
require: '^urlTabset',
restrict: 'E',
transclude: true,
replace: true,
scope: { tabName: '@' },
link: function(scope, element, attrs, urlTabsetCtrl) {
},
template:
'<div>' +
'<tab>' +
'<div …Run Code Online (Sandbox Code Playgroud) angularjs angular-ui angularjs-directive angular-ui-bootstrap