rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
CallbackHandler handler = new ConsoleCallbackHandler(); PasswordCallback pcb = new PasswordCallback("Enter key password for " + alias + ": ", false); handler.handle(new Callback[] { pcb }); | String prompt = Messages.getFormattedString("Main.97", alias); PasswordCallback pcb = new PasswordCallback(prompt, false); getCallbackHandler().handle(new Callback[] { pcb }); | private void setupSigningParams() throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException, UnsupportedCallbackException, UnrecoverableKeyException { log.entering("Main", "setupSigningParams"); if (ksURL == null || ksURL.trim().length() == 0) { String userHome... |
throw new SecurityException("Key associated with " + alias + " MUST be a private key"); | throw new SecurityException(Messages.getFormattedString("Main.99", alias)); | private void setupSigningParams() throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException, UnsupportedCallbackException, UnrecoverableKeyException { log.entering("Main", "setupSigningParams"); if (ksURL == null || ksURL.trim().length() == 0) { String userHome... |
log.exiting("Main", "setupSigningParams"); | log.exiting(this.getClass().getName(), "setupSigningParams"); | private void setupSigningParams() throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException, UnsupportedCallbackException, UnrecoverableKeyException { log.entering("Main", "setupSigningParams"); if (ksURL == null || ksURL.trim().length() == 0) { String userHome... |
log.entering("Main", "start"); | log.entering(this.getClass().getName(), "start"); | private void start() throws Exception { log.entering("Main", "start"); if (verify) { JarVerifier jv = new JarVerifier(this); jv.start(); } else { JarSigner js = new JarSigner(this); js.start(); } log.exiting("Main", "start"); } |
log.exiting("Main", "start"); | log.exiting(this.getClass().getName(), "start"); | private void start() throws Exception { log.entering("Main", "start"); if (verify) { JarVerifier jv = new JarVerifier(this); jv.start(); } else { JarSigner js = new JarSigner(this); js.start(); } log.exiting("Main", "start"); } |
log.entering("Main", "teardown"); | log.entering(this.getClass().getName(), "teardown"); | private void teardown() { log.entering("Main", "teardown"); if (providerInstalled) { final String providerName = provider.getName(); log.info("About to remove provider: " + providerName); // remove it. again we need to override security checks AccessController.doPrivileged(new ... |
{ final String providerName = provider.getName(); log.info("About to remove provider: " + providerName); AccessController.doPrivileged(new PrivilegedAction() { public Object run() { Security.removeProvider(providerName); return null; } }); } | ProviderUtil.removeProvider(provider.getName()); | private void teardown() { log.entering("Main", "teardown"); if (providerInstalled) { final String providerName = provider.getName(); log.info("About to remove provider: " + providerName); // remove it. again we need to override security checks AccessController.doPrivileged(new ... |
log.exiting("Main", "teardown"); | log.exiting(this.getClass().getName(), "teardown"); | private void teardown() { log.entering("Main", "teardown"); if (providerInstalled) { final String providerName = provider.getName(); log.info("About to remove provider: " + providerName); // remove it. again we need to override security checks AccessController.doPrivileged(new ... |
log.entering("JarSigner", "start"); | log.entering(this.getClass().getName(), "start"); | void start() throws Exception { log.entering("JarSigner", "start"); JarFile jarFile = new JarFile(main.getJarFileName()); SFHelper sfHelper = new SFHelper(jarFile); sfHelper.startSigning(); // 1. compute the digests for (Enumeration e = jarFile.entries(); e.hasMoreElements(); ) { JarEnt... |
System.out.println(" signing: " + jeName); | System.out.println(Messages.getString("JarSigner.1") + jeName); | void start() throws Exception { log.entering("JarSigner", "start"); JarFile jarFile = new JarFile(main.getJarFileName()); SFHelper sfHelper = new SFHelper(jarFile); sfHelper.startSigning(); // 1. compute the digests for (Enumeration e = jarFile.entries(); e.hasMoreElements(); ) { JarEnt... |
System.out.println(" updating: " + JarFile.MANIFEST_NAME); | System.out.println(Messages.getString("JarSigner.2") + JarFile.MANIFEST_NAME); | void start() throws Exception { log.entering("JarSigner", "start"); JarFile jarFile = new JarFile(main.getJarFileName()); SFHelper sfHelper = new SFHelper(jarFile); sfHelper.startSigning(); // 1. compute the digests for (Enumeration e = jarFile.entries(); e.hasMoreElements(); ) { JarEnt... |
log.info("Created .SF file"); | log.finer("Created .SF file"); | void start() throws Exception { log.entering("JarSigner", "start"); JarFile jarFile = new JarFile(main.getJarFileName()); SFHelper sfHelper = new SFHelper(jarFile); sfHelper.startSigning(); // 1. compute the digests for (Enumeration e = jarFile.entries(); e.hasMoreElements(); ) { JarEnt... |
System.out.println(" adding: " + sfFileName); | System.out.println(Messages.getString("JarSigner.8") + sfFileName); | void start() throws Exception { log.entering("JarSigner", "start"); JarFile jarFile = new JarFile(main.getJarFileName()); SFHelper sfHelper = new SFHelper(jarFile); sfHelper.startSigning(); // 1. compute the digests for (Enumeration e = jarFile.entries(); e.hasMoreElements(); ) { JarEnt... |
log.info("Created .DSA file"); | log.finer("Created .DSA file"); | void start() throws Exception { log.entering("JarSigner", "start"); JarFile jarFile = new JarFile(main.getJarFileName()); SFHelper sfHelper = new SFHelper(jarFile); sfHelper.startSigning(); // 1. compute the digests for (Enumeration e = jarFile.entries(); e.hasMoreElements(); ) { JarEnt... |
System.out.println(" adding: " + dsaFileName); | System.out.println(Messages.getString("JarSigner.8") + dsaFileName); | void start() throws Exception { log.entering("JarSigner", "start"); JarFile jarFile = new JarFile(main.getJarFileName()); SFHelper sfHelper = new SFHelper(jarFile); sfHelper.startSigning(); // 1. compute the digests for (Enumeration e = jarFile.entries(); e.hasMoreElements(); ) { JarEnt... |
log.info("Renamed signed JAR file"); | log.finer("Renamed signed JAR file"); | void start() throws Exception { log.entering("JarSigner", "start"); JarFile jarFile = new JarFile(main.getJarFileName()); SFHelper sfHelper = new SFHelper(jarFile); sfHelper.startSigning(); // 1. compute the digests for (Enumeration e = jarFile.entries(); e.hasMoreElements(); ) { JarEnt... |
System.out.println(SystemProperties.getProperty("line.separator") + "jar signed."); | System.out.println(SystemProperties.getProperty("line.separator") + Messages.getString("JarSigner.14")); | void start() throws Exception { log.entering("JarSigner", "start"); JarFile jarFile = new JarFile(main.getJarFileName()); SFHelper sfHelper = new SFHelper(jarFile); sfHelper.startSigning(); // 1. compute the digests for (Enumeration e = jarFile.entries(); e.hasMoreElements(); ) { JarEnt... |
log.exiting("JarSigner", "start"); | log.exiting(this.getClass().getName(), "start"); | void start() throws Exception { log.entering("JarSigner", "start"); JarFile jarFile = new JarFile(main.getJarFileName()); SFHelper sfHelper = new SFHelper(jarFile); sfHelper.startSigning(); // 1. compute the digests for (Enumeration e = jarFile.entries(); e.hasMoreElements(); ) { JarEnt... |
if (tileIcon == null) return; | private void paintEdge(Component c, Graphics g, int x, int y, int width, int height, int dx, int dy) { Color oldColor; int iconWidth, iconHeight; Graphics clipped; if ((width <= 0) || (height <= 0)) return; /* Paint a colored rectangle if desired. *... | |
public ProfileHeader(byte[] data) | public ProfileHeader() | public ProfileHeader(byte[] data) { ByteBuffer buf = ByteBuffer.wrap(data); // Get size (the sign bit shouldn't matter. // A valid profile can never be +2Gb) size = buf.getInt(ICC_Profile.icHdrSize); // CMM ID cmmId = buf.getInt(ICC_Profile.icHdrCmmId); // Version number majorVersion = (int... |
ByteBuffer buf = ByteBuffer.wrap(data); | creatorSig = 0; intent = 0; modelSig = manufacturerSig = (int) 0x6E6f6E65; magic = icMagicNumber; cmmId = 0; platform = 0; timestamp = new byte[8]; majorVersion = 2; minorVersion = 0x10; flags = 0; | public ProfileHeader(byte[] data) { ByteBuffer buf = ByteBuffer.wrap(data); // Get size (the sign bit shouldn't matter. // A valid profile can never be +2Gb) size = buf.getInt(ICC_Profile.icHdrSize); // CMM ID cmmId = buf.getInt(ICC_Profile.icHdrCmmId); // Version number majorVersion = (int... |
size = buf.getInt(ICC_Profile.icHdrSize); cmmId = buf.getInt(ICC_Profile.icHdrCmmId); majorVersion = (int) (data[ICC_Profile.icHdrVersion]); minorVersion = (int) (data[ICC_Profile.icHdrVersion + 1]); int classSig = buf.getInt(ICC_Profile.icHdrDeviceClass); profileClass = -1; for (int i = 0; i < classMap.length; i... | illuminant = new byte[] { (byte) 0x00, (byte) 0x00, (byte) 0xf6, (byte) 0xd6, (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xd3, (byte) 0x2d }; | public ProfileHeader(byte[] data) { ByteBuffer buf = ByteBuffer.wrap(data); // Get size (the sign bit shouldn't matter. // A valid profile can never be +2Gb) size = buf.getInt(ICC_Profile.icHdrSize); // CMM ID cmmId = buf.getInt(ICC_Profile.icHdrCmmId); // Version number majorVersion = (int... |
System.arraycopy(data, ICC_Profile.icHdrAttributes, attributes, 0, 8); intent = buf.getInt(ICC_Profile.icHdrRenderingIntent); illuminant = new byte[12]; System.arraycopy(data, ICC_Profile.icHdrIlluminant, illuminant, 0, 12); creatorSig = buf.getInt(ICC_Profile.icHdrCreator); | profileClass = ICC_Profile.CLASS_DISPLAY; | public ProfileHeader(byte[] data) { ByteBuffer buf = ByteBuffer.wrap(data); // Get size (the sign bit shouldn't matter. // A valid profile can never be +2Gb) size = buf.getInt(ICC_Profile.icHdrSize); // CMM ID cmmId = buf.getInt(ICC_Profile.icHdrCmmId); // Version number majorVersion = (int... |
ICC_ProfileRGB(byte[] data) | ICC_ProfileRGB(int cspace) | ICC_ProfileRGB(byte[] data) { super(data); matrix = createMatrix(); whitePoint = getXYZData(icSigMediaWhitePointTag); } |
super(data); | super(cspace); | ICC_ProfileRGB(byte[] data) { super(data); matrix = createMatrix(); whitePoint = getXYZData(icSigMediaWhitePointTag); } |
ICC_ProfileGray(byte[] data) | ICC_ProfileGray(int cspace) | ICC_ProfileGray(byte[] data) { super(data); whitePoint = getXYZData(icSigMediaWhitePointTag); } |
super(data); | super(cspace); | ICC_ProfileGray(byte[] data) { super(data); whitePoint = getXYZData(icSigMediaWhitePointTag); } |
dm.rename(device, getDevicePrefix(), true); | if (renameToDevicePrefixOnly()) { dm.rename(device, getDevicePrefix(), true); } else { dm.rename(device, getDevicePrefix() + "-" + device.getId(), false); } | protected void startDevice() throws DriverException { final Device device = getDevice(); try { final DeviceManager dm = (DeviceManager)InitialNaming.lookup(DeviceManager.NAME); dm.rename(device, getDevicePrefix(), true); } catch (DeviceAlreadyRegisteredException ex) { log.error("Cannot rename device", ex); }... |
public synchronized void allocateDataBlock(long i) throws FileSystemException, IOException { if(i < getAllocatedBlockCount()) throw new IOException(i+" blocks are already allocated for this inode"); if(i > getAllocatedBlockCount()) throw new IOException("Allocate block "+getAllocatedBlockCount()+" first!"); long newBl... | public synchronized void allocateDataBlock(long i) throws FileSystemException, IOException { if (i < getAllocatedBlockCount()) throw new IOException(i + " blocks are already allocated for this inode"); if (i > getAllocatedBlockCount()) throw new IOException("Allocate block " + getAllocatedBlockCount() + " first!"); | public synchronized void allocateDataBlock(long i) throws FileSystemException, IOException { if(i < getAllocatedBlockCount()) throw new IOException(i+" blocks are already allocated for this inode"); if(i > getAllocatedBlockCount()) throw new IOException("Allocate block "+getAllocatedBlockCount()+" first!"); lo... |
registerBlockIndex(i, newBlock); } | long newBlock = findFreeBlock(i); log.debug("Allocated new block " + newBlock); desc.setLastAllocatedBlockIndex(i); registerBlockIndex(i, newBlock); } | public synchronized void allocateDataBlock(long i) throws FileSystemException, IOException { if(i < getAllocatedBlockCount()) throw new IOException(i+" blocks are already allocated for this inode"); if(i > getAllocatedBlockCount()) throw new IOException("Allocate block "+getAllocatedBlockCount()+" first!"); lo... |
private long findFreeBlock(long index) throws IOException, FileSystemException{ long lastBlock = -1; BlockReservation reservation; if( desc.getPreallocCount() > 0 ) { return desc.usePreallocBlock(); } if(index>0) lastBlock = getDataBlockNr(index-1); if( lastBlock!=-1 ) { for(int i=1; i<16; i++) { reservation = ge... | private long findFreeBlock(long index) throws IOException, FileSystemException { long lastBlock = -1; BlockReservation reservation; | private long findFreeBlock(long index) throws IOException, FileSystemException{ //long newBlock; long lastBlock = -1; BlockReservation reservation; //first, see if preallocated blocks exist if( desc.getPreallocCount() > 0 ) { return desc.usePreallocBlock(); } //no preallocated blocks: //check around the ... |
for(int i=-15; i<0; i++) { reservation = getExt2FileSystem().testAndSetBlock(lastBlock+i); if( reservation.isSuccessful() ) { desc.setPreallocBlock( reservation.getBlock()+1 ); desc.setPreallocCount( reservation.getPreallocCount() ); long prealloc512 = (1+reservation.getPreallocCount()) * (fs.getBlockSize()/512); setB... | if (desc.getPreallocCount() > 0) { return desc.usePreallocBlock(); } | private long findFreeBlock(long index) throws IOException, FileSystemException{ //long newBlock; long lastBlock = -1; BlockReservation reservation; //first, see if preallocated blocks exist if( desc.getPreallocCount() > 0 ) { return desc.usePreallocBlock(); } //no preallocated blocks: //check around the ... |
long prealloc512 = (1+reservation.getPreallocCount()) * (fs.getBlockSize()/512); setBlocks( getBlocks()+prealloc512 ); return reservation.getBlock(); } | if (index > 0) lastBlock = getDataBlockNr(index - 1); if (lastBlock != -1) { for (int i = 1; i < 16; i++) { reservation = getExt2FileSystem() .testAndSetBlock(lastBlock + i); if (reservation.isSuccessful()) { desc.setPreallocBlock(reservation.getBlock() + 1); desc.setPreallocCount(reservation.getPreallocCount()); | private long findFreeBlock(long index) throws IOException, FileSystemException{ //long newBlock; long lastBlock = -1; BlockReservation reservation; //first, see if preallocated blocks exist if( desc.getPreallocCount() > 0 ) { return desc.usePreallocBlock(); } //no preallocated blocks: //check around the ... |
long nonfullBlockGroup = -1; for(int i=0; i<getExt2FileSystem().getGroupCount(); i++) { if(i==desc.getGroup()) continue; long threshold = (long)Math.ceil( getExt2FileSystem().getSuperblock().getBlocksPerGroup() * Ext2Constants.EXT2_BLOCK_THRESHOLD_RATIO ); reservation = getExt2FileSystem().findFreeBlocks( i, threshol... | long prealloc512 = (1 + reservation.getPreallocCount()) * (fs.getBlockSize() / 512); setBlocks(getBlocks() + prealloc512); | private long findFreeBlock(long index) throws IOException, FileSystemException{ //long newBlock; long lastBlock = -1; BlockReservation reservation; //first, see if preallocated blocks exist if( desc.getPreallocCount() > 0 ) { return desc.usePreallocBlock(); } //no preallocated blocks: //check around the ... |
long prealloc512 = (1+reservation.getPreallocCount()) * (fs.getBlockSize()/512); setBlocks( getBlocks()+prealloc512 ); return reservation.getBlock(); } if(reservation.getFreeBlocksCount()>0) nonfullBlockGroup = i; } if(nonfullBlockGroup!=-1) { reservation = getExt2FileSystem().findFreeBlocks( desc.getGroup(), 1 );... | return lastBlock + i; } } for (int i = -15; i < 0; i++) { reservation = getExt2FileSystem() .testAndSetBlock(lastBlock + i); if (reservation.isSuccessful()) { desc.setPreallocBlock(reservation.getBlock() + 1); desc.setPreallocCount(reservation.getPreallocCount()); long prealloc512 = (1 + reservation.getPreallocCount(... | private long findFreeBlock(long index) throws IOException, FileSystemException{ //long newBlock; long lastBlock = -1; BlockReservation reservation; //first, see if preallocated blocks exist if( desc.getPreallocCount() > 0 ) { return desc.usePreallocBlock(); } //no preallocated blocks: //check around the ... |
protected synchronized void freeDataBlock(long i) throws IOException, FileSystemException { final long blockCount = getAllocatedBlockCount(); final int indirectCount = getIndirectCount(); if(i != blockCount-1) throw new IOException("Only the last block of the inode can be freed." + "You were trying to free block nr. "... | protected synchronized void freeDataBlock(long i) throws IOException, FileSystemException { final long blockCount = getAllocatedBlockCount(); final int indirectCount = getIndirectCount(); | protected synchronized void freeDataBlock(long i) throws IOException, FileSystemException { final long blockCount = getAllocatedBlockCount(); final int indirectCount = getIndirectCount(); if(i != blockCount-1) throw new IOException("Only the last block of the inode can be freed." + "You were trying to free bl... |
long block512 = fs.getBlockSize()/512; setBlocks( getBlocks()-block512 ); | if (i != blockCount - 1) throw new IOException( "Only the last block of the inode can be freed." + "You were trying to free block nr. " + i + ", while inode contains " + +blockCount + " blocks."); | protected synchronized void freeDataBlock(long i) throws IOException, FileSystemException { final long blockCount = getAllocatedBlockCount(); final int indirectCount = getIndirectCount(); if(i != blockCount-1) throw new IOException("Only the last block of the inode can be freed." + "You were trying to free bl... |
setDirty(true); if(i<12) { indirectFree(Ext2Utils.get32(data,40+(int)i*4), 0, 0); Ext2Utils.set32(data, 40+(int)i*4, 0); return; } | desc.setLastAllocatedBlockIndex(i - 1); | protected synchronized void freeDataBlock(long i) throws IOException, FileSystemException { final long blockCount = getAllocatedBlockCount(); final int indirectCount = getIndirectCount(); if(i != blockCount-1) throw new IOException("Only the last block of the inode can be freed." + "You were trying to free bl... |
i-=12; if(i<indirectCount) { indirectFree( Ext2Utils.get32(data, 40+12*4), i, 1 ); if(i==0) Ext2Utils.set32(data, 40+12*4, 0); return; } i-=indirectCount; if(i<indirectCount * indirectCount) { indirectFree( Ext2Utils.get32(data, 40+13*4), i, 2 ); if(i==0) Ext2Utils.set32(data, 40+13*4, 0); return; } i-=indire... | freePreallocatedBlocks(); long block512 = fs.getBlockSize() / 512; setBlocks(getBlocks() - block512); setDirty(true); if (i < 12) { indirectFree(Ext2Utils.get32(data, 40 + (int) i * 4), 0, 0); Ext2Utils.set32(data, 40 + (int) i * 4, 0); return; } i -= 12; if (i < indirectCount) { indirectFree(Ext2Utils.get32(dat... | protected synchronized void freeDataBlock(long i) throws IOException, FileSystemException { final long blockCount = getAllocatedBlockCount(); final int indirectCount = getIndirectCount(); if(i != blockCount-1) throw new IOException("Only the last block of the inode can be freed." + "You were trying to free bl... |
final long blockCount = getAllocatedBlockCount(); final int indirectCount = getIndirectCount(); if(i > blockCount-1) throw new IOException( "Trying to read block "+i+" (counts from 0), while"+ " INode contains only "+blockCount+" blocks"); if(i<12) { log.debug("getDataBlockNr(): block nr: "+Ext2Utils.get32(data,40+(i... | final long blockCount = getAllocatedBlockCount(); final int indirectCount = getIndirectCount(); if (i > blockCount - 1) throw new IOException("Trying to read block " + i + " (counts from 0), while" + " INode contains only " + blockCount + " blocks"); | private long getDataBlockNr(long i) throws IOException { final long blockCount = getAllocatedBlockCount(); final int indirectCount = getIndirectCount(); if(i > blockCount-1) throw new IOException( "Trying to read block "+i+" (counts from 0), while"+ " INode contains only "+blockCount+" blocks"); //get... |
i-=12; if(i<indirectCount) return indirectRead( Ext2Utils.get32(data, 40+12*4), i, 1 ); i-=indirectCount; if(i<indirectCount * indirectCount) return indirectRead( Ext2Utils.get32(data, 40+13*4), i, 2 ); i-=indirectCount*indirectCount; if(i<indirectCount*indirectCount*indirectCount) return indirectRead( Ext2Utils... | if (i < 12) { log.debug("getDataBlockNr(): block nr: " + Ext2Utils.get32(data, 40 + (int) i * 4)); return Ext2Utils.get32(data, 40 + (int) i * 4); } i -= 12; if (i < indirectCount) return indirectRead(Ext2Utils.get32(data, 40 + 12 * 4), i, 1); i -= indirectCount; if (i < indirectCount * indirectCount) return indi... | private long getDataBlockNr(long i) throws IOException { final long blockCount = getAllocatedBlockCount(); final int indirectCount = getIndirectCount(); if(i > blockCount-1) throw new IOException( "Trying to read block "+i+" (counts from 0), while"+ " INode contains only "+blockCount+" blocks"); //get... |
byte[] data = fs.getBlock( dataBlockNr ); long blockIndex = offset / (long)Math.pow(getIndirectCount(), indirectionLevel-1); long blockOffset= offset % (long)Math.pow(getIndirectCount(), indirectionLevel-1); long blockNr = Ext2Utils.get32(data, (int)blockIndex*4); | byte[] data = fs.getBlock(dataBlockNr); | private final void indirectFree(long dataBlockNr, long offset, int indirectionLevel) throws IOException, FileSystemException { log.debug("indirectFree(datablockNr="+dataBlockNr+", offset="+offset+", ind="+indirectionLevel+")"); if(indirectionLevel==0) { fs.freeBlock( dataBlockNr ); return; } byte[] dat... |
indirectFree( blockNr, blockOffset, indirectionLevel-1); if(offset==0) { fs.freeBlock( dataBlockNr ); long block512 = fs.getBlockSize()/512; setBlocks( getBlocks()-block512 ); } } | long blockIndex = offset / (long) Math.pow(getIndirectCount(), indirectionLevel - 1); long blockOffset = offset % (long) Math.pow(getIndirectCount(), indirectionLevel - 1); long blockNr = Ext2Utils.get32(data, (int) blockIndex * 4); indirectFree(blockNr, blockOffset, indirectionLevel - 1); if (offset == 0) { fs.fr... | private final void indirectFree(long dataBlockNr, long offset, int indirectionLevel) throws IOException, FileSystemException { log.debug("indirectFree(datablockNr="+dataBlockNr+", offset="+offset+", ind="+indirectionLevel+")"); if(indirectionLevel==0) { fs.freeBlock( dataBlockNr ); return; } byte[] dat... |
private final void registerBlockIndex(long i, long blockNr) throws FileSystemException, IOException{ final long blockCount = getSizeInBlocks(); final int indirectCount = getIndirectCount(); long allocatedBlocks = i; if(i != blockCount) throw new FileSystemException( "Trying to register block "+i+" (counts from 0), when... | private final void registerBlockIndex(long i, long blockNr) throws FileSystemException, IOException { final long blockCount = getSizeInBlocks(); final int indirectCount = getIndirectCount(); long allocatedBlocks = i; if (i != blockCount) throw new FileSystemException("Trying to register block " + i + " (counts from 0),... | private final void registerBlockIndex(long i, long blockNr) throws FileSystemException, IOException{ final long blockCount = getSizeInBlocks(); final int indirectCount = getIndirectCount(); long allocatedBlocks = i; if(i != blockCount) throw new FileSystemException( "Trying to register block "+i+" (counts from ... |
indirectWrite( indirectBlockNr, i, allocatedBlocks, blockNr, 1 ); return; } | log.debug("registering block #" + blockNr); | private final void registerBlockIndex(long i, long blockNr) throws FileSystemException, IOException{ final long blockCount = getSizeInBlocks(); final int indirectCount = getIndirectCount(); long allocatedBlocks = i; if(i != blockCount) throw new FileSystemException( "Trying to register block "+i+" (counts from ... |
i-=indirectCount; final int doubleIndirectCount = indirectCount * indirectCount; if(i<doubleIndirectCount) { long doubleIndirectBlockNr; if(i==0) { doubleIndirectBlockNr = findFreeBlock(allocatedBlocks++); Ext2Utils.set32(data, 40+13*4, doubleIndirectBlockNr); | setDirty(true); | private final void registerBlockIndex(long i, long blockNr) throws FileSystemException, IOException{ final long blockCount = getSizeInBlocks(); final int indirectCount = getIndirectCount(); long allocatedBlocks = i; if(i != blockCount) throw new FileSystemException( "Trying to register block "+i+" (counts from ... |
if (i < 12) { Ext2Utils.set32(data, 40 + (int) i * 4, blockNr); return; } | private final void registerBlockIndex(long i, long blockNr) throws FileSystemException, IOException{ final long blockCount = getSizeInBlocks(); final int indirectCount = getIndirectCount(); long allocatedBlocks = i; if(i != blockCount) throw new FileSystemException( "Trying to register block "+i+" (counts from ... | |
byte[] zeroes=new byte[fs.getBlockSize()]; Arrays.fill(zeroes, 0, fs.getBlockSize(), (byte)0); fs.writeBlock(doubleIndirectBlockNr, zeroes, false); } else doubleIndirectBlockNr = Ext2Utils.get32(data, 40+13*4); | i -= 12; if (i < indirectCount) { long indirectBlockNr; if (i == 0) { indirectBlockNr = findFreeBlock(allocatedBlocks++); Ext2Utils.set32(data, 40 + 12 * 4, indirectBlockNr); | private final void registerBlockIndex(long i, long blockNr) throws FileSystemException, IOException{ final long blockCount = getSizeInBlocks(); final int indirectCount = getIndirectCount(); long allocatedBlocks = i; if(i != blockCount) throw new FileSystemException( "Trying to register block "+i+" (counts from ... |
indirectWrite( doubleIndirectBlockNr, i, allocatedBlocks, blockNr, 2 ); return; } final int tripleIndirectCount = indirectCount * indirectCount * indirectCount; i-=doubleIndirectCount; if(i<tripleIndirectCount) { long tripleIndirectBlockNr; if(i==0) { tripleIndirectBlockNr = findFreeBlock(allocatedBlocks++); Ext2U... | private final void registerBlockIndex(long i, long blockNr) throws FileSystemException, IOException{ final long blockCount = getSizeInBlocks(); final int indirectCount = getIndirectCount(); long allocatedBlocks = i; if(i != blockCount) throw new FileSystemException( "Trying to register block "+i+" (counts from ... | |
byte[] zeroes = new byte[fs.getBlockSize()]; Arrays.fill(zeroes, 0, fs.getBlockSize(), (byte) 0); fs.writeBlock(indirectBlockNr, zeroes, false); } else indirectBlockNr = Ext2Utils.get32(data, 40 + 12 * 4); | private final void registerBlockIndex(long i, long blockNr) throws FileSystemException, IOException{ final long blockCount = getSizeInBlocks(); final int indirectCount = getIndirectCount(); long allocatedBlocks = i; if(i != blockCount) throw new FileSystemException( "Trying to register block "+i+" (counts from ... | |
byte[] zeroes=new byte[fs.getBlockSize()]; Arrays.fill(zeroes, 0, fs.getBlockSize(), (byte)0); fs.writeBlock(tripleIndirectBlockNr, zeroes, false); } else tripleIndirectBlockNr = Ext2Utils.get32(data, 40+14*4); indirectWrite( tripleIndirectBlockNr, i, allocatedBlocks, blockNr, 3 ); return; } | indirectWrite(indirectBlockNr, i, allocatedBlocks, blockNr, 1); | private final void registerBlockIndex(long i, long blockNr) throws FileSystemException, IOException{ final long blockCount = getSizeInBlocks(); final int indirectCount = getIndirectCount(); long allocatedBlocks = i; if(i != blockCount) throw new FileSystemException( "Trying to register block "+i+" (counts from ... |
throw new FileSystemException("Internal FS exception: getDataBlockIndex(i="+i+")"); } | return; } i -= indirectCount; final int doubleIndirectCount = indirectCount * indirectCount; if (i < doubleIndirectCount) { long doubleIndirectBlockNr; if (i == 0) { doubleIndirectBlockNr = findFreeBlock(allocatedBlocks++); Ext2Utils.set32(data, 40 + 13 * 4, doubleIndirectBlockNr); byte[] zeroes = new byte[fs.... | private final void registerBlockIndex(long i, long blockNr) throws FileSystemException, IOException{ final long blockCount = getSizeInBlocks(); final int indirectCount = getIndirectCount(); long allocatedBlocks = i; if(i != blockCount) throw new FileSystemException( "Trying to register block "+i+" (counts from ... |
protected synchronized void update() throws IOException{ try{ if(dirty) { log.debug(" ** updating inode **"); desc.getINodeTable().writeInodeData( desc.getIndex(), data ); dirty=false; } }catch(FileSystemException fs) { throw new IOException(fs); } } | protected synchronized void update() throws IOException { try { if (dirty) { log.debug(" ** updating inode **"); desc.getINodeTable().writeInodeData(desc.getIndex(), data); dirty = false; } } catch (FileSystemException ex) { final IOException ioe = new IOException(); ioe.initCause(ex); throw ioe; } } | protected synchronized void update() throws IOException{ try{ if(dirty) { log.debug(" ** updating inode **"); desc.getINodeTable().writeInodeData( desc.getIndex(), data ); dirty=false; } }catch(FileSystemException fs) { throw new IOException(fs); } } |
htmlAttributeSet attributes = gnu.getAttributes(); | SimpleAttributeSet attributes = gnu.getAttributes(); | protected final void handleStartTag(TagElement tag) { htmlAttributeSet attributes = gnu.getAttributes(); if (tag.fictional()) attributes.addAttribute(ParserCallback.IMPLIED, Boolean.TRUE); callBack.handleStartTag(tag.getHTMLTag(), attributes, hTag.where.startPos... |
((Block)eldest.getValue()).flush(); | try{ ((Block)eldest.getValue()).flush(); CacheEvent event = new CacheEvent(eldest.getValue(),CacheEvent.REMOVED); Iterator listeners=cacheListeners.iterator(); while(listeners.hasNext()) { ((CacheListener)listeners.next()).elementRemoved(event); } }catch(IOException e) { log.error("Exception when flushing a block from... | protected boolean removeEldestEntry(Map.Entry eldest) { if(size()>MAX_SIZE) { ((Block)eldest.getValue()).flush(); return true; } else return false; } |
public Object next() { | public IndexEntry next() { | public Object next() { //log.debug("next: offset=" + offset); if (nextEntry == null) { //log.debug("next: islast"); throw new NoSuchElementException(); } else { final IndexEntry result = nextEntry; final int size = nextEntry.getSize(); //lo... |
public final Class getCategory() | public Class getCategory() | public final Class getCategory() { return RequestingUserName.class; } |
public final String getName() | public String getName() | public final String getName() { return "requesting-user-name"; } |
if (peer != null) peer.setVisible(false); | ComponentPeer currentPeer=peer; if (currentPeer != null) currentPeer.setVisible(false); | public void hide() { if (isVisible()) { if (peer != null) peer.setVisible(false); this.visible = false; invalidate(); ComponentEvent ce = new ComponentEvent(this,ComponentEvent.COMPONENT_HIDDEN); getToolkit().getSystemEventQueue().postEvent(ce); } } |
invalidate(); | Container currentParent = parent; if (currentParent != null) { currentParent.invalidate(); currentParent.repaint(); } | public void hide() { if (isVisible()) { if (peer != null) peer.setVisible(false); this.visible = false; invalidate(); ComponentEvent ce = new ComponentEvent(this,ComponentEvent.COMPONENT_HIDDEN); getToolkit().getSystemEventQueue().postEvent(ce); } } |
if (peer != null) peer.setVisible(true); invalidate(); | ComponentPeer currentPeer=peer; if (currentPeer != null) currentPeer.setVisible(true); Container currentParent = parent; if (currentParent != null) { currentParent.invalidate(); currentParent.repaint(); } | public void show() { // We must set visible before showing the peer. Otherwise the // peer could post paint events before visible is true, in which // case lightweight components are not initially painted -- // Container.paint first calls isShowing () before painting itself // and its children. if... |
if (longestLine == null) findLongestLine(0, element.getElementCount() - 1); | protected void updateDamage(DocumentEvent changes, Shape a, ViewFactory f) { // This happens during initialization. if (metrics == null) { updateMetrics(); preferenceChanged(null, true, true); return; } Element element = getElement(); ElementChange change = changes.getC... | |
throws NotImplementedException | protected void fireDragGestureRecognized(int dragAction, Point p) throws NotImplementedException { throw new Error("not implemented"); } | |
throw new Error("not implemented"); | if(dragGestureListener != null) dragGestureListener.dragGestureRecognized (new DragGestureEvent(this, dragAction, p, events)); | protected void fireDragGestureRecognized(int dragAction, Point p) throws NotImplementedException { throw new Error("not implemented"); } |
throw new Error("not implemented"); | events = new ArrayList(); | public void resetRecognizer() throws NotImplementedException { throw new Error("not implemented"); } |
ftf = new JFormattedTextField(); add(ftf); ftf.setValue(spinner.getValue()); | public DefaultEditor(JSpinner spinner) { this.spinner = spinner; spinner.addChangeListener(this); } | |
return null; } | return ftf; } | public JFormattedTextField getTextField() { return null; } /* TODO */ |
} | Insets insets = getInsets(); Dimension size = getSize(); ftf.setBounds(insets.left, insets.top, size.width - insets.left - insets.right, size.height - insets.top - insets.bottom); } | public void layoutContainer(Container parent) { } /* TODO */ |
return null; } | Insets insets = getInsets(); Dimension minSize = ftf.getMinimumSize(); return new Dimension(minSize.width + insets.left + insets.right, minSize.height + insets.top + insets.bottom); } | public Dimension minimumLayoutSize(Container parent) { return null; } /* TODO */ |
return null; } | Insets insets = getInsets(); Dimension prefSize = ftf.getPreferredSize(); return new Dimension(prefSize.width + insets.left + insets.right, prefSize.height + insets.top + insets.bottom); } | public Dimension preferredLayoutSize(Container parent) { return null; } /* TODO */ |
return new StubEditor(this); } } | if (model instanceof SpinnerDateModel) return new DateEditor(this); else if (model instanceof SpinnerNumberModel) return new NumberEditor(this); else return new DefaultEditor(this); } | protected JComponent createEditor(SpinnerModel model) { return new StubEditor(this); } /* TODO */} |
running = false; | public void run() { running = true; try { sleep(initialDelay); while (running) { try { sleep(delay); } catch (InterruptedException e) { return; } queueEvent(); if (logTimers) System.out.println("... | |
initialDelay = d; | public Timer(int d, ActionListener listener) { delay = d; if (listener != null) addActionListener(listener); } | |
for (int i = srcComponentsLength - 1; i >= 0; i--) | for (int i = srcComponentsLength - 2; i >= 0; i--) | public void compose(Raster src, Raster dstIn, WritableRaster dstOut) { // TODO: This implementation is very general and highly inefficient. There // are two possible ways to optimize this: // 1. Special cased implementations for common ColorModels and transfer // types. // 2. Native implementation.... |
public float[] getNormalizedComponents (Object pixel, float[] normComponents, int normOffset) | public float[] getNormalizedComponents(int[] components, int offset, float[] normComponents, int normOffset) | public float[] getNormalizedComponents (Object pixel, float[] normComponents, int normOffset) { // subclasses has to implement this method. throw new UnsupportedOperationException(); } |
throw new UnsupportedOperationException(); } | int numComponents = getNumComponents(); if (normComponents == null) { normComponents = new float[normOffset + numComponents]; } for (int i=0; i<numComponents; i++) { float in = components[offset++]; float out = in / ((1<<getComponentSize(i)) - 1); normComponents[normOffset++] = out; } return normComponents; } | public float[] getNormalizedComponents (Object pixel, float[] normComponents, int normOffset) { // subclasses has to implement this method. throw new UnsupportedOperationException(); } |
return super.hashCode (); | long hashCode = Double.doubleToLongBits(get(position())) + 31; long multiplier = 1; for (int i = position() + 1; i < limit(); ++i) { multiplier *= 31; hashCode += (Double.doubleToLongBits(get(i)) + 30)*multiplier; } return ((int)hashCode); | public int hashCode () { // FIXME: Check what SUN calculates here. return super.hashCode (); } |
final public static DoubleBuffer wrap (double[] array, int offset, int length) | public static final DoubleBuffer wrap (double[] array, int offset, int length) | final public static DoubleBuffer wrap (double[] array, int offset, int length) { return new DoubleBufferImpl (array, 0, array.length, offset + length, offset, -1, false); } |
private synchronized void addDirectoryRecord(Ext2DirectoryRecord dr) throws IOException, FileSystemException{ | private void addDirectoryRecord(Ext2DirectoryRecord dr) throws IOException, FileSystemException{ | private synchronized void addDirectoryRecord(Ext2DirectoryRecord dr) throws IOException, FileSystemException{ Ext2File dir = new Ext2File(iNode); //read itself as a file //find the last directory record (if any) Ext2FSEntryIterator iterator = new Ext2FSEntryIterator(iNode); Ext2DirectoryRecord rec=null; while(it... |
Ext2FSEntryIterator iterator = new Ext2FSEntryIterator(iNode); Ext2DirectoryRecord rec=null; while(iterator.hasNext()) { rec = iterator.nextDirectoryRecord(); | synchronized(iNode) { Ext2FSEntryIterator iterator = new Ext2FSEntryIterator(iNode); Ext2DirectoryRecord rec=null; while(iterator.hasNext()) { rec = iterator.nextDirectoryRecord(); } Ext2FileSystem fs = (Ext2FileSystem) getFileSystem(); if(rec!=null) { long lastPos = rec.getFileOffset(); long lastLen = rec.getRecLen(... | private synchronized void addDirectoryRecord(Ext2DirectoryRecord dr) throws IOException, FileSystemException{ Ext2File dir = new Ext2File(iNode); //read itself as a file //find the last directory record (if any) Ext2FSEntryIterator iterator = new Ext2FSEntryIterator(iNode); Ext2DirectoryRecord rec=null; while(it... |
Ext2FileSystem fs = (Ext2FileSystem) getFileSystem(); if(rec!=null) { long lastPos = rec.getFileOffset(); long lastLen = rec.getRecLen(); rec.truncateRecord(); long remainingLength = fs.getBlockSize() - (lastPos%fs.getBlockSize()) - rec.getRecLen(); log.debug("LAST-1 record: begins at: "+lastPos+", length: "+lastL... | private synchronized void addDirectoryRecord(Ext2DirectoryRecord dr) throws IOException, FileSystemException{ Ext2File dir = new Ext2File(iNode); //read itself as a file //find the last directory record (if any) Ext2FSEntryIterator iterator = new Ext2FSEntryIterator(iNode); Ext2DirectoryRecord rec=null; while(it... | |
public synchronized FSEntry createDirectoryEntry(String name) throws IOException { | public FSEntry createDirectoryEntry(String name) throws IOException { | public synchronized FSEntry createDirectoryEntry(String name) throws IOException { if(!canWrite()) throw new IOException("Filesystem or directory is mounted read-only!"); //create a new iNode for the file //TODO: access rights, file type, UID and GID should be passed through the FSDirectory interface INode n... |
public synchronized FSEntry createFileEntry(String name) throws IOException { | public FSEntry createFileEntry(String name) throws IOException { | public synchronized FSEntry createFileEntry(String name) throws IOException { if(!canWrite()) throw new IOException("Filesystem or directory is mounted read-only!"); //create a new iNode for the file //TODO: access rights, file type, UID and GID should be passed through the FSDirectory interface INode newINode; ... |
return; | public void writeExpression(Expression expr) { // Implementation note: Why is this method overwritten and nearly exactly // reimplemented as in Encoder? // The Encoder class can (and should be) subclassed by users outside of the // java.beans package. While I have doubts that this is possible from an ... | |
return null; | return currentWriter; | protected Thread getCurrentWriter() { // FIXME: Implement locking! return null; } |
content.insertString(offset, text); | writeLock(); UndoableEdit temp = content.insertString(offset, text); writeUnlock(); GapContent.UndoInsertString changes = null; if (content instanceof GapContent) changes = (GapContent.UndoInsertString) temp; | public void insertString(int offset, String text, AttributeSet attributes) throws BadLocationException { // Just return when no text to insert was given. if (text == null || text.length() == 0) return; DefaultDocumentEvent event = new DefaultDocumentEvent(offset, text.length(), Doc... |
if (changes != null) { Element root = getDefaultRootElement(); int start = root.getElementIndex(changes.where); int end = root.getElementIndex(changes.where+changes.length); if (!(start == 0 && end == 0)) { Element[] removed = new Element[1]; removed[0] = root; Element[] added = new Element[end - start + 1]; for (in... | public void insertString(int offset, String text, AttributeSet attributes) throws BadLocationException { // Just return when no text to insert was given. if (text == null || text.length() == 0) return; DefaultDocumentEvent event = new DefaultDocumentEvent(offset, text.length(), Doc... | |
if (currentWriter != null && currentWriter.equals(Thread.currentThread())) return; synchronized (documentCV) { while (currentWriter != null || numWritersWaiting > 0) { try { documentCV.wait(); } catch (InterruptedException ie) { throw new Error("interrupted trying to get a readLock"); } } numReaders++; } | public void readLock() { } | |
if (numReaders == 0) throw new IllegalStateException("document lock failure"); synchronized (documentCV) { if (currentWriter == null) { numReaders --; if (numReaders == 0 && numWritersWaiting != 0) documentCV.notify(); } } | public void readUnlock() { } | |
content.remove(offset, length); | Element[] added = new Element[1]; added[0] = root.getElement(start); boolean shouldFire = content.getString(offset, length).length() != 0; writeLock(); UndoableEdit temp = content.remove(offset, length); writeUnlock(); | public void remove(int offset, int length) throws BadLocationException { DefaultDocumentEvent event = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.REMOVE); removeUpdate(event); content.remove(offset, length); postRemoveUpdate(event); fireRemoveUpdate(event); } |
GapContent.UndoRemove changes = null; if (content instanceof GapContent) changes = (GapContent.UndoRemove) temp; if (changes != null && !(start == end)) { ElementEdit edit = new ElementEdit (root, start, removed, added); event.addEdit(edit); } if (shouldFire) | public void remove(int offset, int length) throws BadLocationException { DefaultDocumentEvent event = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.REMOVE); removeUpdate(event); content.remove(offset, length); postRemoveUpdate(event); fireRemoveUpdate(event); } | |
readLock(); try { runnable.run(); } finally { readUnlock(); } | public void render(Runnable runnable) { // FIXME: Implement me! } | |
if (currentWriter!= null && currentWriter.equals(Thread.currentThread())) return; synchronized (documentCV) { numWritersWaiting++; while (numReaders > 0) { try { documentCV.wait(); } catch (InterruptedException ie) { throw new Error("interruped while trying to obtain write lock"); } } numWritersWaiting --; currentWrite... | protected void writeLock() { // FIXME: Implement me. } | |
synchronized (documentCV) { if (currentWriter.equals(Thread.currentThread())) { currentWriter = null; documentCV.notifyAll(); } } | protected void writeUnlock() { // FIXME: Implement me. } | |
Component c = sfp.getAwtFrame().findComponentAt(x, y); | Component c = sfp.getAWTComponent().findComponentAt(x, y); | public Component getTopComponentAt(int x, int y) { Component comp = super.getTopComponentAt(x, y); SwingFrame sfp = (SwingFrame) SwingUtilities.getAncestorOfClass( SwingFrame.class, comp); if (sfp != null) { Rectangle r = sfp.getBounds(); Insets ins = sfp.getSwingPeer().getInsets(); r.x = r.... |
protected Item cloneConstant() { | protected WordItem cloneConstant() { | protected Item cloneConstant() { return createConst(getValue()); } |
LongLongSeqHolder h = new LongLongSeqHolder(); h._read(input); return h.value; | long[] value = new long[ input.read_long() ]; input.read_longlong_array(value, 0, value.length); return value; | public static long[] read(InputStream input) { LongLongSeqHolder h = new LongLongSeqHolder(); h._read(input); return h.value; } |
LongLongSeqHolder h = new LongLongSeqHolder(value); h._write(output); | output.write_long(value.length); output.write_longlong_array(value, 0, value.length); | public static void write(OutputStream output, long[] value) { LongLongSeqHolder h = new LongLongSeqHolder(value); h._write(output); } |
if (comp==rootPane) | if (!initStageDone) | protected void addImpl(Component comp, Object constraints, int index) { // If we're adding the rootPane (initialization stages) use super.add. // Otherwise pass the add onto the content pane. if (comp==rootPane) super.addImpl(comp, constraints, index); else { if (isRootPaneCheckingEnabl... |
s.setOpaque(true); | s.setOpaque(false); | protected void installDefaults(JSeparator s) { UIDefaults defaults = UIManager.getLookAndFeelDefaults(); shadow = defaults.getColor("Separator.shadow"); highlight = defaults.getColor("Separator.highlight"); s.setOpaque(true); } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.