id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
12,601 | final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final short[][] data = dst.getShortDataArrays();
final float[] warpData = new float[2 * dstWidth];
int lineOffset = 0;
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
12,602 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
12,603 | final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final short[][] data = dst.getShortDataArrays();
final float[] warpData = new float[2 * dstWidth];
int lineOffset = 0;
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
12,604 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
12,605 | final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final int[][] data = dst.getIntDataArrays();
final float[] warpData = new float[2 * dstWidth];
int lineOffset = 0;
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
12,606 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
12,607 | final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final float[][] data = dst.getFloatDataArrays();
final float[] warpData = new float[2 * dstWidth];
int lineOffset = 0;
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
12,608 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
12,609 | final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final double[][] data = dst.getDoubleDataArrays();
final float[] warpData = new float[2 * dstWidth];
int lineOffset = 0;
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
12,610 | } else
newNode = getLayoutNode(newNodeId);
ALNode parentNode = getLayoutNode(parentId);
if ( !(parentNode.getNodeType()==IUserLayoutNodeDescription.FOLDER ) )
throw new PortalException ("The target parent node should be a folder!");
<BUG>if ( checkRestriction(parentNode,RestrictionTypes.IMMUTABLE_RESTRICTION,"false") ) {
</BUG>
Vector restrictions = parentNode.getRestrictionsByPath("children");
for ( int i = 0; i < restrictions.size(); i++ ) {
IUserLayoutRestriction restriction = (IUserLayoutRestriction)restrictions.get(i);
| if ( !checkRestriction(parentNode,RestrictionTypes.IMMUTABLE_RESTRICTION,"true") ) {
|
12,611 | IALNodeDescription nodeDesc = ALNode.createUserLayoutNodeDescription(node);
String nodeId = node.getAttribute("ID");
nodeDesc.setId(nodeId);
nodeDesc.setName(node.getAttribute("name"));
nodeDesc.setFragmentId(node.getAttribute("fragmentID"));
<BUG>nodeDesc.setHidden((node.getAttribute("hidden").equalsIgnoreCase("true"))?true:false);
nodeDesc.setImmutable((node.getAttribute("immutable").equalsIgnoreCase("true"))?true:false);
nodeDesc.setUnremovable((node.getAttribute("unremovable").equalsIgnoreCase("true"))?true:false);
nodeDesc.setHidden((node.getAttribute("hidden").equalsIgnoreCase("true"))?true:false);
ALNode layoutNode = null;</BUG>
IALChannelDescription channelDesc = null;
| nodeDesc.setHidden(CommonUtils.strToBool(node.getAttribute("hidden")));
nodeDesc.setImmutable(CommonUtils.strToBool(node.getAttribute("immutable")));
nodeDesc.setUnremovable(CommonUtils.strToBool(node.getAttribute("unremovable")));
nodeDesc.setHidden(CommonUtils.strToBool(node.getAttribute("hidden")));
ALNode layoutNode = null;
|
12,612 | if ( channelDesc != null ) {
channelDesc.setChannelPublishId(node.getAttribute("chanID"));
channelDesc.setChannelTypeId(node.getAttribute("typeID"));
channelDesc.setClassName(node.getAttribute("class"));
channelDesc.setDescription(node.getAttribute("description"));
<BUG>channelDesc.setEditable((node.getAttribute("editable").equalsIgnoreCase("true"))?true:false);
channelDesc.setHasAbout((node.getAttribute("hasAbout").equalsIgnoreCase("true"))?true:false);
channelDesc.setHasHelp((node.getAttribute("hasHelp").equalsIgnoreCase("true"))?true:false);
channelDesc.setFunctionalName(node.getAttribute("fname"));</BUG>
channelDesc.setTimeout(Long.parseLong(node.getAttribute("timeout")));
| channelDesc.setEditable(CommonUtils.strToBool(node.getAttribute("editable")));
channelDesc.setHasAbout(CommonUtils.strToBool(node.getAttribute("hasAbout")));
channelDesc.setHasHelp(CommonUtils.strToBool(node.getAttribute("hasHelp")));
channelDesc.setFunctionalName(node.getAttribute("fname"));
|
12,613 | String nodeId = nodeDesc.getId();
if ( nodeId == null ) return false;
ALNode node = getLayoutNode(nodeId);
IALNodeDescription currentNodeDesc = node.getNodeDescription();
if ( !nodeId.equals(currentNodeDesc.getId()) ) return false;
<BUG>if ( !checkRestriction(node,RestrictionTypes.IMMUTABLE_RESTRICTION,"false") )
</BUG>
return false;
if ( checkRestriction(node.getParentNodeId(),RestrictionTypes.IMMUTABLE_RESTRICTION,"children","true") )
return false;
| if ( checkRestriction(node,RestrictionTypes.IMMUTABLE_RESTRICTION,"true") )
|
12,614 | package org.opennms.web.svclayer.outage;
import java.util.Collection;
import java.util.HashMap;
<BUG>import java.util.Iterator;
import java.util.LinkedList;</BUG>
import java.util.List;
import java.util.Map;
import org.opennms.netmgt.model.OnmsIpInterface;
| import java.util.ArrayList;
|
12,615 | import org.opennms.netmgt.model.OnmsIpInterface;
import org.opennms.netmgt.model.OnmsMonitoredService;
import org.opennms.netmgt.model.OnmsOutage;
import org.opennms.netmgt.model.OnmsServiceType;
public class OutageListBuilder {
<BUG>public List theTable(Collection<OnmsOutage> foundOutages) {
List<Map<String, Object>> theTable = new LinkedList<Map<String, Object>>();
for (Iterator iter = foundOutages.iterator(); iter.hasNext();) {
OnmsOutage outage = (OnmsOutage) iter.next();
OnmsMonitoredService monitoredService = outage
.getMonitoredService();</BUG>
OnmsServiceType serviceType = monitoredService.getServiceType();
| public List<Map<String, Object>> theTable(Collection<OnmsOutage> foundOutages) {
List<Map<String, Object>> theTable = new ArrayList<Map<String, Object>>();
for (OnmsOutage outage : foundOutages) {
OnmsMonitoredService monitoredService = outage.getMonitoredService();
|
12,616 | }
@RootTask
static Task<Exec.Result> exec(String parameter, int number) {
Task<String> task1 = MyTask.create(parameter);
Task<Integer> task2 = Adder.create(number, number + 2);
<BUG>return Task.ofType(Exec.Result.class).named("exec", "/bin/sh")
.in(() -> task1)</BUG>
.in(() -> task2)
.process(Exec.exec((str, i) -> args("/bin/sh", "-c", "\"echo " + i + "\"")));
}
| return Task.named("exec", "/bin/sh").ofType(Exec.Result.class)
.in(() -> task1)
|
12,617 | return args;
}
static class MyTask {
static final int PLUS = 10;
static Task<String> create(String parameter) {
<BUG>return Task.ofType(String.class).named("MyTask", parameter)
.in(() -> Adder.create(parameter.length(), PLUS))</BUG>
.in(() -> Fib.create(parameter.length()))
.process((sum, fib) -> something(parameter, sum, fib));
}
| return Task.named("MyTask", parameter).ofType(String.class)
.in(() -> Adder.create(parameter.length(), PLUS))
|
12,618 | final String instanceField = "from instance";
final TaskContext context = TaskContext.inmem();
final AwaitingConsumer<String> val = new AwaitingConsumer<>();
@Test
public void shouldJavaUtilSerialize() throws Exception {
<BUG>Task<Long> task1 = Task.ofType(Long.class).named("Foo", "Bar", 39)
.process(() -> 9999L);
Task<String> task2 = Task.ofType(String.class).named("Baz", 40)
.in(() -> task1)</BUG>
.ins(() -> singletonList(task1))
| Task<Long> task1 = Task.named("Foo", "Bar", 39).ofType(Long.class)
Task<String> task2 = Task.named("Baz", 40).ofType(String.class)
.in(() -> task1)
|
12,619 | assertEquals(des.id().name(), "Baz");
assertEquals(val.awaitAndGet(), "[9999] hello 10004");
}
@Test(expected = NotSerializableException.class)
public void shouldNotSerializeWithInstanceFieldReference() throws Exception {
<BUG>Task<String> task = Task.ofType(String.class).named("WithRef")
.process(() -> instanceField + " causes an outer reference");</BUG>
serialize(task);
}
@Test
| Task<String> task = Task.named("WithRef").ofType(String.class)
.process(() -> instanceField + " causes an outer reference");
|
12,620 | serialize(task);
}
@Test
public void shouldSerializeWithLocalReference() throws Exception {
String local = instanceField;
<BUG>Task<String> task = Task.ofType(String.class).named("WithLocalRef")
.process(() -> local + " won't cause an outer reference");</BUG>
serialize(task);
Task<String> des = deserialize();
context.evaluate(des).consume(val);
| Task<String> task = Task.named("WithLocalRef").ofType(String.class)
.process(() -> local + " won't cause an outer reference");
|
12,621 | }
@RootTask
public static Task<String> standardArgs(int first, String second) {
firstInt = first;
secondString = second;
<BUG>return Task.ofType(String.class).named("StandardArgs", first, second)
.process(() -> second + " " + first * 100);</BUG>
}
@Test
public void shouldParseFlags() throws Exception {
| return Task.named("StandardArgs", first, second).ofType(String.class)
.process(() -> second + " " + first * 100);
|
12,622 | assertThat(parsedEnum, is(CustomEnum.BAR));
}
@RootTask
public static Task<String> enums(CustomEnum enm) {
parsedEnum = enm;
<BUG>return Task.ofType(String.class).named("Enums", enm)
.process(enm::toString);</BUG>
}
@Test
public void shouldParseCustomTypes() throws Exception {
| return Task.named("Enums", enm).ofType(String.class)
.process(enm::toString);
|
12,623 | assertThat(parsedType.content, is("blarg parsed for you!"));
}
@RootTask
public static Task<String> customType(CustomType myType) {
parsedType = myType;
<BUG>return Task.ofType(String.class).named("Types", myType.content)
.process(() -> myType.content);</BUG>
}
public enum CustomEnum {
BAR
| return Task.named("Types", myType.content).ofType(String.class)
.process(() -> myType.content);
|
12,624 | TaskContext taskContext = TaskContext.inmem();
TaskContext.Value<Long> value = taskContext.evaluate(fib92);
value.consume(f92 -> System.out.println("fib(92) = " + f92));
}
static Task<Long> create(long n) {
<BUG>TaskBuilder<Long> fib = Task.ofType(Long.class).named("Fib", n);
</BUG>
if (n < 2) {
return fib
.process(() -> n);
| TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
|
12,625 | import com.squareup.javapoet.TypeName;
import com.squareup.javapoet.TypeSpec;
import com.squareup.javapoet.TypeVariableName;
import com.squareup.javapoet.WildcardTypeName;
import com.squareup.moshi.Json;
<BUG>import com.squareup.moshi.JsonAdapter;
import com.squareup.moshi.JsonReader;</BUG>
import com.squareup.moshi.JsonWriter;
import com.squareup.moshi.Moshi;
import com.squareup.moshi.Types;
| import com.squareup.moshi.JsonQualifier;
import com.squareup.moshi.JsonReader;
|
12,626 | public static final String EDITOR_LOGFILE_ENABLED = "logfileEnabled";
public static final String EDITOR_LOGFILE = "logfile";
public static final int COMBOBOX_MAX_VISIBLE_SIZE = 12;
public static Preferences getPreferences() {
if (cayennePrefs == null) {
<BUG>Preference decoratedPref = new UpgradeCayennePreference(
new CayennePreference());</BUG>
cayennePrefs = decoratedPref.getCayennePreference();
cayennePrefs.addPreferenceChangeListener(new ModelerPreferences());
| Preference decoratedPref = new UpgradeCayennePreference(new CayennePreference());
|
12,627 | Preferences filesPrefs = getLastProjFilesPref();
ArrayList<String> arrayLastProjFiles = new ArrayList<>();
String[] keys = null;
try {
keys = filesPrefs.keys();
<BUG>}
catch (BackingStoreException e) {
</BUG>
logObj.warn("Error reading preferences file.", e);
}
| } catch (BackingStoreException e) {
|
12,628 | import java.util.List;
import java.util.prefs.BackingStoreException;
import java.util.prefs.Preferences;
public class CayenneModelerController extends CayenneController {
private static final ProjectStateUtil PROJECT_STATE_UTIL = new ProjectStateUtil();
<BUG>protected ProjectController projectController;
</BUG>
protected CayenneModelerFrame frame;
private EditorView editorView;
public CayenneModelerController(){}
| private ProjectController projectController;
|
12,629 | protected CayenneModelerFrame frame;
private EditorView editorView;
public CayenneModelerController(){}
public CayenneModelerController(Application application) {
super(application);
<BUG>this.frame = new CayenneModelerFrame(application.getActionManager());
application
.getInjector()
.getInstance(PlatformInitializer.class)
.setupMenus(frame);</BUG>
this.projectController = new ProjectController(this);
| application.getInjector().getInstance(PlatformInitializer.class).setupMenus(frame);
|
12,630 | public ProjectController getProjectController() {
return projectController;
}
public FSPath getLastEOModelDirectory() {
FSPath path = (FSPath) application
<BUG>.getCayenneProjectPreferences()
.getProjectDetailObject(
FSPath.class,
getViewPreferences().node("lastEOMDir"));</BUG>
if (path.getPath() == null) {
| .getProjectDetailObject(FSPath.class, getViewPreferences().node("lastEOMDir"));
|
12,631 | public void projectSavedAction() {
projectController.setDirty(false);
projectController.updateProjectControllerPreferences();
updateStatus("Project saved...");
frame.setTitle(ModelerConstants.TITLE
<BUG>+ " - "
+ projectController
.getProject()
.getConfigurationResource()
.getURL()
.getPath());</BUG>
}
| + projectController.getProject().getConfigurationResource().getURL().getPath());
|
12,632 | projectController.projectOpened();
application.getActionManager().projectOpened();
if (project.getConfigurationResource() == null) {
updateStatus("New project created...");
frame.setTitle(ModelerConstants.TITLE + "- [New]");
<BUG>}
else {
</BUG>
updateStatus("Project opened...");
frame.setTitle(ModelerConstants.TITLE
| } else {
|
12,633 | frame.setTitle(ModelerConstants.TITLE
+ " - "
+ project.getConfigurationResource().getURL().getPath());
}
if (project.getConfigurationResource() != null) {
<BUG>getLastDirectory().setDirectory(
new File(project.getConfigurationResource().getURL().getPath()));
</BUG>
frame.fireRecentFileListChanged();
}
| getLastDirectory().setDirectory(new File(project.getConfigurationResource().getURL().getPath()));
|
12,634 | new File(project.getConfigurationResource().getURL().getPath()));
</BUG>
frame.fireRecentFileListChanged();
}
PROJECT_STATE_UTIL.fireLastState(projectController);
<BUG>List<ValidationFailure> allFailures = new ArrayList<>();
Collection<ValidationFailure> loadFailures = project
.getConfigurationTree()
.getLoadFailures();</BUG>
if (!loadFailures.isEmpty()) {
| frame.setTitle(ModelerConstants.TITLE
+ " - "
+ project.getConfigurationResource().getURL().getPath());
if (project.getConfigurationResource() != null) {
getLastDirectory().setDirectory(new File(project.getConfigurationResource().getURL().getPath()));
Collection<ValidationFailure> loadFailures = project.getConfigurationTree().getLoadFailures();
|
12,635 | if (!loadFailures.isEmpty()) {
project.setModified(true);
projectController.setDirty(true);
allFailures.addAll(loadFailures);
}
<BUG>ProjectValidator projectValidator = getApplication().getInjector().getInstance(
ProjectValidator.class);
ValidationResult validationResult = projectValidator.validate(project
.getRootNode());</BUG>
allFailures.addAll(validationResult.getFailures());
| ProjectValidator projectValidator = getApplication().getInjector().getInstance(ProjectValidator.class);
ValidationResult validationResult = projectValidator.validate(project.getRootNode());
|
12,636 | while (arr.size() > ModelerPreferences.LAST_PROJ_FILES_SIZE) {
arr.remove(arr.size() - 1);
}
try {
frefLastProjFiles.clear();
<BUG>}
catch (BackingStoreException e) {
</BUG>
}
int size = arr.size();
| } catch (BackingStoreException e) {
|
12,637 | import java.io.OutputStream;
import java.util.concurrent.locks.ReentrantLock;
import me.xiaopan.sketch.Sketch;
import me.xiaopan.sketch.cache.DiskCache;
import me.xiaopan.sketch.http.HttpStack;
<BUG>import me.xiaopan.sketch.util.DiskLruCache;
import me.xiaopan.sketch.util.SketchUtils;</BUG>
public class DownloadRequest extends AsyncRequest {
private DownloadOptions options;
private DownloadListener downloadListener;
| import me.xiaopan.sketch.util.LockPool;
import me.xiaopan.sketch.util.SketchUtils;
|
12,638 | import me.xiaopan.sketch.cache.BitmapPool;
import me.xiaopan.sketch.cache.DiskCache;
import me.xiaopan.sketch.request.ImageFrom;
import me.xiaopan.sketch.request.LoadRequest;
import me.xiaopan.sketch.request.UriScheme;
<BUG>import me.xiaopan.sketch.util.DiskLruCache;
import me.xiaopan.sketch.util.SketchUtils;</BUG>
public class ImagePreprocessor implements Identifier {
private static final String INSTALLED_APP_URI_HOST = "installedApp";
private static final String INSTALLED_APP_URI_PARAM_PACKAGE_NAME = "packageName";
| import me.xiaopan.sketch.util.LockPool;
import me.xiaopan.sketch.util.SketchUtils;
|
12,639 | import me.xiaopan.sketch.http.HttpStack;
import me.xiaopan.sketch.http.HurlStack;
import me.xiaopan.sketch.process.ImageProcessor;
import me.xiaopan.sketch.process.ResizeImageProcessor;
import me.xiaopan.sketch.request.RequestExecutor;
<BUG>import me.xiaopan.sketch.request.RequestFactory;
import me.xiaopan.sketch.util.SketchUtils;</BUG>
public class Configuration {
protected String logName = "Configuration";
private Context context; // 上下文
| import me.xiaopan.sketch.util.LockPool;
import me.xiaopan.sketch.util.SketchUtils;
|
12,640 | private ImagePreprocessor imagePreprocessor; // 本地图片预处理器
private ImageSizeCalculator imageSizeCalculator; // 图片尺寸计算器
private boolean globalPauseLoad; // 全局暂停加载新图片,开启后将只从内存缓存中找寻图片,只影响display请求
private boolean globalPauseDownload; // 全局暂停下载新图片,开启后将不再从网络下载新图片,只影响display请求
private boolean globalLowQualityImage; // 全局使用低质量的图片
<BUG>private boolean globalInPreferQualityOverSpeed; // false:解码时优先考虑速度;true:解码时优先考虑质量 (默认false)
private MobileNetworkGlobalPauseDownload mobileNetworkGlobalPauseDownload;</BUG>
public Configuration(Context context) {
context = context.getApplicationContext();
this.context = context;
| private LockPool lockPool; // 同步锁管理池
private MobileNetworkGlobalPauseDownload mobileNetworkGlobalPauseDownload;
|
12,641 | this.requestExecutor = new RequestExecutor();
this.resizeCalculator = new ResizeCalculator();
this.imagePreprocessor = new ImagePreprocessor();
this.imageSizeCalculator = new ImageSizeCalculator();
this.resizeImageProcessor = new ResizeImageProcessor();
<BUG>this.defaultImageDisplayer = new DefaultImageDisplayer();
if (Sketch.isDebugMode()) {</BUG>
Log.d(Sketch.TAG, getInfo());
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
| this.lockPool = new LockPool();
if (Sketch.isDebugMode()) {
|
12,642 | this.monitor = monitor;
if (Sketch.isDebugMode()) {
Log.d(Sketch.TAG, SketchUtils.concat(logName, ". setMonitor", ". ", monitor.getIdentifier()));
}
}
<BUG>}
public String getInfo() {</BUG>
StringBuilder builder = new StringBuilder();
builder.append(logName).append(": ");
if (diskCache != null) {
| public LockPool getLockPool() {
return lockPool;
public String getInfo() {
|
12,643 | import me.xiaopan.sketch.feature.ImagePreprocessor;
import me.xiaopan.sketch.feature.PreProcessResult;
import me.xiaopan.sketch.request.ImageFrom;
import me.xiaopan.sketch.request.LoadRequest;
import me.xiaopan.sketch.request.UriScheme;
<BUG>import me.xiaopan.sketch.util.DiskLruCache;
import me.xiaopan.sketch.util.SketchUtils;</BUG>
public class MyImagePreprocessor extends ImagePreprocessor {
public MyImagePreprocessor() {
logName = "MyImagePreprocessor";
| import me.xiaopan.sketch.util.LockPool;
import me.xiaopan.sketch.util.SketchUtils;
|
12,644 | package me.xiaopan.sketch.cache;
import android.content.Context;
import android.text.TextUtils;
import android.text.format.Formatter;
import android.util.Log;
<BUG>import java.util.Collections;
import java.util.Map;
import java.util.WeakHashMap;
import java.util.concurrent.locks.ReentrantLock;</BUG>
import me.xiaopan.sketch.Sketch;
| [DELETED] |
12,645 | import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
<BUG>import java.util.Collections;
import java.util.Map;
import java.util.WeakHashMap;
import java.util.concurrent.locks.ReentrantLock;</BUG>
import me.xiaopan.sketch.Configuration;
| [DELETED] |
12,646 | import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintStream;
import java.net.Proxy;
<BUG>import java.text.DateFormat;
import java.util.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;</BUG>
import java.util.regex.Matcher;
| import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
|
12,647 | import java.util.regex.Matcher;
<BUG>import java.util.regex.Pattern;
import static org.jenkinsci.plugins.github.pullrequest.GitHubPRTrigger.DescriptorImpl.getJenkinsInstance;
public class GitHubPRTrigger extends Trigger<AbstractProject<?, ?>> {
private static final Logger LOGGER = LoggerFactory.getLogger(GitHubPRTrigger.class);
private static final Pattern GH_FULL_REPO_NAME = Pattern.compile("^(http[s]?://[^/]*)/([^/]*/[^/]*).*");</BUG>
@CheckForNull
private GitHubPRTriggerMode triggerMode = GitHubPRTriggerMode.CRON;
@CheckForNull
private final List<GitHubPREvent> events;
| import static java.util.Arrays.asList;
import static org.jenkinsci.plugins.github.pullrequest.data.GitHubPREnv.*;
private static final Cause NO_CAUSE = null;
private static final Pattern GH_FULL_REPO_NAME = Pattern.compile("^(http[s]?://[^/]*)/([^/]*/[^/]*).*");
|
12,648 | return FormValidation.warning("GitHub API URI is \"https://api.github.com\". GitHub Enterprise API URL ends with \"/api/v3\"");
}
public FormValidation doCreateApiToken(@QueryParameter("username") final String username, @QueryParameter("password") final String password) {
try {
GitHub gh = new GitHubBuilder().withEndpoint(apiUrl).withPassword(username, password).build();
<BUG>GHAuthorization token = gh.createToken(Arrays.asList(GHAuthorization.REPO_STATUS, GHAuthorization.REPO), "Jenkins GitHub Pull Request Plugin", null);
return FormValidation.ok("Token created: " + token.getToken());</BUG>
} catch (IOException ex) {
return FormValidation.error("Can't create GitHub token " + ex.getMessage());
}
| GHAuthorization token = gh.createToken(asList(GHAuthorization.REPO_STATUS, GHAuthorization.REPO), "Jenkins GitHub Pull Request Plugin", null);
return FormValidation.ok("Token created: " + token.getToken());
|
12,649 | public static final String DELETE_ACTION_HISTORY_RESULT;
public static final String DELETE_ACTION_PLUGIN;
public static final String DELETE_ALERT;
public static final String DELETE_ALERT_CTIME;
public static final String DELETE_ALERT_LIFECYCLE;
<BUG>public static final String DELETE_ALERT_SEVERITY;
public static final String DELETE_ALERT_STATUS;</BUG>
public static final String DELETE_ALERT_TRIGGER;
public static final String DELETE_CONDITIONS;
public static final String DELETE_CONDITIONS_MODE;
| [DELETED] |
12,650 | public static final String INSERT_ACTION_PLUGIN;
public static final String INSERT_ACTION_PLUGIN_DEFAULT_PROPERTIES;
public static final String INSERT_ALERT;
public static final String INSERT_ALERT_CTIME;
public static final String INSERT_ALERT_LIFECYCLE;
<BUG>public static final String INSERT_ALERT_SEVERITY;
public static final String INSERT_ALERT_STATUS;</BUG>
public static final String INSERT_ALERT_TRIGGER;
public static final String INSERT_CONDITION_AVAILABILITY;
public static final String INSERT_CONDITION_COMPARE;
| [DELETED] |
12,651 | public static final String SELECT_ALERT_CTIME_START;
public static final String SELECT_ALERT_CTIME_START_END;
public static final String SELECT_ALERT_LIFECYCLE_END;
public static final String SELECT_ALERT_LIFECYCLE_START;
public static final String SELECT_ALERT_LIFECYCLE_START_END;
<BUG>public static final String SELECT_ALERT_STATUS;
public static final String SELECT_ALERT_SEVERITY;</BUG>
public static final String SELECT_ALERT_TRIGGER;
public static final String SELECT_ALERTS_BY_TENANT;
public static final String SELECT_CONDITION_ID;
| [DELETED] |
12,652 | DELETE_ALERT = "DELETE FROM " + keyspace + ".alerts " + "WHERE tenantId = ? AND alertId = ? ";
DELETE_ALERT_CTIME = "DELETE FROM " + keyspace + ".alerts_ctimes "
+ "WHERE tenantId = ? AND ctime = ? AND alertId = ? ";
DELETE_ALERT_LIFECYCLE = "DELETE FROM " + keyspace + ".alerts_lifecycle "
+ "WHERE tenantId = ? AND status = ? AND stime = ? AND alertId = ? ";
<BUG>DELETE_ALERT_SEVERITY = "DELETE FROM " + keyspace + ".alerts_severities "
+ "WHERE tenantId = ? AND severity = ? AND alertId = ? ";
DELETE_ALERT_STATUS = "DELETE FROM " + keyspace + ".alerts_statuses "
+ "WHERE tenantId = ? AND status = ? AND alertId = ? ";</BUG>
DELETE_ALERT_TRIGGER = "DELETE FROM " + keyspace + ".alerts_triggers "
| [DELETED] |
12,653 | INSERT_ALERT = "INSERT INTO " + keyspace + ".alerts " + "(tenantId, alertId, payload) VALUES (?, ?, ?) ";
INSERT_ALERT_CTIME = "INSERT INTO " + keyspace + ".alerts_ctimes "
+ "(tenantId, alertId, ctime) VALUES (?, ?, ?) ";
INSERT_ALERT_LIFECYCLE = "INSERT INTO " + keyspace + ".alerts_lifecycle "
+ "(tenantId, alertId, status, stime) VALUES (?, ?, ?, ?) ";
<BUG>INSERT_ALERT_SEVERITY = "INSERT INTO " + keyspace + ".alerts_severities "
+ "(tenantId, alertId, severity) VALUES (?, ?, ?) ";
INSERT_ALERT_STATUS = "INSERT INTO " + keyspace + ".alerts_statuses "
+ "(tenantId, alertId, status) VALUES (?, ?, ?) ";</BUG>
INSERT_ALERT_TRIGGER = "INSERT INTO " + keyspace + ".alerts_triggers "
| [DELETED] |
12,654 | + "WHERE tenantId = ? AND status = ? AND stime <= ? ";
SELECT_ALERT_LIFECYCLE_START = "SELECT alertId FROM " + keyspace + ".alerts_lifecycle "
+ "WHERE tenantId = ? AND status = ? AND stime >= ? ";
SELECT_ALERT_LIFECYCLE_START_END = "SELECT alertId FROM " + keyspace + ".alerts_lifecycle "
+ "WHERE tenantId = ? AND status = ? AND stime >= ? AND stime <= ? ";
<BUG>SELECT_ALERT_SEVERITY = "SELECT alertId FROM " + keyspace + ".alerts_severities "
+ "WHERE tenantId = ? AND severity = ? ";
SELECT_ALERT_STATUS = "SELECT alertId FROM " + keyspace + ".alerts_statuses "
+ "WHERE tenantId = ? AND status = ? ";</BUG>
SELECT_ALERTS_BY_TENANT = "SELECT payload FROM " + keyspace + ".alerts " + "WHERE tenantId = ? ";
| [DELETED] |
12,655 | import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
<BUG>import java.util.stream.Collectors;
import javax.ejb.EJB;</BUG>
import javax.ejb.Local;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
| import javax.annotation.PostConstruct;
import javax.ejb.EJB;
|
12,656 | import org.hawkular.alerts.api.model.trigger.Trigger;
import org.hawkular.alerts.api.services.ActionsService;
import org.hawkular.alerts.api.services.AlertsCriteria;
import org.hawkular.alerts.api.services.AlertsService;
import org.hawkular.alerts.api.services.DefinitionsService;
<BUG>import org.hawkular.alerts.api.services.EventsCriteria;
import org.hawkular.alerts.engine.impl.IncomingDataManagerImpl.IncomingData;</BUG>
import org.hawkular.alerts.engine.impl.IncomingDataManagerImpl.IncomingEvents;
import org.hawkular.alerts.engine.log.MsgLogger;
import org.hawkular.alerts.engine.service.AlertsEngine;
| import org.hawkular.alerts.api.services.PropertiesService;
import org.hawkular.alerts.engine.impl.IncomingDataManagerImpl.IncomingData;
|
12,657 | import com.datastax.driver.core.Session;
import com.google.common.util.concurrent.Futures;
@Local(AlertsService.class)
@Stateless
@TransactionAttribute(value = TransactionAttributeType.NOT_SUPPORTED)
<BUG>public class CassAlertsServiceImpl implements AlertsService {
private final MsgLogger msgLog = MsgLogger.LOGGER;
private final Logger log = Logger.getLogger(CassAlertsServiceImpl.class);
@EJB</BUG>
AlertsEngine alertsEngine;
| private static final String CRITERIA_NO_QUERY_SIZE = "hawkular-alerts.criteria-no-query-size";
private static final String CRITERIA_NO_QUERY_SIZE_ENV = "CRITERIA_NO_QUERY_SIZE";
private static final String CRITERIA_NO_QUERY_SIZE_DEFAULT = "200";
private int criteriaNoQuerySize;
|
12,658 | log.debug("Adding " + alerts.size() + " alerts");
}
PreparedStatement insertAlert = CassStatement.get(session, CassStatement.INSERT_ALERT);
PreparedStatement insertAlertTrigger = CassStatement.get(session, CassStatement.INSERT_ALERT_TRIGGER);
PreparedStatement insertAlertCtime = CassStatement.get(session, CassStatement.INSERT_ALERT_CTIME);
<BUG>PreparedStatement insertAlertStatus = CassStatement.get(session, CassStatement.INSERT_ALERT_STATUS);
PreparedStatement insertAlertSeverity = CassStatement.get(session, CassStatement.INSERT_ALERT_SEVERITY);</BUG>
PreparedStatement insertTag = CassStatement.get(session, CassStatement.INSERT_TAG);
try {
List<ResultSetFuture> futures = new ArrayList<>();
| [DELETED] |
12,659 | futures.add(session.executeAsync(insertAlertTrigger.bind(a.getTenantId(),
a.getAlertId(),
a.getTriggerId())));
futures.add(session.executeAsync(insertAlertCtime.bind(a.getTenantId(),
a.getAlertId(), a.getCtime())));
<BUG>futures.add(session.executeAsync(insertAlertStatus.bind(a.getTenantId(),
a.getAlertId(),
a.getStatus().name())));
futures.add(session.executeAsync(insertAlertSeverity.bind(a.getTenantId(),
a.getAlertId(),
a.getSeverity().name())));</BUG>
a.getTags().entrySet().stream().forEach(tag -> {
| [DELETED] |
12,660 | for (Row row : rsAlerts) {
String payload = row.getString("payload");
Alert alert = JsonUtil.fromJson(payload, Alert.class, thin);
alerts.add(alert);
}
<BUG>}
} catch (Exception e) {
msgLog.errorDatabaseException(e.getMessage());
throw e;
}
return preparePage(alerts, pager);</BUG>
}
| [DELETED] |
12,661 | for (Alert a : alertsToDelete) {
String id = a.getAlertId();
List<ResultSetFuture> futures = new ArrayList<>();
futures.add(session.executeAsync(deleteAlert.bind(tenantId, id)));
futures.add(session.executeAsync(deleteAlertCtime.bind(tenantId, a.getCtime(), id)));
<BUG>futures.add(session.executeAsync(deleteAlertSeverity.bind(tenantId, a.getSeverity().name(), id)));
futures.add(session.executeAsync(deleteAlertStatus.bind(tenantId, a.getStatus().name(), id)));</BUG>
futures.add(session.executeAsync(deleteAlertTrigger.bind(tenantId, a.getTriggerId(), id)));
a.getLifecycle().stream().forEach(l -> {
futures.add(
| [DELETED] |
12,662 | private Alert updateAlertStatus(Alert alert) throws Exception {
if (alert == null || alert.getAlertId() == null || alert.getAlertId().isEmpty()) {
throw new IllegalArgumentException("AlertId must be not null");
}
try {
<BUG>PreparedStatement deleteAlertStatus = CassStatement.get(session,
CassStatement.DELETE_ALERT_STATUS);
PreparedStatement insertAlertStatus = CassStatement.get(session,
CassStatement.INSERT_ALERT_STATUS);</BUG>
PreparedStatement insertAlertLifecycle = CassStatement.get(session,
| [DELETED] |
12,663 | PreparedStatement insertAlertLifecycle = CassStatement.get(session,
CassStatement.INSERT_ALERT_LIFECYCLE);
PreparedStatement updateAlert = CassStatement.get(session,
CassStatement.UPDATE_ALERT);
List<ResultSetFuture> futures = new ArrayList<>();
<BUG>for (Status statusToDelete : EnumSet.complementOf(EnumSet.of(alert.getStatus()))) {
futures.add(session.executeAsync(deleteAlertStatus.bind(alert.getTenantId(), statusToDelete.name(),
alert.getAlertId())));
}
futures.add(session.executeAsync(insertAlertStatus.bind(alert.getTenantId(), alert.getAlertId(), alert
.getStatus().name())));</BUG>
Alert.LifeCycle lifecycle = alert.getCurrentLifecycle();
| [DELETED] |
12,664 | String category = null;
Collection<String> categories = null;
String triggerId = null;
Collection<String> triggerIds = null;
Map<String, String> tags = null;
<BUG>boolean thin = false;
public EventsCriteria() {</BUG>
super();
}
public Long getStartTime() {
| Integer criteriaNoQuerySize = null;
public EventsCriteria() {
|
12,665 | }
@Override
public String toString() {
return "EventsCriteria [startTime=" + startTime + ", endTime=" + endTime + ", eventId=" + eventId
+ ", eventIds=" + eventIds + ", category=" + category + ", categories=" + categories + ", triggerId="
<BUG>+ triggerId + ", triggerIds=" + triggerIds + ", tags=" + tags + ", thin=" + thin + "]";
}</BUG>
}
| public void addTag(String name, String value) {
if (null == tags) {
tags = new HashMap<>();
|
12,666 | fileEntry, serviceContext.getCommunityPermissions(),
serviceContext.getGuestPermissions());
}
addFileVersion(
user, fileEntry, serviceContext.getModifiedDate(now),
<BUG>fileEntry.getVersion(), null, serviceContext.getStatus());
if (folderId != DLFolderConstants.DEFAULT_PARENT_FOLDER_ID) {</BUG>
DLFolder folder = dlFolderPersistence.findByPrimaryKey(folderId);
folder.setLastPostDate(fileEntry.getModifiedDate());
dlFolderPersistence.update(folder, false);
| DLFileEntryConstants.DEFAULT_VERSION, null,
if (folderId != DLFolderConstants.DEFAULT_PARENT_FOLDER_ID) {
|
12,667 | fileEntry = newFileEntry;
}
updateAsset(
userId, fileEntry, serviceContext.getAssetCategoryIds(),
serviceContext.getAssetTagNames());
<BUG>String version = getNextVersion(fileEntry, majorVersion);
if (is == null) {</BUG>
fileEntry.setVersion(version);
dlFileEntryPersistence.update(fileEntry, false);
int fetchFailures = 0;
| String version = getNextVersion(
fileEntry, majorVersion, serviceContext.getStatus());
if (is == null) {
|
12,668 | import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.LocalFileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.permission.FsPermission;
import org.apache.hadoop.util.Progressable;
<BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*;
public class S3AFileSystem extends FileSystem {</BUG>
private URI uri;
private Path workingDir;
private AmazonS3Client s3;
| import static org.apache.hadoop.fs.s3a.Constants.*;
public class S3AFileSystem extends FileSystem {
|
12,669 | public void initialize(URI name, Configuration conf) throws IOException {
super.initialize(name, conf);
uri = URI.create(name.getScheme() + "://" + name.getAuthority());
workingDir = new Path("/user", System.getProperty("user.name")).makeQualified(this.uri,
this.getWorkingDirectory());
<BUG>String accessKey = conf.get(ACCESS_KEY, null);
String secretKey = conf.get(SECRET_KEY, null);
</BUG>
String userInfo = name.getUserInfo();
| String accessKey = conf.get(NEW_ACCESS_KEY, conf.get(OLD_ACCESS_KEY, null));
String secretKey = conf.get(NEW_SECRET_KEY, conf.get(OLD_SECRET_KEY, null));
|
12,670 | } else {
accessKey = userInfo;
}
}
AWSCredentialsProviderChain credentials = new AWSCredentialsProviderChain(
<BUG>new S3ABasicAWSCredentialsProvider(accessKey, secretKey),
new InstanceProfileCredentialsProvider(),
new S3AAnonymousAWSCredentialsProvider()
);</BUG>
bucket = name.getHost();
| new BasicAWSCredentialsProvider(accessKey, secretKey),
new AnonymousAWSCredentialsProvider()
|
12,671 |
awsConf.setSocketTimeout(conf.getInt(SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT));
</BUG>
s3 = new AmazonS3Client(credentials, awsConf);
<BUG>maxKeys = conf.getInt(MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS);
partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE);
partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
</BUG>
if (partSize < 5 * 1024 * 1024) {
| new InstanceProfileCredentialsProvider(),
new AnonymousAWSCredentialsProvider()
bucket = name.getHost();
ClientConfiguration awsConf = new ClientConfiguration();
awsConf.setMaxConnections(conf.getInt(NEW_MAXIMUM_CONNECTIONS, conf.getInt(OLD_MAXIMUM_CONNECTIONS, DEFAULT_MAXIMUM_CONNECTIONS)));
awsConf.setProtocol(conf.getBoolean(NEW_SECURE_CONNECTIONS, conf.getBoolean(OLD_SECURE_CONNECTIONS, DEFAULT_SECURE_CONNECTIONS)) ? Protocol.HTTPS : Protocol.HTTP);
awsConf.setMaxErrorRetry(conf.getInt(NEW_MAX_ERROR_RETRIES, conf.getInt(OLD_MAX_ERROR_RETRIES, DEFAULT_MAX_ERROR_RETRIES)));
awsConf.setSocketTimeout(conf.getInt(NEW_SOCKET_TIMEOUT, conf.getInt(OLD_SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT)));
maxKeys = conf.getInt(NEW_MAX_PAGING_KEYS, conf.getInt(OLD_MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS));
partSize = conf.getLong(NEW_MULTIPART_SIZE, conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE));
partSizeThreshold = conf.getInt(NEW_MIN_MULTIPART_THRESHOLD, conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD));
|
12,672 | cannedACL = null;
}
if (!s3.doesBucketExist(bucket)) {
throw new IOException("Bucket " + bucket + " does not exist");
}
<BUG>boolean purgeExistingMultipart = conf.getBoolean(PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART);
long purgeExistingMultipartAge = conf.getLong(PURGE_EXISTING_MULTIPART_AGE, DEFAULT_PURGE_EXISTING_MULTIPART_AGE);
</BUG>
if (purgeExistingMultipart) {
| boolean purgeExistingMultipart = conf.getBoolean(NEW_PURGE_EXISTING_MULTIPART, conf.getBoolean(OLD_PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART));
long purgeExistingMultipartAge = conf.getLong(NEW_PURGE_EXISTING_MULTIPART_AGE, conf.getLong(OLD_PURGE_EXISTING_MULTIPART_AGE, DEFAULT_PURGE_EXISTING_MULTIPART_AGE));
|
12,673 | import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
<BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*;
public class S3AOutputStream extends OutputStream {</BUG>
private OutputStream backupStream;
private File backupFile;
private boolean closed;
| import static org.apache.hadoop.fs.s3a.Constants.*;
public class S3AOutputStream extends OutputStream {
|
12,674 | this.client = client;
this.progress = progress;
this.fs = fs;
this.cannedACL = cannedACL;
this.statistics = statistics;
<BUG>partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE);
partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
</BUG>
if (conf.get(BUFFER_DIR, null) != null) {
| partSize = conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE);
partSizeThreshold = conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
|
12,675 | import java.io.*;
import java.net.URL;
import java.net.URLConnection;
import java.nio.ByteBuffer;
import java.util.Comparator;
<BUG>import java.util.HashMap;
import java.util.List;</BUG>
import java.util.Locale;
import java.util.Map;
import java.util.TreeMap;
| import java.util.LinkedList;
import java.util.List;
|
12,676 | import org.ofbiz.base.util.FileUtil;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilHttp;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilProperties;
<BUG>import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.base.util.collections.MapStack;</BUG>
import org.ofbiz.base.util.template.FreeMarkerWorker;
import org.ofbiz.base.location.FlexibleLocation;
import org.ofbiz.content.content.UploadContentAndImage;
| import org.ofbiz.base.util.UtilXml;
import org.ofbiz.base.util.collections.MapStack;
|
12,677 | import org.ofbiz.service.LocalDispatcher;
import org.ofbiz.widget.html.HtmlScreenRenderer;
import org.ofbiz.widget.screen.ModelScreen;
import org.ofbiz.widget.screen.ScreenFactory;
import org.ofbiz.widget.screen.ScreenRenderer;
<BUG>import org.ofbiz.widget.screen.ScreenStringRenderer;
import org.xml.sax.SAXException;</BUG>
import freemarker.template.Template;
import freemarker.template.TemplateException;
import javolution.util.FastMap;
| import org.w3c.dom.Document;
import org.xml.sax.SAXException;
|
12,678 | } else {
updateMemo();
callback.updateMemo();
}
dismiss();
<BUG>}else{
</BUG>
Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show();
}
}
| [DELETED] |
12,679 | }
@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);
|
12,680 | 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 != null) {
c.moveToFirst();
}
| MemoEntry.COLUMN_ORDER + " ASC", null);
|
12,681 | 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(
|
12,682 | 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.Adapter<RecyclerView.ViewHolder> implements EditMode {
</BUG>
private List<MemoEntity> memoList;
| import com.marshalchen.ultimaterecyclerview.dragsortadapter.DragSortAdapter;
public class MemoAdapter extends DragSortAdapter<DragSortAdapter.ViewHolder> implements EditMode {
|
12,683 | 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, EditMemoDialogFragment.MemoCallback callback) {
this.mActivity = activity;</BUG>
this.topicId = topicId;
this.memoList = memoList;
| public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback, RecyclerView recyclerView) {
super(recyclerView);
this.mActivity = activity;
|
12,684 | 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) {
|
12,685 | 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;
|
12,686 | customTokens.put("%%mlFinalForestsPerHost%%", hubConfig.finalForestsPerHost.toString());
customTokens.put("%%mlTraceAppserverName%%", hubConfig.traceHttpName);
customTokens.put("%%mlTracePort%%", hubConfig.tracePort.toString());
customTokens.put("%%mlTraceDbName%%", hubConfig.traceDbName);
customTokens.put("%%mlTraceForestsPerHost%%", hubConfig.traceForestsPerHost.toString());
<BUG>customTokens.put("%%mlModulesDbName%%", hubConfig.modulesDbName);
}</BUG>
public void init() {
try {
LOGGER.error("PLUGINS DIR: " + pluginsDir.toString());
| customTokens.put("%%mlTriggersDbName%%", hubConfig.triggersDbName);
customTokens.put("%%mlSchemasDbName%%", hubConfig.schemasDbName);
}
|
12,687 | private final StopWatchTimer _timer = new StopWatchTimer();
private StopWatchTimer timer() {
return _timer;
}
class StopWatchTimer implements Runnable {
<BUG>long maximumRequestErrorTime;
long maximumRequestWarnTime;
long maximumRequestFatalTime;
Map<Thread, Long> _requestThreads = new WeakHashMap<Thread, Long>();</BUG>
Map<Thread, Map<Thread, StackTraceElement[]>> _warnTraces = Collections.synchronizedMap(new WeakHashMap<Thread, Map<Thread, StackTraceElement[]>>());
| long _maximumRequestErrorTime;
long _maximumRequestWarnTime;
long _maximumRequestFatalTime;
long _lastLog;
Map<Thread, Long> _requestThreads = new WeakHashMap<Thread, Long>();
|
12,688 | Map<Thread, Map<Thread, String>> _fatalTracesNames = Collections.synchronizedMap(new WeakHashMap<Thread, Map<Thread, String>>());
public StopWatchTimer() {
Thread timerThread = new Thread(this);
timerThread.setDaemon(true);
timerThread.start();
<BUG>maximumRequestWarnTime = ERXProperties.longForKeyWithDefault("er.extensions.ERXStatisticsStore.milliSeconds.warn", 2000L);
maximumRequestErrorTime = ERXProperties.longForKeyWithDefault("er.extensions.ERXStatisticsStore.milliSeconds.error", 10000L);
maximumRequestFatalTime = ERXProperties.longForKeyWithDefault("er.extensions.ERXStatisticsStore.milliSeconds.fatal", 5 * 60 * 1000L);
</BUG>
}
| _maximumRequestWarnTime = ERXProperties.longForKeyWithDefault("er.extensions.ERXStatisticsStore.milliSeconds.warn", 2000L);
_maximumRequestErrorTime = ERXProperties.longForKeyWithDefault("er.extensions.ERXStatisticsStore.milliSeconds.error", 10000L);
_maximumRequestFatalTime = ERXProperties.longForKeyWithDefault("er.extensions.ERXStatisticsStore.milliSeconds.fatal", 5 * 60 * 1000L);
|
12,689 | names = _warnTracesNames.remove(currentThread);
}
String trace = stringFromTraces(traces, names);
synchronized (_requestThreads) {
_requestThreads.remove(Thread.currentThread());
<BUG>}
if (requestTime > maximumRequestFatalTime) {
</BUG>
String requestDescription = aContext == null ? aString : descriptionForContext(aContext);
log.fatal("Request did take too long : " + requestTime + "ms request was: " + requestDescription + trace);
| long currentTime = System.currentTimeMillis();
if(currentTime - _lastLog > 10000) {
return;
_lastLog = currentTime;
if (requestTime > _maximumRequestFatalTime) {
|
12,690 | private void checkThreads() {
Map<Thread, Long> requestThreads = new HashMap<Thread, Long>();
synchronized (_requestThreads) {
requestThreads.putAll(_requestThreads);
}
<BUG>if (!requestThreads.isEmpty()) {
for (Iterator iterator = requestThreads.keySet().iterator(); iterator.hasNext();) {</BUG>
Thread thread = (Thread) iterator.next();
Long time = requestThreads.get(thread);
if (time != null) {
| Map traces = null;
for (Iterator iterator = requestThreads.keySet().iterator(); iterator.hasNext();) {
|
12,691 | import org.jgroups.util.Digest;
import org.jgroups.util.Promise;
import org.jgroups.util.Streamable;
import org.jgroups.util.Util;
import java.io.*;
<BUG>import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;</BUG>
import java.util.concurrent.atomic.AtomicInteger;
public class FLUSH extends Protocol {
public static final String NAME = "FLUSH";
| import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
|
12,692 | private final Object sharedLock = new Object();
private final Object blockMutex = new Object();
@GuardedBy("blockMutex")
private volatile boolean isBlockingFlushDown = true;
private long timeout = 8000;
<BUG>private long start_flush_timeout = 6000;
</BUG>
private boolean enable_reconciliation = true;
private final AtomicInteger viewCounter = new AtomicInteger(0);
private volatile boolean allowMessagesToPassUp = false;
| private long start_flush_timeout = 8000;
|
12,693 | case Event.CONNECT:
case Event.CONNECT_WITH_STATE_TRANSFER:
sendBlockUpToChannel();
break;
case Event.SUSPEND:
<BUG>return startFlush(evt, 3, false);
case Event.RESUME:</BUG>
onResume();
return null;
}
| return startFlush(evt);
case Event.RESUME:
|
12,694 | fhr.addDigest(digest);
Message msg = new Message(flushStarter);
msg.putHeader(getName(), fhr);
down_prot.down(new Event(Event.MSG, msg));
if(log.isDebugEnabled())
<BUG>log.debug("Received START_FLUSH at " + localAddress + " responded with FLUSH_OK");
</BUG>
}
else{
if(log.isDebugEnabled())
| log.debug("Received START_FLUSH at " + localAddress + " responded with FLUSH_COMPLETED");
|
12,695 | <BUG>package com.continuuity.data.table.converter;
import com.continuuity.data.table.ColumnarTable;</BUG>
import com.continuuity.data.table.KVTable;
public class KVTableOnColumnarTable implements KVTable {
private static final byte [] COLUMN = new byte [] { (byte)0 };
| import com.continuuity.api.data.OperationException;
import com.continuuity.api.data.OperationResult;
import com.continuuity.data.table.ColumnarTable;
|
12,696 | @Override
public void put(byte[] key, byte[] value) {
columnarTable.put(key, COLUMN, value);
}
@Override
<BUG>public byte[] get(byte[] key) {
</BUG>
return columnarTable.get(key, COLUMN);
}
@Override
| public OperationResult<byte[]> get(byte[] key) {
|
12,697 | @Override
public String getName() {
return "noop";
}
@Override
<BUG>public void execute(List<WriteOperation> writes) throws OmidTransactionException {
</BUG>
}
@Override
public DequeueResult execute(QueueDequeue dequeue) {
| public void execute(List<WriteOperation> writes) throws OperationException {
|
12,698 | public void execute(CompareAndSwap cas) throws OperationException {
this.randomTable.compareAndSwap(cas.getKey(), Operation.KV_COL,
cas.getExpectedValue(), cas.getNewValue());
}
@Override
<BUG>public void execute(Increment inc) {
this.randomTable.increment(</BUG>
inc.getKey(), inc.getColumns()[0], inc.getAmounts()[0]);
}
@Override
| public void execute(Increment inc) throws OperationException {
this.randomTable.increment(
|
12,699 | <BUG>package com.continuuity.data.table.converter;
import com.continuuity.data.table.ReadPointer;</BUG>
import com.continuuity.data.table.VersionedColumnarTable;
import com.continuuity.data.table.VersionedKVTable;
public class VersionedKVOnVersionedColumnarTable implements VersionedKVTable {
| import com.continuuity.api.data.OperationException;
import com.continuuity.api.data.OperationResult;
import com.continuuity.data.table.ReadPointer;
|
12,700 | @Override
public void put(byte[] key, byte[] value, long version) {
this.table.put(key, COLUMN, version, value);
}
@Override
<BUG>public byte[] get(byte[] key, ReadPointer readPointer) {
</BUG>
return this.table.get(key, COLUMN, readPointer);
}
@Override
| public OperationResult<byte[]> get(byte[] key, ReadPointer readPointer) {
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.