bugged
stringlengths
6
599k
fixed
stringlengths
6
40.8M
__index_level_0__
int64
0
3.24M
public boolean isValid() { return true; }
public boolean isValid() { return true; }
38,913
public void setLastModified(long lastModified) throws IOException { throw new IOException("You cannot change /"); }
public void setLastModified(long lastModified) throws IOException { throw new IOException("You cannot change /"); }
38,914
public void setName(String newName) throws IOException { throw new IOException("You cannot rename /"); }
public void setName(String newName) throws IOException { throw new IOException("You cannot rename /"); }
38,915
public FSEntry addDirectory(String name) throws IOException { throw new IOException("You cannot modify /"); }
public FSEntry addDirectory(String name) throws IOException { throw new IOException("You cannot modify /"); }
38,916
public FSEntry addFile(String name) throws IOException { throw new IOException("You cannot modify /"); }
public FSEntry addFile(String name) throws IOException { throw new IOException("You cannot modify /"); }
38,917
public void flush() throws IOException { //do nothing }
public void flush() throws IOException { //do nothing }
38,918
public FSEntry getEntry(String name) throws IOException { for(FSEntryIterator it = iterator() ; it.hasNext() ; ) { FSEntry entry = it.next(); if(entry.getName().equals(name)) return entry; } throw new IOException("Entry not found: "+name); }
public FSEntry getEntry(String name) throws IOException { for(FSEntryIterator it = iterator() ; it.hasNext() ; ) { FSEntry entry = it.next(); if(entry.getName().equals(name)) return entry; } throw new IOException("Entry not found: "+name); }
38,919
public FileSystem getFileSystem() { return null; }
public FileSystem getFileSystem() { return null; }
38,920
public boolean isValid() { return true; }
public boolean isValid() { return true; }
38,921
public FSEntryIterator iterator() { return new RootsIterator(fsm.fileSystemRoots().iterator()); }
public FSEntryIterator iterator() { return new RootsIterator(fsm.fileSystemRoots().iterator()); }
38,922
public void remove(String name) throws IOException { throw new IOException("You cannot modify /"); }
public void remove(String name) throws IOException { throw new IOException("You cannot modify /"); }
38,923
public FSAccessRights getAccessRights() throws IOException { return underlying.getAccessRights(); }
public FSAccessRights getAccessRights() throws IOException { return underlying.getAccessRights(); }
38,924
public FSDirectory getDirectory() throws IOException { return underlying.getDirectory(); }
public FSDirectory getDirectory() throws IOException { return underlying.getDirectory(); }
38,925
public FSFile getFile() throws IOException { return underlying.getFile(); }
public FSFile getFile() throws IOException { return underlying.getFile(); }
38,926
public FileSystem getFileSystem() { return underlying.getFileSystem(); }
public FileSystem getFileSystem() { return underlying.getFileSystem(); }
38,927
public long getLastModified() throws IOException { return underlying.getLastModified(); }
public long getLastModified() throws IOException { return underlying.getLastModified(); }
38,928
public String getName() { return name; }
public String getName() { return name; }
38,929
public FSDirectory getParent() { return underlying.getParent(); }
public FSDirectory getParent() { return underlying.getParent(); }
38,930
public boolean isDirectory() { return underlying.isDirectory(); }
public boolean isDirectory() { return underlying.isDirectory(); }
38,931
public boolean isDirty() throws IOException { return underlying.isDirty(); }
public boolean isDirty() throws IOException { return underlying.isDirty(); }
38,932
public boolean isFile() { return underlying.isFile(); }
public boolean isFile() { return underlying.isFile(); }
38,933
public boolean isValid() { return underlying.isValid(); }
public boolean isValid() { return underlying.isValid(); }
38,934
public void setLastModified(long lastModified) throws IOException { throw new IOException("You cannot modify a root name"); }
public void setLastModified(long lastModified) throws IOException { throw new IOException("You cannot modify a root name"); }
38,935
public void setName(String newName) throws IOException { throw new IOException("You cannot modify a root name"); }
public void setName(String newName) throws IOException { throw new IOException("You cannot modify a root name"); }
38,936
public virtualFSEntry(String rootName) { try { underlying = fsm.getFileSystem(rootName).getRootEntry(); name = rootName; } catch (IOException e) { e.printStackTrace(); } }
public virtualFSEntry(String rootName) { try { underlying = fsm.getFileSystem(rootName).getRootEntry(); name = rootName; } catch (IOException e) { e.printStackTrace(); } }
38,937
public FileSystemAPIImpl(FileSystemManager fsm) { this.fsm = fsm; this.entryCache = new FSEntryCache(fsm); this.fhm = new FileHandleManager(); }
public FileSystemAPIImpl(FileSystemManager fsm) { this.fsm = fsm; this.entryCache = new FSEntryCache(fsm); this.fhm = new FileHandleManager(); }
38,938
public boolean canRead(String file) { // TODO implement me return true; }
public boolean canRead(String file) { // TODO implement me return true; }
38,939
public boolean canWrite(String file) { // TODO implement me return false; }
public boolean canWrite(String file) { // TODO implement me return false; }
38,940
public void delete(String file) throws IOException { final FSDirectory parentDirectory = getParentDirectoryEntry(file); if (parentDirectory == null) { throw new IOException("Parent of " + file + " not found"); } parentDirectory.remove(getName(file)); entryCache.removeEntries(f...
public void delete(String file) throws IOException { final FSDirectory parentDirectory = getParentDirectoryEntry(file); if (parentDirectory == null) { throw new IOException("Parent of " + file + " not found"); } parentDirectory.remove(getName(file)); entryCache.removeEntries(f...
38,941
public boolean fileExists(String file) { final FSEntry entry = getEntry(file); return (entry != null); }
public boolean fileExists(String file) { final FSEntry entry = getEntry(file); return (entry != null); }
38,942
private FSEntry getEntry(String path) { try { if(path == null) { return null; } if (File.separator.equals(path)) return new VirtualRoot(); FSEntry entry = entryCache.getEntry(path); if (entry != null) { return entry; } final FSDirectory paren...
private FSEntry getEntry(String path) { try { if(path == null) { return null; } if (File.separator.equals(path)) return new VirtualRoot(); FSEntry entry = entryCache.getEntry(path); if (entry != null) { return entry; } final FSDirectory paren...
38,943
private FSEntry getEntry(String path) { try { if(path == null) { return null; } if (File.separator.equals(path)) return new VirtualRoot(); FSEntry entry = entryCache.getEntry(path); if (entry != null) { return entry; } final FSDirectory paren...
private FSEntry getEntry(String path) { try { if(path == null) { return null; } if (File.separator.equals(path)) return new VirtualRoot(); FSEntry entry = entryCache.getEntry(path); if (entry != null) { return entry; } final FSDirectory paren...
38,944
private FSEntry getEntry(String path) { try { if(path == null) { return null; } if (File.separator.equals(path)) return new VirtualRoot(); FSEntry entry = entryCache.getEntry(path); if (entry != null) { return entry; } final FSDirectory paren...
private FSEntry getEntry(String path) { try { if(path == null) { return null; } if (File.separator.equals(path)) return new VirtualRoot(); FSEntry entry = entryCache.getEntry(path); if (entry != null) { return entry; } final FSDirectory paren...
38,945
private FSEntry getEntry(String path) { try { if(path == null) { return null; } if (File.separator.equals(path)) return new VirtualRoot(); FSEntry entry = entryCache.getEntry(path); if (entry != null) { return entry; } final FSDirectory paren...
private FSEntry getEntry(String path) { try { if(path == null) { return null; if (path.length() == 0) { return new VirtualRoot(); } FSEntry entry = entryCache.getEntry(path); if (entry != null) { return entry; } final FSDirectory parentEntry = getParentDirectoryEntry(p...
38,946
public long getLastModified(String file) { final FSEntry entry = getEntry(file); if (entry != null) { try { return entry.getLastModified(); } catch (IOException ex) { return 0; } } else { return 0; } }
public long getLastModified(String file) { final FSEntry entry = getEntry(file); if (entry != null) { try { return entry.getLastModified(); } catch (IOException ex) { return 0; } } else { return 0; } }
38,947
public long getLength(String file) { final FSEntry entry = getEntry(file); if (entry != null) { if (entry.isFile()) { try { return entry.getFile().getLength(); } catch (IOException ex) { log.debug("Error in getLength", ex); return 0; } } else { log.debug("Not a file in getLength"); ret...
public long getLength(String file) { final FSEntry entry = getEntry(file); if (entry != null) { if (entry.isFile()) { try { return entry.getFile().getLength(); } catch (IOException ex) { log.debug("Error in getLength", ex); return 0; } } else { log.debug("Not a file in getLength"); ret...
38,948
public long getLength(String file) { final FSEntry entry = getEntry(file); if (entry != null) { if (entry.isFile()) { try { return entry.getFile().getLength(); } catch (IOException ex) { log.debug("Error in getLength", ex); return 0; } } else { log.debug("Not a file in getLength"); ret...
public long getLength(String file) { final FSEntry entry = getEntry(file); if (entry != null) { if (entry.isFile()) { try { return entry.getFile().getLength(); } catch (IOException ex) { log.debug("Error in getLength", ex); return 0; } } else { log.debug("Not a file in getLength"); ret...
38,949
private String getName(String path) { if(path == null) { return null; } int idx = path.lastIndexOf(File.separatorChar); return (idx >= 0) ? path.substring(idx + 1) : path; }
private String getName(String path) { if(path == null) { return null; } int idx = path.lastIndexOf(File.separatorChar); return (idx >= 0) ? path.substring(idx + 1) : path; }
38,950
private String getName(String path) { if(path == null) { return null; } int idx = path.lastIndexOf(File.separatorChar); return (idx >= 0) ? path.substring(idx + 1) : path; }
private String getName(String path) { if(path == null) { return null; } int idx = path.lastIndexOf(File.separatorChar); return (idx >= 0) ? path.substring(idx + 1) : path; }
38,951
private FSDirectory getParentDirectoryEntry(String file) throws IOException{ if(file==null){ return null; } final FSEntry dirEntry = getEntry(getParentPath(file)); if (dirEntry == null) { return null; } if (!dirEntry.isDirectory()) { return null; } return dirEntry.getDirectory(); }
private FSDirectory getParentDirectoryEntry(String file) throws IOException{ if(file==null){ return null; } final FSEntry dirEntry = getEntry(getParentPath(file)); if (dirEntry == null) { return null; } if (!dirEntry.isDirectory()) { return null; } return dirEntry.getDirectory(); }
38,952
private String getParentPath(String path) { if(path == null) { return null; } int idx = path.lastIndexOf(File.separatorChar); return (idx >= 0) ? path.substring(0, idx) : null; }
private String getParentPath(String path) { if(path == null) { return null; } int idx = path.lastIndexOf(File.separatorChar); return (idx >= 0) ? path.substring(0, idx) : null; }
38,953
private String getParentPath(String path) { if(path == null) { return null; } int idx = path.lastIndexOf(File.separatorChar); return (idx >= 0) ? path.substring(0, idx) : null; }
private String getParentPath(String path) { if(path == null) { return null; } int idx = path.lastIndexOf(File.separatorChar); return (idx >= 0) ? path.substring(0, idx) : null; }
38,954
public File[] getRoots() { final Set<String> rootSet = fsm.fileSystemRoots(); final File[] list = new File[rootSet.size()]; final Iterator<String> i = rootSet.iterator(); for (int j = 0; j < list.length; j++) { list[j] = new File(i.next()); } return list; }
public File[] getRoots() { final Set<String> rootSet = fsm.fileSystemRoots(); final File[] list = new File[rootSet.size()]; final Iterator<String> i = rootSet.iterator(); for (int j = 0; j < list.length; j++) { list[j] = new File(i.next()); } return list; }
38,955
public boolean isDirectory(String file) { final FSEntry entry = getEntry(file); return (entry != null) && (entry.isDirectory()); }
public boolean isDirectory(String file) { final FSEntry entry = getEntry(file); return (entry != null) && (entry.isDirectory()); }
38,956
public boolean isFile(String file) { final FSEntry entry = getEntry(file); return (entry != null) && (entry.isFile()); }
public boolean isFile(String file) { final FSEntry entry = getEntry(file); return (entry != null) && (entry.isFile()); }
38,957
public String[] list(String directory) throws IOException { final FSEntry entry = getEntry(directory); if (entry == null) { throw new FileNotFoundException(directory); } if (!entry.isDirectory()) { throw new IOException("Cannot list on non-directories " + directory); } final ArrayList<String> list = new Arra...
public String[] list(String directory) throws IOException { final FSEntry entry = getEntry(directory); if (entry == null) { throw new FileNotFoundException(directory); } if (!entry.isDirectory()) { throw new IOException("Cannot list on non-directories " + directory); } final ArrayList<String> list = new Arra...
38,958
public String[] list(String directory) throws IOException { final FSEntry entry = getEntry(directory); if (entry == null) { throw new FileNotFoundException(directory); } if (!entry.isDirectory()) { throw new IOException("Cannot list on non-directories " + directory); } final ArrayList<String> list = new Arra...
public String[] list(String directory) throws IOException { final FSEntry entry = getEntry(directory); if (entry == null) { throw new FileNotFoundException(directory); } if (!entry.isDirectory()) { throw new IOException("Cannot list on non-directories " + directory); } final ArrayList<String> list = new Arra...
38,959
public boolean mkDir(String file, VMOpenMode mode) throws IOException { FSEntry entry = getEntry(file); if ((entry != null) || !mode.canWrite()) { return false; } FSDirectory directory = getParentDirectoryEntry(file); if(directory == null) return false; // Ok, add the dir entry = directory.addDirectory...
public boolean mkDir(String file, VMOpenMode mode) throws IOException { FSEntry entry = getEntry(file); if ((entry != null) || !mode.canWrite()) { return false; } FSDirectory directory = getParentDirectoryEntry(file); if(directory == null) return false; // Ok, add the dir entry = directory.addDirectory...
38,960
public boolean mkFile(String file, VMOpenMode mode) throws IOException { FSEntry entry = getEntry(file); if ((entry != null) || !mode.canWrite()) { return false; } FSDirectory directory = getParentDirectoryEntry(file); if(directory == null) return false; // Ok, make the file entry = directory.ad...
public boolean mkFile(String file, VMOpenMode mode) throws IOException { FSEntry entry = getEntry(file); if ((entry != null) || !mode.canWrite()) { return false; } FSDirectory directory = getParentDirectoryEntry(file); if(directory == null) return false; // Ok, make the file entry = directory.ad...
38,961
public boolean mkFile(String file, VMOpenMode mode) throws IOException { FSEntry entry = getEntry(file); if ((entry != null) || !mode.canWrite()) { return false; } FSDirectory directory = getParentDirectoryEntry(file); if(directory == null) return false; // Ok, make the file entry = directory.ad...
public boolean mkFile(String file, VMOpenMode mode) throws IOException { FSEntry entry = getEntry(file); if ((entry != null) || !mode.canWrite()) { return false; } FSDirectory directory = getParentDirectoryEntry(file); if(directory == null) return false; // Ok, make the file entry = directory.ad...
38,962
public VMFileHandle open(String file, VMOpenMode mode) throws IOException { FSEntry entry = getEntry(file); if ((entry != null) && !entry.isFile()) { throw new IOException("Not a file " + file); } if (entry == null) { if (mode.canWrite()) { // Try to create the file FSDirectory parent = getPa...
public VMFileHandle open(String file, VMOpenMode mode) throws IOException { FSEntry entry = getEntry(file); if ((entry != null) && !entry.isFile()) { throw new IOException("Not a file " + file); } if (entry == null) { if (mode.canWrite()) { // Try to create the file FSDirectory parent = getPa...
38,963
public VMFileHandle open(String file, VMOpenMode mode) throws IOException { FSEntry entry = getEntry(file); if ((entry != null) && !entry.isFile()) { throw new IOException("Not a file " + file); } if (entry == null) { if (mode.canWrite()) { // Try to create the file FSDirectory parent = getPa...
public VMFileHandle open(String file, VMOpenMode mode) throws IOException { FSEntry entry = getEntry(file); if ((entry != null) && !entry.isFile()) { throw new IOException("Not a file " + file); } if (entry == null) { if (mode.canWrite()) { // Try to create the file FSDirectory parent = getPa...
38,964
public void rootRemoved(String root) { entryCache.removeEntries(root); }
public void rootRemoved(String root) { entryCache.removeEntries(root); }
38,965
public void setLastModified(String file, long time) throws IOException { final FSEntry entry = getEntry(file); if (entry != null) { entry.setLastModified(time); } else { throw new FileNotFoundException(file); } }
public void setLastModified(String file, long time) throws IOException { final FSEntry entry = getEntry(file); if (entry != null) { entry.setLastModified(time); } else { throw new FileNotFoundException(file); } }
38,966
public void setReadOnly(String file) throws IOException { throw new IOException("Not implemented yet"); // TODO implement me }
public void setReadOnly(String file) throws IOException { throw new IOException("Not implemented yet"); // TODO implement me }
38,967
public static final SSLContext getInstance(String protocol) throws NoSuchAlgorithmException { Provider[] provs = Security.getProviders(); for (int i = 0; i < provs.length; i++) { try { return getInstance(protocol, provs[i]); } catch (NoSuchAlgorithmException i...
public static final SSLContext getInstance(String protocol) throws NoSuchAlgorithmException { Provider[] provs = Security.getProviders(); for (int i = 0; i < provs.length; i++) { try { return getInstance(protocol, provs[i]); } catch (NoSuchAlgorithmException i...
38,968
public static final SSLContext getInstance(String protocol) throws NoSuchAlgorithmException { Provider[] provs = Security.getProviders(); for (int i = 0; i < provs.length; i++) { try { return getInstance(protocol, provs[i]); } catch (NoSuchAlgorithmException i...
public static final SSLContext getInstance(String protocol) throws NoSuchAlgorithmException { Provider[] provs = Security.getProviders(); for (int i = 0; i < provs.length; i++) { try { return getInstance(protocol, p[i]); } catch (NoSuchAlgorithmException ignor...
38,969
public static final SSLContext getInstance(String protocol) throws NoSuchAlgorithmException { Provider[] provs = Security.getProviders(); for (int i = 0; i < provs.length; i++) { try { return getInstance(protocol, provs[i]); } catch (NoSuchAlgorithmException i...
public static final SSLContext getInstance(String protocol) throws NoSuchAlgorithmException { Provider[] provs = Security.getProviders(); for (int i = 0; i < provs.length; i++) { try { return getInstance(protocol, provs[i]); } catch (NoSuchAlgorithmException x...
38,970
public static final SSLContext getInstance(String protocol) throws NoSuchAlgorithmException { Provider[] provs = Security.getProviders(); for (int i = 0; i < provs.length; i++) { try { return getInstance(protocol, provs[i]); } catch (NoSuchAlgorithmException i...
public static final SSLContext getInstance(String protocol) throws NoSuchAlgorithmException { Provider[] provs = Security.getProviders(); for (int i = 0; i < provs.length; i++) { try { return getInstance(protocol, provs[i]); if (lastException != null) throw lastExcep...
38,971
public void newPixels() { if (animated == true) { ImageConsumer ic; Enumeration e = consumers.elements(); for (; e.hasMoreElements();) { ic = (ImageConsumer) e.nextElement(); sendPicture(ic); ic.imageComplete(ImageConsumer.SINGLEFRAME); } } }
public void newPixels() { if (animated == true) { ImageConsumer ic; Enumeration e = consumers.elements(); for (; e.hasMoreElements();) { ic = (ImageConsumer) e.nextElement(); sendPicture(ic); ic.imageComplete(ImageConsumer.SINGLEFRAME); } } }
38,972
public void newPixels() { if (animated == true) { ImageConsumer ic; Enumeration e = consumers.elements(); for (; e.hasMoreElements();) { ic = (ImageConsumer) e.nextElement(); sendPicture(ic); ic.imageComplete(ImageConsumer.SINGLEFRAME); } } }
public void newPixels() { if (animated == true) { ImageConsumer ic; Enumeration e = consumers.elements(); for (; e.hasMoreElements();) { ic = (ImageConsumer) e.nextElement(); sendPicture(ic); ic.imageComplete(ImageConsumer.SINGLEFRAME); } } }
38,973
public void requestTopDownLeftRightResend(ImageConsumer ic) { startProduction(ic); }
public void requestTopDownLeftRightResend(ImageConsumer ic) { startProduction(ic); }
38,974
private void sendPicture(ImageConsumer ic) { ic.setHints(ImageConsumer.TOPDOWNLEFTRIGHT); if (props != null) { ic.setProperties(props); } if (pixeli != null) { ic.setPixels(0, 0, width, height, cm, pixeli, offset, scansize); } else { ic.setPixels(0, 0, width, height, cm, pixelb, offset, scansize); } }
private void sendPicture(ImageConsumer ic) { ic.setHints(ImageConsumer.TOPDOWNLEFTRIGHT); if (props != null) { ic.setProperties(props); } if (pixeli != null) { ic.setPixels(0, 0, width, height, cm, pixeli, offset, scansize); } else { ic.setPixels(0, 0, width, height, cm, pixelb, offset, scansize); } }
38,975
private void sendPicture(ImageConsumer ic) { ic.setHints(ImageConsumer.TOPDOWNLEFTRIGHT); if (props != null) { ic.setProperties(props); } if (pixeli != null) { ic.setPixels(0, 0, width, height, cm, pixeli, offset, scansize); } else { ic.setPixels(0, 0, width, height, cm, pixelb, offset, scansize); } }
private void sendPicture(ImageConsumer ic) { ic.setHints(ImageConsumer.TOPDOWNLEFTRIGHT); if (props != null) { ic.setProperties(props); } if (pixeli != null) { ic.setPixels(0, 0, width, height, cm, pixeli, offset, scansize); } else { ic.setPixels(0, 0, width, height, cm, pixelb, offset, scansize); } }
38,976
private void sendPicture(ImageConsumer ic) { ic.setHints(ImageConsumer.TOPDOWNLEFTRIGHT); if (props != null) { ic.setProperties(props); } if (pixeli != null) { ic.setPixels(0, 0, width, height, cm, pixeli, offset, scansize); } else { ic.setPixels(0, 0, width, height, cm, pixelb, offset, scansize); } }
private void sendPicture(ImageConsumer ic) { ic.setHints(ImageConsumer.TOPDOWNLEFTRIGHT); if (props != null) { ic.setProperties(props); } if (pixeli != null) { ic.setPixels(0, 0, width, height, cm, pixeli, offset, scansize); } else { ic.setPixels(0, 0, width, height, cm, pixelb, offset, scansize); } }
38,977
public synchronized void setAnimated(boolean animated) { this.animated = animated; }
public synchronized void setAnimated(boolean animated) { this.animated = animated; }
38,978
public synchronized void setFullBufferUpdates(boolean fullbuffers) { this.fullbuffers = fullbuffers; }
public synchronized void setFullBufferUpdates(boolean fullbuffers) { this.fullbuffers = fullbuffers; }
38,979
public void startProduction(ImageConsumer ic) { if (!(consumers.containsKey(ic))) { consumers.put(ic, ic); } Enumeration e = consumers.elements(); for (; e.hasMoreElements();) { ic = (ImageConsumer) e.nextElement(); sendPicture(ic); ic.imageComplete(ImageConsumer.SINGLEFRAME); } }
public void startProduction(ImageConsumer ic) { if (!(consumers.containsKey(ic))) { consumers.put(ic, ic); } Enumeration e = consumers.elements(); for (; e.hasMoreElements();) { ic = (ImageConsumer) e.nextElement(); sendPicture(ic); ic.imageComplete(ImageConsumer.SINGLEFRAME); } }
38,980
public void stateChanged(ChangeEvent e) { // System.err.println(this + ".stateChanged()"); calculatePreferredSize(); getThumbBounds(); scrollbar.repaint(); }
publicvoidstateChanged(ChangeEvente){//System.err.println(this+".stateChanged()");calculatePreferredSize();getThumbBounds();scrollbar.repaint();}
38,981
public void stateChanged(ChangeEvent e) { // System.err.println(this + ".stateChanged()"); calculatePreferredSize(); getThumbBounds(); scrollbar.repaint(); }
public void stateChanged(ChangeEvent e) { // System.err.println(this + ".stateChanged()"); calculatePreferredSize(); updateThumbRect(); scrollbar.repaint(); }
38,982
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals("model")) { ((BoundedRangeModel) e.getOldValue()).removeChangeListener(modelListener); scrollbar.getModel().addChangeListener(modelListener); getThumbBounds(); } else if (e.getPropertyName().equals("o...
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals("model")) { ((BoundedRangeModel) e.getOldValue()).removeChangeListener(modelListener); scrollbar.getModel().addChangeListener(modelListener); updateThumbRect(); } else if (e.getPropertyName().equals("...
38,983
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals("model")) { ((BoundedRangeModel) e.getOldValue()).removeChangeListener(modelListener); scrollbar.getModel().addChangeListener(modelListener); getThumbBounds(); } else if (e.getPropertyName().equals("o...
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals("model")) { ((BoundedRangeModel) e.getOldValue()).removeChangeListener(modelListener); scrollbar.getModel().addChangeListener(modelListener); getThumbBounds(); } else if (e.getPropertyName().equals("o...
38,984
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals("model")) { ((BoundedRangeModel) e.getOldValue()).removeChangeListener(modelListener); scrollbar.getModel().addChangeListener(modelListener); getThumbBounds(); } else if (e.getPropertyName().equals("o...
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals("model")) { ((BoundedRangeModel) e.getOldValue()).removeChangeListener(modelListener); scrollbar.getModel().addChangeListener(modelListener); getThumbBounds(); } else if (e.getPropertyName().equals("o...
38,985
public void mouseReleased(MouseEvent e) { scrollTimer.stop(); scrollTimer.setDelay(300); currentMouseX = e.getX(); currentMouseY = e.getY(); int value; if (scrollbar.getOrientation() == SwingConstants.HORIZONTAL) value = valueForXPosition(currentMouseX); else ...
public void mouseReleased(MouseEvent e) { scrollTimer.stop(); scrollTimer.setDelay(300); currentMouseX = e.getX(); currentMouseY = e.getY(); int value; if (scrollbar.getOrientation() == SwingConstants.HORIZONTAL) value = valueForXPosition(currentMouseX); else ...
38,986
void calculatePreferredSize() { // System.err.println(this + ".calculatePreferredSize()"); int height; int width; height = width = 0; if (scrollbar.getOrientation() == SwingConstants.HORIZONTAL) { width += incrButton.getPreferredSize().getWidth(); width += decrButton.getPreferredSize().getWidth()...
voidcalculatePreferredSize(){//System.err.println(this+".calculatePreferredSize()");intheight;intwidth;height=width=0;if(scrollbar.getOrientation()==SwingConstants.HORIZONTAL){ width+=incrButton.getPreferredSize().getWidth(); width+=decrButton.getPreferredSize().getWidth(); width+=(scrollbar.getMaximum()-scrollbar.getM...
38,987
protected JButton createDecreaseButton(int orientation) { if (decrButton == null) decrButton = new BasicArrowButton(orientation); else ((BasicArrowButton) decrButton).setDirection(orientation); return decrButton; }
protected JButton createDecreaseButton(int orientation) { if (decrButton == null) decrButton = new BasicArrowButton(orientation); else ((BasicArrowButton) decrButton).setDirection(orientation); return decrButton; }
38,988
protected JButton createIncreaseButton(int orientation) { if (incrButton == null) incrButton = new BasicArrowButton(orientation); else ((BasicArrowButton) incrButton).setDirection(orientation); return incrButton; }
protected JButton createIncreaseButton(int orientation) { if (incrButton == null) incrButton = new BasicArrowButton(orientation); else ((BasicArrowButton) incrButton).setDirection(orientation); return incrButton; }
38,989
public Dimension getMaximumSize(JComponent c) { return getPreferredSize(c); }
public Dimension getMaximumSize(JComponent c) { return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE); }
38,990
protected Rectangle getThumbBounds() { int max = scrollbar.getMaximum(); int min = scrollbar.getMinimum(); int value = scrollbar.getValue(); int extent = scrollbar.getVisibleAmount(); // System.err.println(this + ".getThumbBounds()"); if (max == min) { thumbRect.x = trackRect.x; thumbRect.y = ...
protected Rectangle getThumbBounds() { int max = scrollbar.getMaximum(); int min = scrollbar.getMinimum(); int value = scrollbar.getValue(); int extent = scrollbar.getVisibleAmount(); // System.err.println(this + ".getThumbBounds()"); if (max == min) { thumbRect.x = trackRect.x; thumbRect.y = ...
38,991
protected Rectangle getTrackBounds() { SwingUtilities.calculateInnerArea(scrollbar, trackRect); if (scrollbar.getOrientation() == SwingConstants.HORIZONTAL) { trackRect.width -= incrButton.getPreferredSize().getWidth(); trackRect.width -= decrButton.getPreferredSize().getWidth(); trackRect.x += decrButton...
protected Rectangle getTrackBounds() { SwingUtilities.calculateInnerArea(scrollbar, trackRect); if (scrollbar.getOrientation() == SwingConstants.HORIZONTAL) { trackRect.width -= incrButton.getPreferredSize().getWidth(); trackRect.width -= decrButton.getPreferredSize().getWidth(); trackRect.x += decrButton...
38,992
protected void installComponents() { int orientation = scrollbar.getOrientation(); switch (orientation) { case (JScrollBar.HORIZONTAL): incrButton = createIncreaseButton(EAST); decrButton = createDecreaseButton(WEST); break; default: incrButton = createIncreaseButton(...
protected void installComponents() { int orientation = scrollbar.getOrientation(); switch (orientation) { case (JScrollBar.HORIZONTAL): incrButton = createIncreaseButton(EAST); decrButton = createDecreaseButton(WEST); break; default: incrButton = createIncreaseButton(...
38,993
public void installUI(JComponent c) { super.installUI(c); if (c instanceof JScrollBar) { scrollbar = (JScrollBar) c; trackRect = new Rectangle(); thumbRect = new Rectangle(); scrollTimer = new Timer(300, null); installComponents(); installDefaults(); configureScrollBarColors(); installListeners(); calcula...
public void installUI(JComponent c) { super.installUI(c); if (c instanceof JScrollBar) { scrollbar = (JScrollBar) c; trackRect = new Rectangle(); thumbRect = new Rectangle(); scrollTimer = new Timer(300, null); installComponents(); installDefaults(); configureScrollBarColors(); installListeners(); calcula...
38,995
protected void layoutHScrollbar(JScrollBar sb) { // All we have to do is layout the 2 buttons? Rectangle vr = new Rectangle(); SwingUtilities.calculateInnerArea(scrollbar, vr); // Update the rectangles. getTrackBounds(); getThumbBounds(); Dimension incrDims = incrButton.getPreferredSize(); Di...
protectedvoidlayoutHScrollbar(JScrollBarsb){//Allwehavetodoislayoutthe2buttons?Rectanglevr=newRectangle();SwingUtilities.calculateInnerArea(scrollbar,vr);//Updatetherectangles.getTrackBounds();getThumbBounds();DimensionincrDims=incrButton.getPreferredSize();DimensiondecrDims=decrButton.getPreferredSize();decrButton.set...
38,996
protected void layoutHScrollbar(JScrollBar sb) { // All we have to do is layout the 2 buttons? Rectangle vr = new Rectangle(); SwingUtilities.calculateInnerArea(scrollbar, vr); // Update the rectangles. getTrackBounds(); getThumbBounds(); Dimension incrDims = incrButton.getPreferredSize(); Di...
protected void layoutHScrollbar(JScrollBar sb) { // All we have to do is layout the 2 buttons? Rectangle vr = new Rectangle(); SwingUtilities.calculateInnerArea(scrollbar, vr); // Update the rectangles. getTrackBounds(); getThumbBounds(); Dimension incrDims = incrButton.getPreferredSize(); Di...
38,997
protected void layoutVScrollbar(JScrollBar sb) { Rectangle vr = new Rectangle(); SwingUtilities.calculateInnerArea(scrollbar, vr); // Update rectangles getTrackBounds(); getThumbBounds(); Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); d...
protected void layoutVScrollbar(JScrollBar sb) { Rectangle vr = new Rectangle(); SwingUtilities.calculateInnerArea(scrollbar, vr); // Update rectangles getTrackBounds(); getThumbBounds(); Dimension incrDims = incrButton.getPreferredSize(); Dimension decrDims = decrButton.getPreferredSize(); d...
38,999
protected void uninstallComponents() { scrollbar.remove(incrButton); scrollbar.remove(decrButton); incrButton = null; decrButton = null; }
protected void uninstallComponents() { scrollbar.remove(incrButton); scrollbar.remove(decrButton); incrButton = null; decrButton = null; }
39,001
protected void uninstallDefaults() { scrollbar.setForeground(null); scrollbar.setBackground(null); scrollbar.setBorder(null); }
protected void uninstallDefaults() { scrollbar.setForeground(null); scrollbar.setBackground(null); LookAndFeel.uninstallBorder(scrollbar); incrButton = null; decrButton = null; }
39,002
protected void uninstallListeners() { scrollTimer.removeActionListener(scrollListener); scrollbar.getModel().removeChangeListener(modelListener); scrollbar.removePropertyChangeListener(propertyChangeListener); decrButton.removeMouseListener(buttonListener); incrButton.removeMouseListener(buttonListene...
protected void uninstallListeners() { scrollTimer.removeActionListener(scrollListener); scrollbar.getModel().removeChangeListener(modelListener); scrollbar.removePropertyChangeListener(propertyChangeListener); decrButton.removeMouseListener(buttonListener); incrButton.removeMouseListener(buttonListene...
39,003
public void uninstallUI(JComponent c) { uninstallDefaults(); uninstallListeners(); uninstallComponents(); scrollTimer = null; thumbRect = null; trackRect = null; trackColor = null; trackHighlightColor = null; thumbColor = null; thumbHighlightColor = null; thumbDarkShadowColor = null;...
public void uninstallUI(JComponent c) { uninstallDefaults(); uninstallComponents(); scrollTimer = null; thumbRect = null; trackRect = null; trackColor = null; trackHighlightColor = null; thumbColor = null; thumbHighlightColor = null; thumbDarkShadowColor = null; thumbLightShadowCo...
39,004
public synchronized boolean contains(Object value) { for (int i = buckets.length - 1; i >= 0; i--) { HashEntry<K, V> e = buckets[i]; while (e != null) { if (value.equals(e.value)) return true; e = e.next; } } // Must throw on null arg...
public synchronized boolean contains(Object value) { for (int i = buckets.length - 1; i >= 0; i--) { HashEntry<K, V> e = buckets[i]; while (e != null) { if (e.value.equals(value)) return true; e = e.next; } } // Must throw on null arg...
39,006
public synchronized boolean contains(Object value) { for (int i = buckets.length - 1; i >= 0; i--) { HashEntry<K, V> e = buckets[i]; while (e != null) { if (value.equals(e.value)) return true; e = e.next; } } // Must throw on null arg...
public synchronized boolean contains(Object value) { for (int i = buckets.length - 1; i >= 0; i--) { HashEntry<K, V> e = buckets[i]; while (e != null) { if (value.equals(e.value)) return true; e = e.next; } } // Must throw on null arg...
39,007
public Iterator<Map.Entry<K, V>> iterator() { return new HashIterator<Map.Entry<K, V>>(ENTRIES); }
public Iterator<Map.Entry<K, V>> iterator() { return new EntryIterator(); }
39,008
HashEntry<K, V> getEntry(Object o) { if (! (o instanceof Map.Entry)) return null; K key = ((Map.Entry<K, V>) o).getKey(); if (key == null) return null; int idx = hash(key); HashEntry<K, V> e = buckets[idx]; while (e != null) { if (o.equals(e)) return e; e = e.n...
HashEntry<K, V> getEntry(Object o) { if (! (o instanceof Map.Entry)) return null; K key = ((Map.Entry<K, V>) o).getKey(); if (key == null) return null; int idx = hash(key); HashEntry<K, V> e = buckets[idx]; while (e != null) { if (e.equals(o)) return e; e = e.n...
39,009
public Iterator<K> iterator() { return new HashIterator<K>(KEYS); }
public Iterator<K> iterator() { return new KeyIterator(); }
39,010
protected void rehash() { HashEntry<K, V>[] oldBuckets = buckets; int newcapacity = (buckets.length * 2) + 1; threshold = (int) (newcapacity * loadFactor); buckets = (HashEntry<K, V>[]) new HashEntry[newcapacity]; for (int i = oldBuckets.length - 1; i >= 0; i--) { HashEntry<K, V> e = oldBu...
protected void rehash() { HashEntry<K, V>[] oldBuckets = buckets; int newcapacity = (buckets.length * 2) + 1; threshold = (int) (newcapacity * loadFactor); buckets = (HashEntry<K, V>[]) new HashEntry[newcapacity]; for (int i = oldBuckets.length - 1; i >= 0; i--) { HashEntry<K, V> e = oldBu...
39,011
public Iterator<V> iterator() { return new HashIterator<V>(VALUES); }
public Iterator<V> iterator() { return new ValueIterator(); }
39,012
private synchronized void writeObject(ObjectOutputStream s) throws IOException { // Write the threshold and loadFactor fields. s.defaultWriteObject(); s.writeInt(buckets.length); s.writeInt(size); // Since we are already synchronized, and entrySet().iterator() // would repeatedly re-lock/release...
private synchronized void writeObject(ObjectOutputStream s) throws IOException { // Write the threshold and loadFactor fields. s.defaultWriteObject(); s.writeInt(buckets.length); s.writeInt(size); // Since we are already synchronized, and entrySet().iterator() // would repeatedly re-lock/release...
39,013
setMaximum(int maximum){}
setMaximum(int maximum){}
39,014
setMinimum(int minimum){}
setMinimum(int minimum){}
39,015
setVisibleAmount(int visibleAmount){}
setVisibleAmount(int visibleAmount){}
39,016