src/jdk.compiler/share/classes/com/sun/tools/javac/model/AnnotationProxyMaker.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
30 import java.lang.annotation.*; |
30 import java.lang.annotation.*; |
31 import java.lang.reflect.Array; |
31 import java.lang.reflect.Array; |
32 import java.lang.reflect.Method; |
32 import java.lang.reflect.Method; |
33 import java.util.LinkedHashMap; |
33 import java.util.LinkedHashMap; |
34 import java.util.Map; |
34 import java.util.Map; |
|
35 import java.util.stream.Collectors; |
35 import sun.reflect.annotation.*; |
36 import sun.reflect.annotation.*; |
36 |
37 |
37 import javax.lang.model.type.MirroredTypeException; |
38 import javax.lang.model.type.MirroredTypeException; |
38 import javax.lang.model.type.MirroredTypesException; |
39 import javax.lang.model.type.MirroredTypesException; |
39 import javax.lang.model.type.TypeMirror; |
40 import javax.lang.model.type.TypeMirror; |
290 type = t; |
291 type = t; |
291 typeString = t.toString(); |
292 typeString = t.toString(); |
292 } |
293 } |
293 |
294 |
294 public String toString() { |
295 public String toString() { |
295 return typeString; |
296 return typeString + ".class"; |
296 } |
297 } |
297 |
298 |
298 public int hashCode() { |
299 public int hashCode() { |
299 return (type != null ? type : typeString).hashCode(); |
300 return (type != null ? type : typeString).hashCode(); |
300 } |
301 } |
333 types = ts; |
334 types = ts; |
334 typeStrings = ts.toString(); |
335 typeStrings = ts.toString(); |
335 } |
336 } |
336 |
337 |
337 public String toString() { |
338 public String toString() { |
338 return typeStrings; |
339 return types.stream() |
|
340 .map(t -> t.toString() + ".class") |
|
341 .collect(Collectors.joining(", ", "{", "}")); |
339 } |
342 } |
340 |
343 |
341 public int hashCode() { |
344 public int hashCode() { |
342 return (types != null ? types : typeStrings).hashCode(); |
345 return (types != null ? types : typeStrings).hashCode(); |
343 } |
346 } |