src/share/classes/sun/font/Type1Font.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -84,11 +84,11 @@
fileName = name;
}
public synchronized void dispose() {
java.security.AccessController.doPrivileged(
- new java.security.PrivilegedAction() {
+ new java.security.PrivilegedAction<Object>() {
public Object run() {
if (fileName != null) {
(new java.io.File(fileName)).delete();
}
@@ -96,20 +96,20 @@
}
});
}
}
- WeakReference bufferRef = new WeakReference(null);
+ WeakReference<Object> bufferRef = new WeakReference<>(null);
private String psName = null;
- static private HashMap styleAbbreviationsMapping;
- static private HashSet styleNameTokes;
+ static private HashMap<String, String> styleAbbreviationsMapping;
+ static private HashSet<String> styleNameTokes;
static {
- styleAbbreviationsMapping = new HashMap();
- styleNameTokes = new HashSet();
+ styleAbbreviationsMapping = new HashMap<>();
+ styleNameTokes = new HashSet<>();
/* These abbreviation rules are taken from Appendix 1 of Adobe Technical Note #5088 */
/* NB: this list is not complete - we did not include abbreviations which contain
several capital letters because current expansion algorithm do not support this.
(namely we have omited MM aka "Multiple Master", OsF aka "Oldstyle figures",
@@ -190,11 +190,11 @@
if (mapBuf == null) {
//System.out.println("open T1 " + platName);
try {
RandomAccessFile raf = (RandomAccessFile)
java.security.AccessController.doPrivileged(
- new java.security.PrivilegedAction() {
+ new java.security.PrivilegedAction<Object>() {
public Object run() {
try {
return new RandomAccessFile(platName, "r");
} catch (FileNotFoundException ffne) {
}
@@ -203,11 +203,11 @@
});
FileChannel fc = raf.getChannel();
fileSize = (int)fc.size();
mapBuf = fc.map(FileChannel.MapMode.READ_ONLY, 0, fileSize);
mapBuf.position(0);
- bufferRef = new WeakReference(mapBuf);
+ bufferRef = new WeakReference<>(mapBuf);
fc.close();
} catch (NullPointerException e) {
throw new FontFormatException(e.toString());
} catch (ClosedChannelException e) {
/* NIO I/O is interruptible, recurse to retry operation.
@@ -230,11 +230,11 @@
RandomAccessFile raf = null;
FileChannel fc;
try {
raf = (RandomAccessFile)
java.security.AccessController.doPrivileged(
- new java.security.PrivilegedAction() {
+ new java.security.PrivilegedAction<Object>() {
public Object run() {
try {
return new RandomAccessFile(platName, "r");
} catch (FileNotFoundException fnfe) {
}
@@ -472,11 +472,11 @@
return name; //should not happen
}
private String expandAbbreviation(String abbr) {
if (styleAbbreviationsMapping.containsKey(abbr))
- return (String) styleAbbreviationsMapping.get(abbr);
+ return styleAbbreviationsMapping.get(abbr);
return abbr;
}
private boolean isStyleToken(String token) {
return styleNameTokes.contains(token);