id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
35,401
} public DateTime lastExecution(DateTime date){ </BUG> Validate.notNull(date); try { <BUG>DateTime previousMatch = previousClosestMatch(date); </BUG> if(previousMatch.equals(date)){ previousMatch = previousClosestMatch(date.minusSeconds(1)); }
public java.time.Duration timeToNextExecution(ZonedDateTime date){ return java.time.Duration.between(date, nextExecution(date)); public ZonedDateTime lastExecution(ZonedDateTime date){ ZonedDateTime previousMatch = previousClosestMatch(date);
35,402
return previousMatch; } catch (NoSuchValueException e) { throw new IllegalArgumentException(e); } } <BUG>public Duration timeFromLastExecution(DateTime date){ return new Interval(lastExecution(date), date).toDuration(); } public boolean isMatch(DateTime date){ </BUG> return nextExecution(lastExecution(date)).equals(da...
[DELETED]
35,403
<BUG>package com.cronutils.model.time.generator; import com.cronutils.model.field.CronField;</BUG> import com.cronutils.model.field.expression.Every; import com.cronutils.model.field.expression.FieldExpression; import com.google.common.annotations.VisibleForTesting;
import java.time.ZonedDateTime; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.cronutils.model.field.CronField;
35,404
import com.cronutils.model.field.CronField;</BUG> import com.cronutils.model.field.expression.Every; import com.cronutils.model.field.expression.FieldExpression; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.Lists; <BUG>import org.joda.time.DateTime; import org.slf4j.Logger; i...
package com.cronutils.model.time.generator; import java.time.ZonedDateTime; import java.util.List; import com.cronutils.model.field.CronField;
35,405
private static final Logger log = LoggerFactory.getLogger(EveryFieldValueGenerator.class); public EveryFieldValueGenerator(CronField cronField) { super(cronField); log.trace(String.format( "processing \"%s\" at %s", <BUG>cronField.getExpression().asString(), DateTime.now() </BUG> )); } @Override
cronField.getExpression().asString(), ZonedDateTime.now()
35,406
public int ap; public AsyncChunkWriteActionListener l; public void run() { try { if(Arrays.equals(this.hash, k)) <BUG>this.hl = new InsertRecord(false,0); </BUG> else if (Main.chunkStoreLocal) this.hl = HCServiceProxy.writeChunk(this.hash, this.chunk); else
this.hl = new InsertRecord(false,1);
35,407
if (closed) { this.failed = true; return; } mp.iterInit(); <BUG>SparseDataChunk ck = mp.nextValue(false); while (ck != null) {</BUG> if (closed) { this.failed = true; return;
[DELETED]
35,408
private transient ThreadPoolExecutor executor = new ThreadPoolExecutor( Main.writeThreads + 1, Main.writeThreads + 1, 10, TimeUnit.SECONDS, worksQueue, new ProcessPriorityThreadFactory(Thread.MIN_PRIORITY), executionHandler); private static EventBus eventBus = new EventBus(); <BUG>public SyncFS() throws IOException { t...
.fdiskInfoEvent("Starting Cloud Storage Conistancy Check for " + Main.volume.getName() ); this.init();
35,409
import com.google.common.cache.RemovalListener; import com.google.common.cache.RemovalNotification; public class DedupFileStore { private static boolean closing = false; private static OpenFileMonitor openFileMonitor = null; <BUG>private static ConcurrentHashMap<String, DedupFile> openFile = new ConcurrentHashMap<Strin...
private static ConcurrentHashMap<String, SparseDedupFile> openFile = new ConcurrentHashMap<String, SparseDedupFile>();
35,410
} finally { getDFLock.unlock(); } } public static boolean addRef(byte[] entry, long val) throws IOException { <BUG>if (val == 0) return true;</BUG> try { if(!Main.refCount || Arrays.equals(entry, WritableCacheBuffer.bk)) return true;
if (val == 1 || val == 0)
35,411
} } finally { } } public static boolean removeRef(byte[] entry, long val) throws IOException { <BUG>if (val == 0) return true;</BUG> try { if(!Main.refCount || Arrays.equals(entry, WritableCacheBuffer.bk)) return true;
public static boolean addRef(byte[] entry, long val) throws IOException { if (val == 1 || val == 0)
35,412
long handleGen = 0; public static void registerListener(Object obj) { eventBus.register(obj); } public SDFSFileSystem(String mountedVolume, String mountPoint) { <BUG>SDFSLogger.getLog().info( "mounting " + mountedVolume + " to " + mountPoint); </BUG> this.mountedVolume = mountedVolume; if (!this.mountedVolume.endsWith(...
SDFSLogger.getLog().info("mounting " + mountedVolume + " to " + mountPoint);
35,413
try { MetaDataDedupFile mf = MetaFileStore.getMF(f); mf.setMode(mode); } catch (Exception e) { SDFSLogger.getLog().warn("access denied for " + path, e); <BUG>throw new FuseException("access denied for " + path) .initErrno(Errno.EACCES);</BUG> } finally { }
File f = resolvePath(path); int ftype = this.getFtype(path); if (ftype == FuseFtypeConstants.TYPE_SYMLINK || ftype == FuseFtypeConstants.TYPE_DIR) { Path p = Paths.get(f.getPath()); Files.setAttribute(p, "unix:mode", Integer.valueOf(mode), LinkOption.NOFOLLOW_LINKS); } catch (IOException e) { throw new FuseException("a...
35,414
MetaDataDedupFile mf = MetaFileStore.getMF(f); mf.setOwner_id(uid); mf.setGroup_id(gid); } catch (Exception e) { SDFSLogger.getLog().warn("access denied for " + path, e); <BUG>throw new FuseException("access denied for " + path) .initErrno(Errno.EACCES);</BUG> } finally { }
mf.setMode(mode); throw new FuseException("access denied for " + path).initErrno(Errno.EACCES);
35,415
ch = this.dedupChannels.get(handleNo); } else { this.dedupChannels.put(handleNo, ch); } } catch (Exception e) { <BUG>} finally { SDFSLogger.getLog().debug( "number of channels is " + this.dedupChannels.size());</BUG> }
[DELETED]
35,416
SDFSLogger.getLog().debug( "number of channels is " + this.dedupChannels.size());</BUG> } } catch (Exception e) { <BUG>SDFSLogger.getLog().error("unable to open file" + f.getPath(), e); throw new FuseException("unable to open file " + path) .initErrno(Errno.EINVAL);</BUG> }
ch = this.dedupChannels.get(handleNo); } else { this.dedupChannels.put(handleNo, ch); } finally { SDFSLogger.getLog().debug("number of channels is " + this.dedupChannels.size());
35,417
DedupFileChannel ch = this.getFileChannel(path, (Long) fh, -1); try { ch.force(true); } catch (Exception e) { SDFSLogger.getLog().error("unable to sync file [" + path + "]", e); <BUG>throw new FuseException("unable to sync file") .initErrno(Errno.EACCES);</BUG> } finally { }
throw new FuseException("unable to sync file").initErrno(Errno.EACCES);
35,418
+ ch.getDedupFile().getGUID());</BUG> ch.force(true); } } catch (Exception e) { SDFSLogger.getLog().error("unable to sync file [" + path + "]", e); <BUG>throw new FuseException("unable to sync file") .initErrno(Errno.EACCES);</BUG> } finally { }
if (Main.volume.isOffLine()) throw new FuseException("volume offline").initErrno(Errno.ENAVAIL); try { DedupFileChannel ch = this.getFileChannel(path, (Long) fh, -1); if (Main.safeSync) { if (SDFSLogger.isDebug()) SDFSLogger.getLog().debug("sync " + path + " df=" + ch.getDedupFile().getGUID()); throw new FuseException(...
35,419
} finally { } return 0; } @Override <BUG>public int getattr(String path, FuseGetattrSetter getattrSetter) throws FuseException {</BUG> try { int ftype = this.getFtype(path);
public int getattr(String path, FuseGetattrSetter getattrSetter) throws FuseException {
35,420
} int atime = 0; int ctime = 0; int mtime = 0; long fileLength = 0; <BUG>attrs = Files.readAttributes(p, BasicFileAttributes.class, LinkOption.NOFOLLOW_LINKS);</BUG> fileLength = attrs.size(); mtime = (int) (attrs.lastModifiedTime().toMillis() / 1000L);
attrs = Files.readAttributes(p, BasicFileAttributes.class, LinkOption.NOFOLLOW_LINKS);
35,421
LinkOption.NOFOLLOW_LINKS);</BUG> fileLength = attrs.size(); mtime = (int) (attrs.lastModifiedTime().toMillis() / 1000L); atime = (int) (attrs.lastAccessTime().toMillis() / 1000L); ctime = (int) (attrs.creationTime().toMillis() / 1000L); <BUG>getattrSetter.set(p.hashCode(), mode, 1, uid, gid, 0, fileLength, (fileLengt...
} int atime = 0; int ctime = 0; int mtime = 0; long fileLength = 0; attrs = Files.readAttributes(p, BasicFileAttributes.class, LinkOption.NOFOLLOW_LINKS); getattrSetter.set(p.hashCode(), mode, 1, uid, gid, 0, fileLength, (fileLength * NAME_LENGTH + BLOCK_SIZE - 1) / BLOCK_SIZE, atime, mtime, ctime);
35,422
int mode = (Integer) Files.getAttribute(p, "unix:mode"); MetaDataDedupFile mf = MetaFileStore.getFolder(f); int atime = (int) (mf.getLastAccessed() / 1000L); int mtime = (int) (mf.lastModified() / 1000L); int ctime = (int) (0 / 1000L); <BUG>long fileLength = f.length(); getattrSetter.set(mf.getGUID().hashCode(), mode, ...
getattrSetter.set(mf.getGUID().hashCode(), mode, 1, uid, gid, 0, fileLength * NAME_LENGTH, (fileLength * NAME_LENGTH + BLOCK_SIZE - 1) / BLOCK_SIZE, atime, mtime, ctime);
35,423
int gid = mf.getGroup_id(); int mode = mf.getMode(); int atime = (int) (mf.getLastAccessed() / 1000L); int ctime = (int) (0 / 1000L); int mtime = (int) (mf.lastModified() / 1000L); <BUG>long fileLength = mf.length(); long actualBytes = (mf.getIOMonitor() .getActualBytesWritten() * 2) / 1024; if (actualBytes == 0 && mf....
long actualBytes = (mf.getIOMonitor().getActualBytesWritten() * 2) / 1024; if (actualBytes == 0 && mf.getIOMonitor().getActualBytesWritten() > 0) getattrSetter.set(mf.getGUID().hashCode(), mode, 1, uid, gid, 0, fileLength, actualBytes, atime,
35,424
actualBytes = (Main.CHUNK_LENGTH * 2) / 1024; getattrSetter.set(mf.getGUID().hashCode(), mode, 1, uid, gid, 0, fileLength, actualBytes, atime,</BUG> mtime, ctime); } <BUG>} catch (Exception e) { SDFSLogger.getLog().error( "unable to parse attributes " + path + " at physical path " + f.getPath(), e);</BUG> throw new Fus...
getattrSetter.set(mf.getGUID().hashCode(), mode, 1, uid, gid, 0, fileLength, actualBytes, atime, SDFSLogger.getLog().error("unable to parse attributes " + path + " at physical path " + f.getPath(),
35,425
dirFiller.add("..", "..".hashCode(), FuseFtypeConstants.TYPE_DIR);</BUG> for (int i = 0; i < mfs.length; i++) { File _mf = mfs[i]; <BUG>dirFiller.add(_mf.getName(), _mf.hashCode(), this.getFtype(_mf));</BUG> } } catch (Exception e) { SDFSLogger.getLog().error("unable to read path " + path, e);
try { File f = null; try { f = resolvePath(path); File[] mfs = f.listFiles(); dirFiller.add(".", ".".hashCode(), FuseFtypeConstants.TYPE_DIR); dirFiller.add("..", "..".hashCode(), FuseFtypeConstants.TYPE_DIR); dirFiller.add(_mf.getName(), _mf.hashCode(), this.getFtype(_mf));
35,426
SDFSLogger.getLog().error("unable to read path " + path, e); throw new FuseException().initErrno(Errno.EACCES); } finally { f = null; } <BUG>} finally { }</BUG> return 0; } @Override
} catch (FuseException e) { throw e; } catch (Exception e) { SDFSLogger.getLog().error(path, e);
35,427
@Override public int mkdir(String path, int mode) throws FuseException { try { File f = new File(this.mountedVolume + path); if (Main.volume.isOffLine()) <BUG>throw new FuseException("volume offline") .initErrno(Errno.ENAVAIL);</BUG> if (Main.volume.isFull()) throw new FuseException("Volume Full").initErrno(Errno.ENOS...
public int link(String from, String to) throws FuseException { throw new FuseException("error hard linking is not supported").initErrno(Errno.ENOSYS); } throw new FuseException("volume offline").initErrno(Errno.ENAVAIL);
35,428
@Override public int mknod(String path, int mode, int rdev) throws FuseException { try { File f = new File(this.mountedVolume + path); if (Main.volume.isOffLine()) <BUG>throw new FuseException("volume offline") .initErrno(Errno.ENAVAIL); if (Main.volume.isFull()) throw new FuseException("Volume Full").initErrno(Errno...
public int link(String from, String to) throws FuseException { throw new FuseException("error hard linking is not supported").initErrno(Errno.ENOSYS); } public int mkdir(String path, int mode) throws FuseException { throw new FuseException("volume offline").initErrno(Errno.ENAVAIL);
35,429
read = 0; } catch (DataArchivedException e) { throw new FuseException("File Archived").initErrno(Errno.ENODATA); } catch (Exception e) { SDFSLogger.getLog().error("unable to read file " + path, e); <BUG>throw new FuseException("error reading " + path) .initErrno(Errno.ENODATA); } finally {</BUG> }
throw new FuseException("error reading " + path).initErrno(Errno.ENODATA);
35,430
public int readlink(String path, CharBuffer link) throws FuseException { Path p = Paths.get(this.mountedVolume + path); try { String lpath = Files.readSymbolicLink(p).toString(); if (lpath.startsWith(this.mountedVolume)) <BUG>lpath = this.mountPoint + lpath.substring(this.mountedVolume.length()); </BUG> link.put(lpath)...
lpath = this.mountPoint + lpath.substring(this.mountedVolume.length());
35,431
+ lpath.substring(this.mountedVolume.length()); </BUG> link.put(lpath); } catch (Exception e) { SDFSLogger.getLog().error("error getting linking " + path, e); <BUG>throw new FuseException("error getting linking " + path) .initErrno(Errno.EACCES);</BUG> } finally { p = null;
public int readlink(String path, CharBuffer link) throws FuseException { Path p = Paths.get(this.mountedVolume + path); try { String lpath = Files.readSymbolicLink(p).toString(); if (lpath.startsWith(this.mountedVolume)) lpath = this.mountPoint + lpath.substring(this.mountedVolume.length()); throw new FuseException("er...
35,432
boolean del = MetaFileStore.removeMetaFile(f.getPath()); if (del)</BUG> return 0; else { <BUG>if (SDFSLogger.isDebug()) SDFSLogger.getLog().debug( "unable to delete folder " + f.getPath()); throw new FuseException() .initErrno(Errno.ENOTEMPTY);</BUG> }
} else { File f = resolvePath(path); if (f.getName().equals(".") || f.getName().equals("..")) try { if (MetaFileStore.removeMetaFile(f.getPath(), false, false)) SDFSLogger.getLog().debug("unable to delete folder " + f.getPath()); throw new FuseException().initErrno(Errno.ENOTEMPTY);
35,433
.initErrno(Errno.ENOTEMPTY);</BUG> } <BUG>} catch (FuseException e) { throw e; } catch (Exception e) { SDFSLogger.getLog().debug( "unable to delete folder " + f.getPath()); </BUG> throw new FuseException().initErrno(Errno.EACCES);
} else { File f = resolvePath(path); if (f.getName().equals(".") || f.getName().equals("..")) return 0; else { try { if (MetaFileStore.removeMetaFile(f.getPath(), false, false)) return 0; else { if (SDFSLogger.isDebug()) SDFSLogger.getLog().debug("unable to delete folder " + f.getPath()); throw new FuseException().init...
35,434
if (from.startsWith(this.mountPoint)) { from = from.substring(mountPoint.length()); this.resolvePath(from); src = new File(mountedVolume + from); } else if (!Main.allowExternalSymlinks) { <BUG>SDFSLogger.getLog().error( "external symlinks are not allowed " + from + " to " + to);</BUG> throw new FuseException().initErr...
SDFSLogger.getLog().error("external symlinks are not allowed " + from + " to " + to);
35,435
} Path srcP = Paths.get(src.getPath()); Path dstP = Paths.get(dst.getPath()); try { Files.createSymbolicLink(dstP, srcP); <BUG>eventBus.post(new MFileWritten(MetaFileStore.getMF(dst .getPath()))); } catch (IOException e) { SDFSLogger.getLog().error( "error linking " + from + " to " + to, e);</BUG> throw new FuseExcep...
return 0;
35,436
SDFSLogger.getLog().debug("removing " + path); if (!Main.safeClose) { try { this.getFileChannel(path, -1).getDedupFile().forceClose(); } catch (IOException e) { <BUG>SDFSLogger.getLog() .error("unable to close file " + path, e); </BUG> } }
SDFSLogger.getLog().error("unable to close file " + path, e);
35,437
} else { File f = this.resolvePath(path); try { if (MetaFileStore.removeMetaFile(f.getPath())) { return 0; <BUG>} else { SDFSLogger.getLog().warn( "unable to delete folder " + f.getPath());</BUG> throw new FuseException().initErrno(Errno.ENOSYS); }
SDFSLogger.getLog().warn("unable to delete file " + f.getPath());
35,438
} catch (Exception e) { SDFSLogger.getLog().error("unable to file file " + path, e); throw new FuseException().initErrno(Errno.EACCES); } } <BUG>} finally { }</BUG> } @Override public int utime(String path, int atime, int mtime) throws FuseException {
} catch (FuseException e) { throw e; SDFSLogger.getLog().error(path, e);
35,439
} finally { } return 0; } @Override <BUG>public int write(String path, long fh, boolean isWritepage, ByteBuffer buf, long offset) throws FuseException {</BUG> if (Main.volume.isOffLine()) throw new FuseException("volume offline").initErrno(Errno.ENAVAIL);
public int write(String path, long fh, boolean isWritepage, ByteBuffer buf, long offset) throws FuseException {
35,440
ch.writeFile(buf, buf.capacity(), 0, offset, true); } catch (Exception e) { SDFSLogger.getLog().error("unable to write to file" + path, e); throw new FuseException().initErrno(Errno.EACCES); } <BUG>} finally { }</BUG> return 0; } private File resolvePath(String path) throws FuseException {
} catch (FuseException e) { throw e; SDFSLogger.getLog().debug(path, e);
35,441
view.read(name, dst); } } } catch (java.nio.file.FileSystemException e) { if (SDFSLogger.isDebug()) <BUG>SDFSLogger.getLog() .debug("error getting exattr for " + path, e); </BUG> throw new FuseException().initErrno(Errno.ENODATA); } catch (Exception e) {
SDFSLogger.getLog().debug("error getting exattr for " + path, e);
35,442
public int getxattr(String path, String name, ByteBuffer dst, int position) throws FuseException, BufferOverflowException { this.resolvePath(path); try { int ftype = this.getFtype(path); <BUG>if (ftype != FuseFtypeConstants.TYPE_SYMLINK) { if (name.startsWith("user.cmd.") || name.startsWith("user.sdfs.") || name.starts...
if (name.startsWith("user.cmd.") || name.startsWith("user.sdfs.") || name.startsWith("user.dse"))
35,443
|| name.startsWith("user.dse"))</BUG> dst.put(sdfsCmds.getAttr(name, path).getBytes()); else { File f = this.resolvePath(path); Path _p = f.toPath(); <BUG>UserDefinedFileAttributeView view = Files .getFileAttributeView(_p,</BUG> UserDefinedFileAttributeView.class); view.read(name, dst);
public int getxattr(String path, String name, ByteBuffer dst, int position) throws FuseException, BufferOverflowException { try { int ftype = this.getFtype(path); if (ftype != FuseFtypeConstants.TYPE_SYMLINK) { if (name.startsWith("user.cmd.") || name.startsWith("user.sdfs.") || name.startsWith("user.dse")) UserDefined...
35,444
view.read(name, dst); } } } catch (java.nio.file.FileSystemException e) { if (SDFSLogger.isDebug()) <BUG>SDFSLogger.getLog() .debug("error getting exattr for " + path, e); </BUG> throw new FuseException().initErrno(Errno.ENODATA); } catch (FuseException e) {
SDFSLogger.getLog().debug("error getting exattr for " + path, e);
35,445
} finally { } return 0; } @Override <BUG>public int setxattr(String path, String name, ByteBuffer value, int flags, int position) throws FuseException {</BUG> this.resolvePath(path); try {
public int setxattr(String path, String name, ByteBuffer value, int flags, int position) throws FuseException {
35,446
this.resolvePath(path); try { byte valB[] = new byte[value.capacity()]; value.get(valB); String valStr = new String(valB); <BUG>if (name.startsWith("user.cmd.") || name.startsWith("user.sdfs.") || name.startsWith("user.dse")) {</BUG> sdfsCmds.runCMD(path, name, valStr); } else {
if (name.startsWith("user.cmd.") || name.startsWith("user.sdfs.") || name.startsWith("user.dse")) {
35,447
|| name.startsWith("user.dse")) {</BUG> sdfsCmds.runCMD(path, name, valStr); } else { File f = this.resolvePath(path); Path _path = f.toPath(); <BUG>UserDefinedFileAttributeView view = Files.getFileAttributeView( _path, UserDefinedFileAttributeView.class); view.write(name, value);</BUG> MetaDataDedupFile mf = MetaFile...
try { byte valB[] = new byte[value.capacity()]; value.get(valB); String valStr = new String(valB); if (name.startsWith("user.cmd.") || name.startsWith("user.sdfs.") || name.startsWith("user.dse")) { UserDefinedFileAttributeView view = Files.getFileAttributeView(_path, view.write(name, value);
35,448
} else { updateMemo(); callback.updateMemo(); } dismiss(); <BUG>}else{ </BUG> Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show(); } }
[DELETED]
35,449
} @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_memo); <BUG>ChinaPhoneHelper.setStatusBar(this,true); </BUG> topicId = getIntent().getLongExtra("topicId", -1); if (topicId == -1) { finish();
ChinaPhoneHelper.setStatusBar(this, true);
35,450
MemoEntry.COLUMN_REF_TOPIC__ID + " = ?" , new String[]{String.valueOf(topicId)}); } public Cursor selectMemo(long topicId) { Cursor c = db.query(MemoEntry.TABLE_NAME, null, MemoEntry.COLUMN_REF_TOPIC__ID + " = ?", new String[]{String.valueOf(topicId)}, null, null, <BUG>MemoEntry._ID + " DESC", null); </BUG> if (c != nu...
MemoEntry.COLUMN_ORDER + " ASC", null);
35,451
MemoEntry._ID + " = ?", new String[]{String.valueOf(memoId)}); } public long updateMemoContent(long memoId, String memoContent) { ContentValues values = new ContentValues(); <BUG>values.put(MemoEntry.COLUMN_CONTENT, memoContent); return db.update(</BUG> MemoEntry.TABLE_NAME, values, MemoEntry._ID + " = ?",
return db.update(
35,452
import android.widget.RelativeLayout; import android.widget.TextView; import com.kiminonawa.mydiary.R; import com.kiminonawa.mydiary.db.DBManager; import com.kiminonawa.mydiary.shared.EditMode; <BUG>import com.kiminonawa.mydiary.shared.ThemeManager; import java.util.List; public class MemoAdapter extends RecyclerView.A...
import com.marshalchen.ultimaterecyclerview.dragsortadapter.DragSortAdapter; public class MemoAdapter extends DragSortAdapter<DragSortAdapter.ViewHolder> implements EditMode {
35,453
private DBManager dbManager; private boolean isEditMode = false; private EditMemoDialogFragment.MemoCallback callback; private static final int TYPE_HEADER = 0; private static final int TYPE_ITEM = 1; <BUG>public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMe...
public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback, RecyclerView recyclerView) { super(recyclerView); this.mActivity = activity;
35,454
this.memoList = memoList; this.dbManager = dbManager; this.callback = callback; } @Override <BUG>public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { </BUG> View view; if (isEditMode) { if (viewType == TYPE_HEADER) {
public DragSortAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
35,455
editMemoDialogFragment.show(mActivity.getSupportFragmentManager(), "editMemoDialogFragment"); } }); } } <BUG>protected class MemoViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { private View rootView; private TextView TV_memo_item_content;</BUG> private ImageView IV_memo_item_delete;
protected class MemoViewHolder extends DragSortAdapter.ViewHolder implements View.OnClickListener, View.OnLongClickListener { private ImageView IV_memo_item_dot; private TextView TV_memo_item_content;
35,456
import java.util.Locale; import java.util.Map; import java.util.TreeMap; public class DependencyConvergenceReport extends AbstractProjectInfoReport <BUG>{ private List reactorProjects; private static final int PERCENTAGE = 100;</BUG> public String getOutputName() {
private static final int PERCENTAGE = 100; private static final List SUPPORTED_FONT_FAMILY_NAMES = Arrays.asList( GraphicsEnvironment .getLocalGraphicsEnvironment().getAvailableFontFamilyNames() );
35,457
sink.section1(); sink.sectionTitle1(); sink.text( getI18nString( locale, "title" ) ); sink.sectionTitle1_(); Map dependencyMap = getDependencyMap(); <BUG>generateLegend( locale, sink ); generateStats( locale, sink, dependencyMap ); generateConvergence( locale, sink, dependencyMap ); sink.section1_();</BUG> sink.body_()...
sink.lineBreak(); sink.section1_();
35,458
Iterator it = artifactMap.keySet().iterator(); while ( it.hasNext() ) { String version = (String) it.next(); sink.tableRow(); <BUG>sink.tableCell(); sink.text( version );</BUG> sink.tableCell_(); sink.tableCell(); generateVersionDetails( sink, artifactMap, version );
sink.tableCell( String.valueOf( cellWidth ) + "px" ); sink.text( version );
35,459
sink.tableCell(); sink.text( getI18nString( locale, "legend.shared" ) ); sink.tableCell_(); sink.tableRow_(); sink.tableRow(); <BUG>sink.tableCell(); iconError( sink );</BUG> sink.tableCell_(); sink.tableCell(); sink.text( getI18nString( locale, "legend.different" ) );
sink.tableCell( "15px" ); // according /images/icon_error_sml.gif iconError( sink );
35,460
sink.tableCaption(); sink.text( getI18nString( locale, "stats.caption" ) ); sink.tableCaption_();</BUG> sink.tableRow(); <BUG>sink.tableHeaderCell(); sink.text( getI18nString( locale, "stats.subprojects" ) + ":" ); sink.tableHeaderCell_();</BUG> sink.tableCell(); sink.text( String.valueOf( reactorProjects.size() ) ); s...
sink.bold(); sink.bold_(); sink.tableCaption_(); sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.subprojects" ) ); sink.tableHeaderCell_();
35,461
sink.tableCell(); sink.text( String.valueOf( reactorProjects.size() ) ); sink.tableCell_(); sink.tableRow_(); sink.tableRow(); <BUG>sink.tableHeaderCell(); sink.text( getI18nString( locale, "stats.dependencies" ) + ":" ); sink.tableHeaderCell_();</BUG> sink.tableCell(); sink.text( String.valueOf( depCount ) );
sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.dependencies" ) ); sink.tableHeaderCell_();
35,462
sink.text( String.valueOf( convergence ) + "%" ); sink.bold_(); sink.tableCell_(); sink.tableRow_(); sink.tableRow(); <BUG>sink.tableHeaderCell(); sink.text( getI18nString( locale, "stats.readyrelease" ) + ":" ); sink.tableHeaderCell_();</BUG> sink.tableCell(); if ( convergence >= PERCENTAGE && snapshotCount <= 0 )
sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.readyrelease" ) ); sink.tableHeaderCell_();
35,463
{ ReverseDependencyLink p1 = (ReverseDependencyLink) o1; ReverseDependencyLink p2 = (ReverseDependencyLink) o2; return p1.getProject().getId().compareTo( p2.getProject().getId() ); } <BUG>else {</BUG> return 0; } }
iconError( sink );
35,464
public static final ConfigKey<String> SUGGESTED_VERSION = newStringConfigKey("install.version", "Suggested version"); public static final ConfigKey<String> INSTALL_UNIQUE_LABEL = ConfigKeys.newStringConfigKey("install.unique_label", "Provides a label which uniquely identifies an installation, used in the computation of...
public static final ConfigKey<Boolean> ENTITY_STARTED = newBooleanConfigKey("entity.started", "Skip the startup process entirely, for running services"); public static final ConfigKey<Boolean> ENTITY_RUNNING = newBooleanConfigKey("entity.running", "Skip the startup process entirely, if service already running"); public...
35,465
int p = ((PortSupplier) l).obtainPort(value); if (p != -1) { LOG.debug("{}: choosing port {} for {}", new Object[] { entity, p, getName() }); return p; } <BUG>if (!(skip || started)) { int rangeSize = Iterables.size(value);</BUG> if (rangeSize == 0) { LOG.warn("{}: no port available for {} (empty range {})", new Object...
if (!skipCheck) { int rangeSize = Iterables.size(value);
35,466
@SetFromFlag("customizeLatch") ConfigKey<Boolean> CUSTOMIZE_LATCH = BrooklynConfigKeys.CUSTOMIZE_LATCH; @SetFromFlag("launchLatch") ConfigKey<Boolean> LAUNCH_LATCH = BrooklynConfigKeys.LAUNCH_LATCH; @SetFromFlag("entityStarted") <BUG>ConfigKey<Boolean> ENTITY_STARTED = BrooklynConfigKeys.ENTITY_STARTED; @SetFromFlag("s...
@SetFromFlag("entityRunning") ConfigKey<Boolean> ENTITY_RUNNING = BrooklynConfigKeys.ENTITY_RUNNING; @SetFromFlag("skipInstall")
35,467
}}); if (Strings.isNonBlank(entity.getConfig(BrooklynConfigKeys.PRE_INSTALL_COMMAND))) { DynamicTasks.queue("pre-install-command", new Runnable() { public void run() { runPreInstallCommand(entity.getConfig(BrooklynConfigKeys.PRE_INSTALL_COMMAND)); }}); <BUG>}; Boolean skip = Optional.fromNullable(entity.getConfig(Brook...
Optional<Boolean> locationInstalled = Optional.fromNullable(getLocation().getConfig(BrooklynConfigKeys.SKIP_INSTALLATION)); Optional<Boolean> entityInstalled = Optional.fromNullable(entity.getConfig(BrooklynConfigKeys.SKIP_INSTALLATION)); boolean skipInstall = locationInstalled.or(entityInstalled).or(false); if (!skipI...
35,468
package org.apache.cassandra.tools; import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; <BUG>import java.nio.ByteBuffer; import java.util.List; import java.util.stream.Stream;</BUG> import org.apache.cassandra.config.CFMetaData; import org.apache.cassandra.config.ColumnDefinition...
import java.time.Instant; import java.util.concurrent.TimeUnit; import java.util.stream.Stream;
35,469
import org.apache.cassandra.db.LivenessInfo; import org.apache.cassandra.db.RangeTombstone; import org.apache.cassandra.db.marshal.AbstractType; import org.apache.cassandra.db.marshal.CollectionType; import org.apache.cassandra.db.marshal.CompositeType; <BUG>import org.apache.cassandra.db.rows.Cell; import org.apache.c...
import org.apache.cassandra.db.rows.ColumnData; import org.apache.cassandra.db.rows.ComplexColumnData; import org.apache.cassandra.db.rows.RangeTombstoneBoundMarker;
35,470
private static final JsonFactory jsonFactory = new JsonFactory(); private final JsonGenerator json; private final CompactIndenter objectIndenter = new CompactIndenter(); private final CompactIndenter arrayIndenter = new CompactIndenter(); private final CFMetaData metadata; <BUG>private final ISSTableScanner currentScan...
private boolean rawTime = false; private JsonTransformer(JsonGenerator json, ISSTableScanner currentScanner, boolean rawTime, CFMetaData metadata)
35,471
</BUG> { try (JsonGenerator json = jsonFactory.createJsonGenerator(new OutputStreamWriter(out, "UTF-8"))) { <BUG>JsonTransformer transformer = new JsonTransformer(json, currentScanner, metadata); </BUG> json.writeStartArray(); keys.forEach(transformer::serializePartitionKey); json.writeEndArray(); }
partitions.forEach(transformer::serializePartition); public static void keysToJson(ISSTableScanner currentScanner, Stream<DecoratedKey> keys, boolean rawTime, CFMetaData metadata, OutputStream out) throws IOException JsonTransformer transformer = new JsonTransformer(json, currentScanner, rawTime, metadata);
35,472
json.writeEndArray(); arrayIndenter.setCompact(false); } if (cell.isTombstone()) { <BUG>json.writeFieldName("deletion_time"); json.writeNumber(cell.localDeletionTime()); }</BUG> else
json.writeEndObject(); catch (IOException e)
35,473
json.writeString(cell.column().cellValueType().getString(cell.value())); } if (liveInfo.isEmpty() || cell.timestamp() != liveInfo.timestamp()) { json.writeFieldName("tstamp"); <BUG>json.writeNumber(cell.timestamp()); }</BUG> if (cell.isExpiring() && (liveInfo.isEmpty() || cell.ttl() != liveInfo.ttl())) { json.writeFiel...
json.writeString(dateString(TimeUnit.MICROSECONDS, cell.timestamp()));
35,474
if (cell.isExpiring() && (liveInfo.isEmpty() || cell.ttl() != liveInfo.ttl())) { json.writeFieldName("ttl"); json.writeNumber(cell.ttl()); json.writeFieldName("expires_at"); <BUG>json.writeNumber(cell.localDeletionTime()); json.writeFieldName("expired");</BUG> json.writeBoolean(!cell.isLive((int) (System.currentTimeMil...
json.writeString(dateString(TimeUnit.SECONDS, cell.localDeletionTime())); json.writeFieldName("expired");
35,475
public class SSTableExport { private static final String KEY_OPTION = "k"; private static final String DEBUG_OUTPUT_OPTION = "d"; private static final String EXCLUDE_KEY_OPTION = "x"; <BUG>private static final String ENUMERATE_KEYS_OPTION = "e"; private static final Options options = new Options();</BUG> private static...
private static final String RAW_TIMESTAMPS = "t"; private static final Options options = new Options();
35,476
excludeKey.setArgs(500); options.addOption(excludeKey); Option optEnumerate = new Option(ENUMERATE_KEYS_OPTION, false, "enumerate partition keys only"); options.addOption(optEnumerate); Option debugOutput = new Option(DEBUG_OUTPUT_OPTION, false, "CQL row per line internal representation"); <BUG>options.addOption(debugO...
Option rawTimestamps = new Option(RAW_TIMESTAMPS, false, "Print raw timestamps instead of iso8601 date strings"); options.addOption(rawTimestamps); }
35,477
}); }); } else { <BUG>JsonTransformer.toJson(currentScanner, partitions, metadata, System.out); </BUG> } } }
JsonTransformer.toJson(currentScanner, partitions, cmd.hasOption(RAW_TIMESTAMPS), metadata, System.out);
35,478
package org.jgroups.protocols; <BUG>import org.jgroups.Event; import org.jgroups.stack.IpAddress;</BUG> import org.jgroups.util.Util; import java.lang.reflect.Method; import java.net.InetAddress;
import org.jgroups.Global; import org.jgroups.stack.IpAddress;
35,479
import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.security.DigestOutputStream; import java.security.MessageDigest; <BUG>import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.Collections; import java.util.List;</BUG> public final class ...
import java.text.DateFormat; import java.util.Date; import java.util.List;
35,480
package org.jboss.as.patching.runner; <BUG>import org.jboss.as.boot.DirectoryStructure; import org.jboss.as.patching.LocalPatchInfo;</BUG> import org.jboss.as.patching.PatchInfo; import org.jboss.as.patching.PatchLogger; import org.jboss.as.patching.PatchMessages;
import static org.jboss.as.patching.runner.PatchUtils.generateTimestamp; import org.jboss.as.patching.CommonAttributes; import org.jboss.as.patching.LocalPatchInfo;
35,481
private static final String PATH_DELIMITER = "/"; public static final byte[] NO_CONTENT = PatchingTask.NO_CONTENT; enum Element { ADDED_BUNDLE("added-bundle"), ADDED_MISC_CONTENT("added-misc-content"), <BUG>ADDED_MODULE("added-module"), BUNDLES("bundles"),</BUG> CUMULATIVE("cumulative"), DESCRIPTION("description"), MIS...
APPLIES_TO_VERSION("applies-to-version"), BUNDLES("bundles"),
35,482
final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { <BUG>case APPLIES_TO_VERSION: builder.addAppliesTo(value); break;</BUG> case RESULTING_VE...
[DELETED]
35,483
final StringBuilder path = new StringBuilder(); for(final String p : item.getPath()) { path.append(p).append(PATH_DELIMITER); } path.append(item.getName()); <BUG>writer.writeAttribute(Attribute.PATH.name, path.toString()); if(type != ModificationType.REMOVE) {</BUG> writer.writeAttribute(Attribute.HASH.name, bytesToHex...
if (item.isDirectory()) { writer.writeAttribute(Attribute.DIRECTORY.name, "true"); if(type != ModificationType.REMOVE) {
35,484
package org.jboss.as.patching; import org.jboss.as.controller.OperationFailedException; import org.jboss.as.patching.runner.PatchingException; import org.jboss.logging.Messages; import org.jboss.logging.annotations.Message; <BUG>import org.jboss.logging.annotations.MessageBundle; import java.io.IOException;</BUG> impor...
import org.jboss.logging.annotations.Cause; import java.io.IOException;
35,485
import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.nio.charset.Charset; <BUG>import java.util.ArrayList; import java.util.LinkedList; import java.util.List; import java.util.regex.Pattern;</BUG> import javax.xml.parsers.ParserConfigurationExcepti...
import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Set; import java.util.regex.Pattern;
35,486
this.documents = loadDocuments(new File(file)); } private String generateDocumentUri(String fileName) { StringBuilder builder = new StringBuilder(); builder.append("http://"); <BUG>builder.append(name.replace(' ', '_')); </BUG> builder.append('/'); builder.append(fileName); return builder.toString();
builder.append(name.replace(" ", "_"));
35,487
private long count_position; private long origintaglength; private List<String> title; private int countSpezialSymbols; private int lastPosition; <BUG>private boolean wasEnter; @Override</BUG> public void setDocumentLocator(Locator locator) { this.locator = locator; }
private List<Marking> markings; @Override
35,488
this.last_Locator_column = -1; this.count_position = 0; this.title = new LinkedList(); this.countSpezialSymbols = 0; this.lastPosition = 0; <BUG>this.wasEnter = true; super.startDocument();</BUG> } @Override public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXExcepti...
this.markings = new ArrayList<>(); super.startDocument();
35,489
}}); } @Override protected void onResume() { super.onResume(); <BUG>Camera.Size size = mCamera.getParameters().getPreviewSize(); visualize.initializeImages( size.width, size.height );</BUG> } @Override public void onItemSelected(AdapterView<?> adapterView, View view, int pos, long id ) {
[DELETED]
35,490
paintWideLine.setColor(Color.RED); paintWideLine.setStrokeWidth(3); textPaint.setColor(Color.BLUE); textPaint.setTextSize(60); } <BUG>public void initializeImages( int width , int height ) { graySrc = new ImageFloat32(width,height);</BUG> grayDst = new ImageFloat32(width,height); bitmapSrc = Bitmap.createBitmap(width, ...
if( graySrc != null && graySrc.width == width && graySrc.height == height ) return; graySrc = new ImageFloat32(width,height);
35,491
public void setMatches( List<AssociatedPair> matches ) { this.locationSrc.clear(); this.locationDst.clear(); for( int i = 0; i < matches.size(); i++ ) { AssociatedPair p = matches.get(i); <BUG>locationSrc.add( p.p1 ); locationDst.add( p.p2 ); </BUG> }
locationSrc.add( p.p1.copy() ); locationDst.add( p.p2.copy() );
35,492
hasRight = true; grayDst.setTo(image); ConvertBitmap.grayToBitmap(image,bitmapDst,storage); } } <BUG>public synchronized void render(Canvas canvas, double tranX , double tranY , double scale ) { this.scale = scale;</BUG> this.tranX = tranX; this.tranY = tranY; int startX = bitmapSrc.getWidth()+SEPARATION;
public void render(Canvas canvas, double tranX , double tranY , double scale ) { this.scale = scale;
35,493
} else { updateMemo(); callback.updateMemo(); } dismiss(); <BUG>}else{ </BUG> Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show(); } }
[DELETED]
35,494
} @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_memo); <BUG>ChinaPhoneHelper.setStatusBar(this,true); </BUG> topicId = getIntent().getLongExtra("topicId", -1); if (topicId == -1) { finish();
ChinaPhoneHelper.setStatusBar(this, true);
35,495
MemoEntry.COLUMN_REF_TOPIC__ID + " = ?" , new String[]{String.valueOf(topicId)}); } public Cursor selectMemo(long topicId) { Cursor c = db.query(MemoEntry.TABLE_NAME, null, MemoEntry.COLUMN_REF_TOPIC__ID + " = ?", new String[]{String.valueOf(topicId)}, null, null, <BUG>MemoEntry._ID + " DESC", null); </BUG> if (c != nu...
MemoEntry.COLUMN_ORDER + " ASC", null);
35,496
MemoEntry._ID + " = ?", new String[]{String.valueOf(memoId)}); } public long updateMemoContent(long memoId, String memoContent) { ContentValues values = new ContentValues(); <BUG>values.put(MemoEntry.COLUMN_CONTENT, memoContent); return db.update(</BUG> MemoEntry.TABLE_NAME, values, MemoEntry._ID + " = ?",
return db.update(
35,497
import android.widget.RelativeLayout; import android.widget.TextView; import com.kiminonawa.mydiary.R; import com.kiminonawa.mydiary.db.DBManager; import com.kiminonawa.mydiary.shared.EditMode; <BUG>import com.kiminonawa.mydiary.shared.ThemeManager; import java.util.List; public class MemoAdapter extends RecyclerView.A...
import com.marshalchen.ultimaterecyclerview.dragsortadapter.DragSortAdapter; public class MemoAdapter extends DragSortAdapter<DragSortAdapter.ViewHolder> implements EditMode {
35,498
private DBManager dbManager; private boolean isEditMode = false; private EditMemoDialogFragment.MemoCallback callback; private static final int TYPE_HEADER = 0; private static final int TYPE_ITEM = 1; <BUG>public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMe...
public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback, RecyclerView recyclerView) { super(recyclerView); this.mActivity = activity;
35,499
this.memoList = memoList; this.dbManager = dbManager; this.callback = callback; } @Override <BUG>public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { </BUG> View view; if (isEditMode) { if (viewType == TYPE_HEADER) {
public DragSortAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
35,500
editMemoDialogFragment.show(mActivity.getSupportFragmentManager(), "editMemoDialogFragment"); } }); } } <BUG>protected class MemoViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { private View rootView; private TextView TV_memo_item_content;</BUG> private ImageView IV_memo_item_delete;
protected class MemoViewHolder extends DragSortAdapter.ViewHolder implements View.OnClickListener, View.OnLongClickListener { private ImageView IV_memo_item_dot; private TextView TV_memo_item_content;