提交 b38912d2 编写于 作者: A alanb

Merge

/* /*
* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -1011,7 +1011,7 @@ class PackageReader extends BandStructure { ...@@ -1011,7 +1011,7 @@ class PackageReader extends BandStructure {
return -1; return -1;
} }
Comparator<Entry> entryOutputOrder = new Comparator<>() { Comparator<Entry> entryOutputOrder = new Comparator<Entry>() {
public int compare(Entry e0, Entry e1) { public int compare(Entry e0, Entry e1) {
int k0 = getOutputIndex(e0); int k0 = getOutputIndex(e0);
int k1 = getOutputIndex(e1); int k1 = getOutputIndex(e1);
......
/* /*
* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -785,7 +785,7 @@ class PackageWriter extends BandStructure { ...@@ -785,7 +785,7 @@ class PackageWriter extends BandStructure {
defMap.entrySet().toArray(layoutsAndCounts); defMap.entrySet().toArray(layoutsAndCounts);
// Sort by count, most frequent first. // Sort by count, most frequent first.
// Predefs. participate in this sort, though it does not matter. // Predefs. participate in this sort, though it does not matter.
Arrays.sort(layoutsAndCounts, new Comparator<>() { Arrays.sort(layoutsAndCounts, new Comparator<Object>() {
public int compare(Object o0, Object o1) { public int compare(Object o0, Object o1) {
Map.Entry e0 = (Map.Entry) o0; Map.Entry e0 = (Map.Entry) o0;
Map.Entry e1 = (Map.Entry) o1; Map.Entry e1 = (Map.Entry) o1;
......
/* /*
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
...@@ -76,7 +76,7 @@ public class ZipDirectoryStream implements DirectoryStream<Path> { ...@@ -76,7 +76,7 @@ public class ZipDirectoryStream implements DirectoryStream<Path> {
} catch (IOException e) { } catch (IOException e) {
throw new IllegalStateException(e); throw new IllegalStateException(e);
} }
return new Iterator<>() { return new Iterator<Path>() {
private Path next; private Path next;
@Override @Override
public boolean hasNext() { public boolean hasNext() {
......
...@@ -112,11 +112,8 @@ public class ZipFileSystem extends FileSystem { ...@@ -112,11 +112,8 @@ public class ZipFileSystem extends FileSystem {
} }
// sm and existence check // sm and existence check
zfpath.getFileSystem().provider().checkAccess(zfpath, AccessMode.READ); zfpath.getFileSystem().provider().checkAccess(zfpath, AccessMode.READ);
try { if (!Files.isWritable(zfpath))
zfpath.getFileSystem().provider().checkAccess(zfpath, AccessMode.WRITE);
} catch (AccessDeniedException x) {
this.readOnly = true; this.readOnly = true;
}
this.zc = ZipCoder.get(nameEncoding); this.zc = ZipCoder.get(nameEncoding);
this.defaultdir = new ZipPath(this, getBytes(defaultDir)); this.defaultdir = new ZipPath(this, getBytes(defaultDir));
this.ch = Files.newByteChannel(zfpath, READ); this.ch = Files.newByteChannel(zfpath, READ);
......
/* /*
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
...@@ -590,7 +590,7 @@ public class ZipPath implements Path { ...@@ -590,7 +590,7 @@ public class ZipPath implements Path {
@Override @Override
public Iterator<Path> iterator() { public Iterator<Path> iterator() {
return new Iterator<>() { return new Iterator<Path>() {
private int i = 0; private int i = 0;
@Override @Override
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册