id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
5,601 | import soc.message.SOCServerPing;
import soc.server.genericServer.StringConnection;
public class SOCServerRobotPinger extends Thread
{
private Vector<StringConnection> robotConnections;
<BUG>private int sleepTime = 150000;
private SOCServerPing ping;
</BUG>
private boolean alive;
| private final int sleepTime = 150000;
private final SOCServerPing ping;
|
5,602 | sleep(sleepTime - 60000);
}
catch (InterruptedException exc) {}
}
robotConnections = null;
<BUG>ping = null;</BUG>
}
public void stopPinger()
{
alive = false;
}
} // public class SOCServerRobotPinger
| [DELETED] |
5,603 | model.put("description", descriptor.getDescription());
model.put("optional", descriptor.isOptional());
model.putAll(descriptor.getAttributes());
return model;
}
<BUG>public LinksSnippet and(LinkDescriptor... additionalDescriptors) {
List<LinkDescriptor> combinedDescriptors = new ArrayList<>();
combinedDescriptors.addAll(this.descriptorsByRel.values());
combinedDescriptors.addAll(Arrays.asList(additionalDescriptors));
return new LinksSnippet(this.linkExtractor, combinedDescriptors, getAttributes());</BUG>
}
| [DELETED] |
5,604 | private ImmutableList<String> buildAnnotations(TypeSimplifier typeSimplifier) {
ImmutableList.Builder<String> builder = ImmutableList.builder();
for (AnnotationMirror annotationMirror : method.getAnnotationMirrors()) {
TypeElement annotationElement =
(TypeElement) annotationMirror.getAnnotationType().asElement();
<BUG>if (annotationElement.getQualifiedName().toString().equals(Override.class.getName())) {
</BUG>
continue;
}
AnnotationOutput annotationOutput = new AnnotationOutput(typeSimplifier);
| if (annotationElement.getQualifiedName().contentEquals(Override.class.getName())) {
|
5,605 | package com.projecttango.examples.java.augmentedreality;
import com.google.atap.tangoservice.Tango;
import com.google.atap.tangoservice.Tango.OnTangoUpdateListener;
import com.google.atap.tangoservice.TangoCameraIntrinsics;
import com.google.atap.tangoservice.TangoConfig;
<BUG>import com.google.atap.tangoservice.TangoCoordinateFramePair;
import com.google.atap.tangoservice.TangoEvent;</BUG>
import com.google.atap.tangoservice.TangoOutOfDateException;
import com.google.atap.tangoservice.TangoPoseData;
import com.google.atap.tangoservice.TangoXyzIjData;
| import com.google.atap.tangoservice.TangoErrorException;
import com.google.atap.tangoservice.TangoEvent;
|
5,606 | super.onResume();
if (!mIsConnected) {
mTango = new Tango(AugmentedRealityActivity.this, new Runnable() {
@Override
public void run() {
<BUG>try {
connectTango();</BUG>
setupRenderer();
mIsConnected = true;
} catch (TangoOutOfDateException e) {
| TangoSupport.initialize();
connectTango();
|
5,607 | if (lastFramePose.statusCode == TangoPoseData.POSE_VALID) {
mRenderer.updateRenderCameraPose(lastFramePose, mExtrinsics);
mCameraPoseTimestamp = lastFramePose.timestamp;</BUG>
} else {
<BUG>Log.w(TAG, "Can't get device pose at time: " + mRgbTimestampGlThread);
}</BUG>
}
}
}
@Override
| mRenderer.updateRenderCameraPose(lastFramePose);
mCameraPoseTimestamp = lastFramePose.timestamp;
Log.w(TAG, "Can't get device pose at time: " +
|
5,608 | import org.rajawali3d.materials.Material;
import org.rajawali3d.materials.methods.DiffuseMethod;
import org.rajawali3d.materials.textures.ATexture;
import org.rajawali3d.materials.textures.StreamingTexture;
import org.rajawali3d.materials.textures.Texture;
<BUG>import org.rajawali3d.math.Matrix4;
import org.rajawali3d.math.vector.Vector3;</BUG>
import org.rajawali3d.primitives.ScreenQuad;
import org.rajawali3d.primitives.Sphere;
import org.rajawali3d.renderer.RajawaliRenderer;
| import org.rajawali3d.math.Quaternion;
import org.rajawali3d.math.vector.Vector3;
|
5,609 | translationMoon.setRepeatMode(Animation.RepeatMode.INFINITE);
translationMoon.setTransformable3D(moon);
getCurrentScene().registerAnimation(translationMoon);
translationMoon.play();
}
<BUG>public void updateRenderCameraPose(TangoPoseData devicePose, DeviceExtrinsics extrinsics) {
Pose cameraPose = ScenePoseCalculator.toOpenGlCameraPose(devicePose, extrinsics);
getCurrentCamera().setRotation(cameraPose.getOrientation());
getCurrentCamera().setPosition(cameraPose.getPosition());
}</BUG>
public int getTextureId() {
| public void updateRenderCameraPose(TangoPoseData cameraPose) {
float[] rotation = cameraPose.getRotationAsFloats();
float[] translation = cameraPose.getTranslationAsFloats();
Quaternion quaternion = new Quaternion(rotation[3], rotation[0], rotation[1], rotation[2]);
getCurrentCamera().setRotation(quaternion.conjugate());
getCurrentCamera().setPosition(translation[0], translation[1], translation[2]);
|
5,610 | package com.projecttango.examples.java.helloareadescription;
import com.google.atap.tangoservice.Tango;
<BUG>import com.google.atap.tangoservice.Tango.OnTangoUpdateListener;
import com.google.atap.tangoservice.TangoConfig;</BUG>
import com.google.atap.tangoservice.TangoCoordinateFramePair;
import com.google.atap.tangoservice.TangoErrorException;
import com.google.atap.tangoservice.TangoEvent;
| import com.google.atap.tangoservice.TangoAreaDescriptionMetaData;
import com.google.atap.tangoservice.TangoConfig;
|
5,611 | Map.Entry<String, JsonNode> property = properties.next();
JsonNode propertyObj = property.getValue();
if (onlyRequired) {
if (propertyObj.has("required") && propertyObj.get("required").asBoolean()) {
rtn.add(nameHelper.getPropertyName(property.getKey(), property.getValue()));
<BUG>}
} else {
rtn.add((nameHelper.getPropertyName(property.getKey(), property.getValue())));
}</BUG>
}
| if (draft4RequiredProperties.contains(property.getKey())) {
|
5,612 | 0, constructors[0].getParameterTypes().length);
}
public static class AllPropertiesIT {
@ClassRule public static Jsonschema2PojoRule classSchemaRule = new Jsonschema2PojoRule();
protected static Class<?> typeWithRequired;
<BUG>private static Class<?> typeWithoutProperties;
@BeforeClass</BUG>
public static void generateAndCompileConstructorClasses() throws ClassNotFoundException {
Map<String, Object> config = config("propertyWordDelimiters", "_",
"includeConstructors", true
| protected static Class<?> typeWithRequiredArray;
@BeforeClass
|
5,613 | package io.fabric8.forge.devops.setup;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Properties;
<BUG>import io.fabric8.forge.addon.utils.CamelProjectHelper;
import io.fabric8.forge.addon.utils.VersionHelper;
import org.apache.maven.model.Model;</BUG>
import org.jboss.forge.addon.dependencies.Coordinate;
import org.jboss.forge.addon.dependencies.builder.CoordinateBuilder;
| import io.fabric8.forge.addon.utils.MavenHelpers;
import io.fabric8.utils.Strings;
import org.apache.maven.model.Model;
|
5,614 | public class DockerSetupHelper {
private static String dockerFromImagePrefix = "docker.io/";
private static String[] jarImages = new String[]{"fabric8/java"};
private static String[] bundleImages = new String[]{"fabric8/karaf-2.4"};
private static String[] warImages = new String[]{"fabric8/tomcat-8.0", "jboss/wildfly"};
<BUG>public static void setupDocker(Project project, String fromImage, String main) {
MavenPluginBuilder plugin = MavenPluginBuilder.create()</BUG>
.setCoordinate(createCoordinate("org.jolokia", "docker-maven-plugin", VersionHelper.dockerVersion()));
ConfigurationElement cfgName = ConfigurationElementBuilder.create().setName("name").setText("${docker.image}");
ConfigurationElement cfgFrom = ConfigurationElementBuilder.create().setName("from").setText("${docker.from}");
| MavenFacet maven = project.getFacet(MavenFacet.class);
Model pom = maven.getModel();
if (!MavenHelpers.hasMavenPlugin(pom, "org.jolokia", "docker-maven-plugin")) {
MavenPluginBuilder plugin = MavenPluginBuilder.create()
|
5,615 | cfgImages.getChildren().add(cfgImage);
setupDockerProperties(project, fromImage);
MavenPluginFacet pluginFacet = project.getFacet(MavenPluginFacet.class);
plugin.createConfiguration().addConfigurationElement(cfgImages);
pluginFacet.addPlugin(plugin);
<BUG>}
public static void setupDockerProperties(Project project, String fromImage) {</BUG>
String packaging = getProjectPackaging(project);
boolean springBoot = hasSpringBootMavenPlugin(project);
boolean war = packaging != null && packaging.equals("war");
| public static void setupDockerProperties(Project project, String fromImage) {
|
5,616 | private UISelectOne<String> from;
@Inject
@WithAttributes(label = "main", required = false, description = "Main class to use for Java standalone")
private UIInput<String> main;
@Inject
<BUG>@WithAttributes(label = "container", required = false, description = "Container label to use for the app")
</BUG>
private UIInput<String> container;
@Inject
@WithAttributes(label = "group", required = false, description = "Group label to use for the app")
| @WithAttributes(label = "container", required = false, description = "Container name to use for the app")
|
5,617 | import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
<BUG>import android.support.v4.app.NavUtils;
import android.support.v7.app.AppCompatActivity;</BUG>
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.ContextMenu;
| import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.AppCompatActivity;
|
5,618 | import android.database.ContentObserver;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
<BUG>import android.support.v4.app.NavUtils;
import android.support.v7.app.AppCompatActivity;</BUG>
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.ContextMenu;
| import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.AppCompatActivity;
|
5,619 | import android.os.Handler;
import android.os.Looper;
import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import android.preference.PreferenceManager;
<BUG>import android.support.design.widget.FloatingActionButton;
import android.support.v7.widget.Toolbar;</BUG>
import android.util.Log;
import android.view.ContextMenu;
import android.view.KeyEvent;
| import android.support.v4.view.MenuItemCompat;
import android.support.v7.widget.Toolbar;
|
5,620 | mAltitude.setOnCheckedChangeListener(mCheckedChangeListener);
mDistance.setOnCheckedChangeListener(mCheckedChangeListener);
mCompass.setOnCheckedChangeListener(mCheckedChangeListener);
mLocation.setOnCheckedChangeListener(mCheckedChangeListener);
builder.setTitle(R.string.dialog_layer_title).setIcon(android.R.drawable.ic_dialog_map).setPositiveButton
<BUG>(R.string.btn_okay, null).setView(view);
</BUG>
dialog = builder.create();
return dialog;
case DIALOG_NOTRACK:
| (android.R.string.ok, null).setView(view);
|
5,621 | import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
<BUG>import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;</BUG>
import java.util.Iterator;
import java.util.List;
| import java.util.HashMap;
import java.util.HashSet;
|
5,622 | throws EclipsePluginException
{
assertNotEmpty( project.getGroupId(), "groupId" );
assertNotEmpty( project.getArtifactId(), "artifactId" );
File projectBaseDir = project.getFile().getParentFile();
<BUG>Collection referencedProjects = writeEclipseClasspath( projectBaseDir, outputDir, project, executedProject, reactorProjects );
writeEclipseProject( projectBaseDir, outputDir, project, executedProject, referencedProjects );
writeEclipseSettings( projectBaseDir, outputDir, project, executedProject );
log.info( "Wrote Eclipse project for " + project.getArtifactId() + " to " + outputDir.getAbsolutePath() );</BUG>
}
| Map eclipseSourceRoots = new HashMap();
Collection referencedProjects = writeEclipseClasspath(
projectBaseDir, outputDir, project, executedProject, reactorProjects, eclipseSourceRoots
writeEclipseProject( projectBaseDir, outputDir, project, executedProject, referencedProjects, eclipseSourceRoots );
writeEclipseSettings( projectBaseDir, outputDir, project, executedProject);
log.info( "Wrote Eclipse project for " + project.getArtifactId() + " to " + outputDir.getAbsolutePath() );
|
5,623 | else
{
log.info( "Not writing settings - defaults suffice" );
}
}
<BUG>protected void writeEclipseProject( File projectBaseDir, File basedir, MavenProject project, MavenProject executedProject, Collection referencedProjects )
</BUG>
throws EclipsePluginException
{
FileWriter w;
| protected void writeEclipseProject( File projectBaseDir, File basedir, MavenProject project, MavenProject executedProject, Collection referencedProjects, Map eclipseSourceRoots )
|
5,624 | writer.endElement(); // natures
if ( ! projectBaseDir.equals( basedir ) )
{
writer.startElement( "linkedResources" );
addFileLink( writer, projectBaseDir, basedir, project.getFile() );
<BUG>addSourceLinks( writer, projectBaseDir, basedir, executedProject.getCompileSourceRoots() );
addResourceLinks( writer, projectBaseDir, basedir, executedProject.getBuild().getResources() );
addSourceLinks( writer, projectBaseDir, basedir, executedProject.getTestCompileSourceRoots() );
addResourceLinks( writer, projectBaseDir, basedir, executedProject.getBuild().getTestResources() );</BUG>
writer.endElement(); // linkedResources
| addSourceLinks( writer, projectBaseDir, basedir, eclipseSourceRoots );
|
5,625 | writer.endElement(); // linkedResources
}
writer.endElement(); // projectDescription
close( w );
}
<BUG>protected Collection writeEclipseClasspath( File projectBaseDir, File basedir, MavenProject project, MavenProject executedProject, List reactorProjects )
</BUG>
throws EclipsePluginException
{
FileWriter w;
| protected Collection writeEclipseClasspath( File projectBaseDir, File basedir, MavenProject project, MavenProject executedProject, List reactorProjects, Map eclipseSourceRoots )
|
5,626 | }
writer.endElement();
close( w );
return referencedProjects;
}
<BUG>private void addSourceRoots( XMLWriter writer, File projectBaseDir, File basedir, List sourceRoots, String output )
</BUG>
{
for ( Iterator it = sourceRoots.iterator(); it.hasNext(); )
{
| private void addSourceRoots( XMLWriter writer, File projectBaseDir, File basedir, List sourceRoots, String output, Map addedSourceRoots )
|
5,627 | if ( resource.getExcludes().size() != 0 )
{
log.warn( "This plugin currently doesn't support exclude patterns for resources. Adding the entire directory." );
}
if ( !StringUtils.isEmpty( resource.getTargetPath() ) )
<BUG>{
log.error( "This plugin currently doesn't support target paths for resources." );
return;</BUG>
}
File resourceDirectory = new File( resource.getDirectory() );
| output = resource.getTargetPath();
|
5,628 | import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.DefaultArtifactRepository;
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.MavenProjectBuilder;
<BUG>import org.codehaus.plexus.PlexusTestCase;
import java.io.BufferedReader;</BUG>
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
| import org.codehaus.plexus.util.StringUtils;
import java.io.BufferedReader;
|
5,629 | extends PlexusTestCase
{
public void testProject1()
throws Exception
{
<BUG>testProject( "project-1" );
</BUG>
}
public void testProject2()
throws Exception
| testProject( "project-1", null );
|
5,630 | </BUG>
}
public void testProject2()
throws Exception
{
<BUG>testProject( "project-2" );
}
private void testProject( String projectName )
</BUG>
throws Exception
| extends PlexusTestCase
public void testProject1()
testProject( "project-1", null );
testProject( "project-2", null );
public void testProject3()
|
5,631 | artifact.setFile(new File(localRepository.getBasedir(), localRepository.pathOf(artifact)));
}
plugin.setProject( project );
plugin.setLocalRepository( localRepository );
plugin.execute();
<BUG>assertFileEquals( localRepository.getBasedir(), new File( basedir, "project" ), new File( basedir, ".project" ) );
assertFileEquals( localRepository.getBasedir(), new File( basedir, "classpath" ), new File( basedir, ".classpath" ) );
</BUG>
}
| assertFileEquals( localRepository.getBasedir(), new File( basedir, "project" ), new File( projectOutputDir, ".project" ) );
assertFileEquals( localRepository.getBasedir(), new File( basedir, "classpath" ), new File( projectOutputDir, ".classpath" ) );
|
5,632 | this.project = project;
}
public void setLocalRepository( ArtifactRepository localRepository )
{
this.localRepository = localRepository;
<BUG>}
public void execute()</BUG>
throws MojoExecutionException
{
if ( project.getFile() == null || !project.getFile().exists() )
| public void setOutputDir( File outputDir )
this.outputDir = outputDir;
public void execute()
|
5,633 | 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 PatchUtils {
| import java.text.DateFormat;
import java.util.Date;
import java.util.List;
|
5,634 | 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;
|
5,635 | 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"),
MISC_FILES("misc-files"),
| APPLIES_TO_VERSION("applies-to-version"),
BUNDLES("bundles"),
|
5,636 | 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_VERSION:
if(type == Patch.PatchType.CUMULATIVE) {
| [DELETED] |
5,637 | 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, bytesToHexString(item.getContentHash()));
}
if(type != ModificationType.ADD) {
| if (item.isDirectory()) {
writer.writeAttribute(Attribute.DIRECTORY.name, "true");
if(type != ModificationType.REMOVE) {
|
5,638 | 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>
import java.util.List;
@MessageBundle(projectCode = "JBAS")
public interface PatchMessages {
| import org.jboss.logging.annotations.Cause;
import java.io.IOException;
|
5,639 | private static final String UPGRADE_QUERY_SUFFIX = ".sql";
private final Context mContext;
private final SharedPreferences prefs;
private static DbHelper instance = null;
private SQLiteDatabase db;
<BUG>public static synchronized DbHelper getInstance() {
if (instance == null) {
instance = new DbHelper(OmniNotes.getAppContext());
</BUG>
}
| return getInstance(OmniNotes.getAppContext());
public static synchronized DbHelper getInstance(Context context) {
instance = new DbHelper(context);
|
5,640 | whereCondition.append(" WHERE ");
for (int i = 0; i < tags.length; i++) {
if (i != 0) {
whereCondition.append(" AND ");
}
<BUG>whereCondition.append("(" + KEY_CONTENT + " LIKE '%").append(tags[i]).append("%' OR ").append(KEY_TITLE)
.append(" LIKE '%").append(tags[i]).append("%')");
</BUG>
}
| whereCondition.append("(" + KEY_CONTENT + " REGEXP '.*").append(tags[i]).append("(\\s.*)*$' OR ").append(KEY_TITLE)
.append(" REGEXP '.*").append(tags[i]).append("(\\s.*)*$')");
|
5,641 | Debug.checkNull("mysql_connection", this.mysql_connection);
return this.mysql_connection;
}
@Override
public String toString () {
<BUG>return "MySQLConnection[" + this.dataSource.getUrl() + " : " + this.dataSource.getURL() + "]";
}</BUG>
@Override
protected void finalize () throws Throwable {
super.finalize();
| return "MySQLConnection[" + this.mySQL.getUrl() + "]";
|
5,642 | package com.jfixby.cmns.adopted.gdx.log;
import com.badlogic.gdx.Application;
import com.badlogic.gdx.Gdx;
import com.jfixby.cmns.api.collections.EditableCollection;
<BUG>import com.jfixby.cmns.api.collections.Map;
import com.jfixby.cmns.api.log.LoggerComponent;</BUG>
import com.jfixby.cmns.api.util.JUtils;
public class GdxLogger implements LoggerComponent {
public GdxLogger () {
| import com.jfixby.cmns.api.err.Err;
import com.jfixby.cmns.api.log.LoggerComponent;
|
5,643 | package com.jfixby.red.collections;
<BUG>import com.jfixby.cmns.api.java.IntValue;
import com.jfixby.cmns.api.math.FloatMath;</BUG>
public class RedHistogrammValue {
private RedHistogramm master;
public RedHistogrammValue (RedHistogramm redHistogramm) {
| import com.jfixby.cmns.api.java.Int;
import com.jfixby.cmns.api.math.FloatMath;
|
5,644 | public static final String PackageName = "app.version.package_name";
}
public static final String VERSION_FILE_NAME = "version.json";
private static final long serialVersionUID = 6662721574596241247L;
public String packageName;
<BUG>public int major = -1;
public int minor = -1;
public VERSION_STAGE stage = null;
public int build = -1;
</BUG>
public int versionCode = -1;
| public String major = "";
public String minor = "";
public String build = "";
|
5,645 | <BUG>package com.jfixby.cmns.db.mysql;
import com.jfixby.cmns.api.debug.Debug;</BUG>
import com.jfixby.cmns.api.log.L;
import com.jfixby.cmns.db.api.DBComponent;
import com.mysql.jdbc.jdbc2.optional.MysqlDataSource;
| import java.sql.Connection;
import java.sql.SQLException;
import com.jfixby.cmns.api.debug.Debug;
|
5,646 | }
public MySQLTable getTable (final String name) {
return new MySQLTable(this, name);
}
public MySQLConnection obtainConnection () {
<BUG>final MySQLConnection connection = new MySQLConnection(this.dataSource);
connection.open();</BUG>
return connection;
}
public void releaseConnection (final MySQLConnection connection) {
| public String getDBName () {
return this.dbName;
final MySQLConnection connection = new MySQLConnection(this);
connection.open();
|
5,647 | public boolean isDumbAware() {
return true;
}
@Override
public boolean isApplicable(AnActionEvent event, final Map<String, Object> _params) {
<BUG>return SNodeOperations.isInstanceOf(((SNode) MapSequence.fromMap(_params).get("selectedNode")), MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c108ca66L, "jetbrains.mps.baseLanguage.structure.ClassConcept")) && ListSequence.fromList(((List<SNode>) BHReflection.invoke(SNodeOperations.cast(((SNode) MapSequence.fromMap(_params).get("selectedNode")), MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c108ca66L, "jetbrains.mps.baseLanguage.structure.ClassConcept")), SMethodTrimmedId.create("getMethodsToOverride", null, "4GM03FJm3zL")))).isNotEmpty();
</BUG>
}
@Override
public void doUpdate(@NotNull AnActionEvent event, final Map<String, Object> _params) {
| return SNodeOperations.isInstanceOf(event.getData(MPSCommonDataKeys.NODE), MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c108ca66L, "jetbrains.mps.baseLanguage.structure.ClassConcept")) && ListSequence.fromList(((List<SNode>) BHReflection.invoke(SNodeOperations.cast(event.getData(MPSCommonDataKeys.NODE), MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c108ca66L, "jetbrains.mps.baseLanguage.structure.ClassConcept")), SMethodTrimmedId.create("getMethodsToOverride", null, "4GM03FJm3zL")))).isNotEmpty();
|
5,648 | }
}
return true;
}
@Override
<BUG>public void doExecute(@NotNull final AnActionEvent event, final Map<String, Object> _params) {
final Project project = ((IOperationContext) MapSequence.fromMap(_params).get("operationContext")).getProject();
new OverrideImplementMethodAction(project, ((SNode) MapSequence.fromMap(_params).get("selectedNode")), ((EditorContext) MapSequence.fromMap(_params).get("editorContext")), true).run();</BUG>
}
}
| public void doUpdate(@NotNull AnActionEvent event, final Map<String, Object> _params) {
this.setEnabledState(event.getPresentation(), this.isApplicable(event, _params));
|
5,649 | import jetbrains.mps.smodel.behaviour.BHReflection;
import jetbrains.mps.core.aspects.behaviour.SMethodTrimmedId;
import org.jetbrains.annotations.NotNull;
import jetbrains.mps.ide.actions.MPSCommonDataKeys;
import jetbrains.mps.ide.editor.MPSEditorDataKeys;
<BUG>import jetbrains.mps.smodel.IOperationContext;
import jetbrains.mps.project.Project;
import jetbrains.mps.smodel.ModelAccess;
</BUG>
import jetbrains.mps.util.Computable;
| import jetbrains.mps.project.MPSProject;
import jetbrains.mps.smodel.ModelAccessHelper;
|
5,650 | import jetbrains.mps.smodel.behaviour.BHReflection;
import jetbrains.mps.core.aspects.behaviour.SMethodTrimmedId;
import org.jetbrains.annotations.NotNull;
import jetbrains.mps.ide.actions.MPSCommonDataKeys;
import jetbrains.mps.ide.editor.MPSEditorDataKeys;
<BUG>import jetbrains.mps.smodel.IOperationContext;
import jetbrains.mps.project.Project;
import jetbrains.mps.smodel.ModelAccess;
</BUG>
import jetbrains.mps.util.Computable;
| import jetbrains.mps.project.MPSProject;
import jetbrains.mps.smodel.ModelAccessHelper;
|
5,651 | import jetbrains.mps.smodel.behaviour.BHReflection;
import jetbrains.mps.core.aspects.behaviour.SMethodTrimmedId;
import org.jetbrains.annotations.NotNull;
import jetbrains.mps.ide.actions.MPSCommonDataKeys;
import jetbrains.mps.ide.editor.MPSEditorDataKeys;
<BUG>import jetbrains.mps.smodel.IOperationContext;
import jetbrains.mps.project.Project;
import jetbrains.mps.smodel.ModelAccess;
</BUG>
import jetbrains.mps.util.Computable;
| import jetbrains.mps.project.MPSProject;
import jetbrains.mps.smodel.ModelAccessHelper;
|
5,652 | import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.UUID;
import org.bukkit.Bukkit;
<BUG>import org.bukkit.Location;
import org.bukkit.World;</BUG>
import org.bukkit.block.Block;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
| import org.bukkit.OfflinePlayer;
import org.bukkit.World;
|
5,653 | private World world;
private String name;
public YamlConfiguration hconfig;
public Hotel(World world, String name){
this.world = world;
<BUG>this.name = name;
this.hconfig = getHotelConfig();</BUG>
}
public Hotel(String name){
this.name = name;
| this.name = name.toLowerCase();
this.hconfig = getHotelConfig();
|
5,654 | }
public boolean isInCreationMode(UUID uuid){
</BUG>
return HotelsConfigHandler.getInventoryFile(uuid).exists();
}
<BUG>public void hotelSetup(String hotelName, CommandSender s){
</BUG>
Player p = (Player) s;
if(hotelName.contains("-")){ p.sendMessage(Mes.mes("chat.creationMode.invalidChar")); return; }
if(Mes.hasPerm(p, "hotels.create")){ p.sendMessage(Mes.mes("chat.noPermission")); return; }
| public static boolean isInCreationMode(UUID uuid){
public static void hotelSetup(String hotelName, CommandSender s){
|
5,655 | Selection sel = getWorldEdit().getSelection(p);
Hotel hotel = new Hotel(p.getWorld(), hotelName);
if(hotel.exists()){ p.sendMessage(Mes.mes("chat.creationMode.hotelCreationFailed")); return; }
if(sel==null){ p.sendMessage(Mes.mes("chat.creationMode.noSelection")); return; }
int ownedHotels = HotelsAPI.getHotelsOwnedBy(p.getUniqueId()).size();
<BUG>int maxHotels = plugin.getConfig().getInt("settings.max_hotels_owned");
</BUG>
if(ownedHotels>maxHotels && !Mes.hasPerm(p, "hotels.create.admin")){
p.sendMessage((Mes.mes("chat.commands.create.maxHotelsReached")).replaceAll("%max%", String.valueOf(maxHotels))); return;
}
| int maxHotels = HotelsConfigHandler.getconfigyml().getInt("settings.max_hotels_owned");
|
5,656 | else{
p.sendMessage(Mes.mes("chat.creationMode.selectionInvalid")); return; }
hotel.create(r, p);
Bukkit.getPluginManager().callEvent(new HotelCreateEvent(hotel)); //Call HotelCreateEvent
}
<BUG>public void roomSetup(String hotelName,int roomNum,Player p){
</BUG>
Selection sel = getWorldEdit().getSelection(p);
World world = p.getWorld();
Hotel hotel = new Hotel(world, hotelName);
| public static void roomSetup(String hotelName, int roomNum, Player p){
|
5,657 | Selection sel = getWorldEdit().getSelection(p);
World world = p.getWorld();
Hotel hotel = new Hotel(world, hotelName);
if(!hotel.exists()){ p.sendMessage(Mes.mes("chat.creationMode.rooms.fail")); return; }
Room room = new Room(hotel, roomNum);
<BUG>if(room.exists()){ p.sendMessage(Mes.mes("chat.creationMode.rooms.alreadyExists")); return; }
ProtectedRegion pr = hotel.getRegion();</BUG>
if(sel==null){ p.sendMessage(Mes.mes("chat.creationMode.noSelection")); return; }
if((sel instanceof Polygonal2DSelection) && (pr.containsAny(((Polygonal2DSelection) sel).getNativePoints()))||
((sel instanceof CuboidSelection) && (pr.contains(sel.getNativeMinimumPoint()) && pr.contains(sel.getNativeMaximumPoint())))){
| RoomCreateEvent rce = new RoomCreateEvent(room);
Bukkit.getPluginManager().callEvent(rce);// Call RoomCreateEvent
if(rce.isCancelled()) return;
ProtectedRegion pr = hotel.getRegion();
|
5,658 | UUID playerUUID = p.getUniqueId();
File invFile = HotelsConfigHandler.getInventoryFile(playerUUID);
if(invFile.exists())
invFile.delete();
}
<BUG>public void saveInventory(CommandSender s){
</BUG>
Player p = ((Player) s);
UUID playerUUID = p.getUniqueId();
PlayerInventory pinv = p.getInventory();
| public static void saveInventory(CommandSender s){
|
5,659 | ArrayList<Hotel> hotels = new ArrayList<Hotel>();
for(ProtectedRegion r : WorldGuardManager.getRegions(w)){
String id = r.getId();
if(id.matches("hotel-\\w+$")){
String name = id.replaceFirst("hotel-", "");
<BUG>Hotel hotel = new Hotel(w,name);
</BUG>
hotels.add(hotel);
}
}
| Hotel hotel = new Hotel(w, name);
|
5,660 | for(World w : worlds)
hotels.addAll(getHotelsInWorld(w));
return hotels;
}
public static ArrayList<Hotel> getHotelsOwnedBy(UUID uuid){
<BUG>ArrayList<Hotel> hotels = getAllHotels();
for(Hotel hotel : hotels){
if(!hotel.isOwner(uuid))
hotels.remove(hotel);
}
hotels.trimToSize();
return hotels;
</BUG>
}
| ArrayList<Hotel> owned = new ArrayList<Hotel>();
if(hotel.isOwner(uuid))
owned.add(hotel);
return owned;
|
5,661 | import java.util.ArrayList;
import java.util.List;
public class CollapsedTableBorders extends TableBorders {
private List<Border> topBorderCollapseWith;
private List<Border> bottomBorderCollapseWith;
<BUG>private int startRow = -1; // TODO rename
public CollapsedTableBorders(List<CellRenderer[]> rows, int numberOfColumns) {
super(rows, numberOfColumns);
}</BUG>
public CollapsedTableBorders(List<CellRenderer[]> rows, int numberOfColumns, Border[] tableBoundingBorders) {
| private int largeTableIndexOffset;
largeTableIndexOffset = 0;
}
|
5,662 | return topBorderCollapseWith;
}
public List<Border> getBottomBorderCollapseWith() {
return bottomBorderCollapseWith;
}
<BUG>public float[] getCellBorderIndents(int row, int col, int rowspan, int colspan, boolean forceNotToProcessAsLast) {
float[] indents = new float[4];</BUG>
List<Border> borderList;
Border border;
borderList = getHorizontalBorder(rowRange.getStartRow() + row - rowspan + 1);
| public float[] getCellBorderIndents(int row, int col, int rowspan, int colspan) {
float[] indents = new float[4];
|
5,663 | if (null != border && border.getWidth() > indents[0]) {
indents[0] = border.getWidth();
}
}
borderList = getVerticalBorder(col + colspan);
<BUG>for (int i = rowRange.getStartRow() - (int) Math.max(startRow, 0) + row - rowspan + 1; i < rowRange.getStartRow() - (int) Math.max(startRow, 0) + row + 1; i++) {
border = borderList.get(i);</BUG>
if (null != border && border.getWidth() > indents[1]) {
indents[1] = border.getWidth();
}
| for (int i = rowRange.getStartRow() - largeTableIndexOffset + row - rowspan + 1; i < rowRange.getStartRow() - largeTableIndexOffset + row + 1; i++) {
border = borderList.get(i);
|
5,664 | if (null != border && border.getWidth() > indents[2]) {
indents[2] = border.getWidth();
}
}
borderList = getVerticalBorder(col);
<BUG>for (int i = rowRange.getStartRow() - (int) Math.max(startRow, 0) + row - rowspan + 1; i < rowRange.getStartRow() - (int) Math.max(startRow, 0) + row + 1; i++) {
border = borderList.get(i);</BUG>
if (null != border && border.getWidth() > indents[3]) {
indents[3] = border.getWidth();
}
| for (int i = rowRange.getStartRow() - largeTableIndexOffset + row - rowspan + 1; i < rowRange.getStartRow() - largeTableIndexOffset + row + 1; i++) {
border = borderList.get(i);
|
5,665 | theWidestBorder = getWidestBorder(getHorizontalBorder(row, forceNotToProcessAsFirst, forceNotToProcessWithLast));
return theWidestBorder;</BUG>
}
public Border getWidestHorizontalBorder(int row, int start, int end, boolean forceNotToProcessAsFirst, boolean forceNotToProcessAsLast) {
<BUG>Border theWidestBorder = null;
theWidestBorder = getWidestBorder(getHorizontalBorder(row, forceNotToProcessAsFirst, forceNotToProcessAsLast), start, end);
return theWidestBorder;</BUG>
}
| indents[3] = border.getWidth();
return indents;
public Border getWidestHorizontalBorder(int row, boolean forceNotToProcessAsFirst, boolean forceNotToProcessWithLast) {
return getWidestBorder(getHorizontalBorder(row, forceNotToProcessAsFirst, forceNotToProcessWithLast));
return getWidestBorder(getHorizontalBorder(row, forceNotToProcessAsFirst, forceNotToProcessAsLast), start, end);
|
5,666 | if (!heights.isEmpty()) {
y2 = y1 - (float) heights.get(0);
}
int j;
for (j = 1; j < heights.size(); j++) {
<BUG>Border prevBorder = borders.get(rowRange.getStartRow() - (int) Math.max(startRow, 0) + j - 1);
Border curBorder = borders.get(rowRange.getStartRow() - (int) Math.max(startRow, 0) + j);
</BUG>
if (prevBorder != null) {
| Border prevBorder = borders.get(rowRange.getStartRow() - largeTableIndexOffset + j - 1);
Border curBorder = borders.get(rowRange.getStartRow() - largeTableIndexOffset + j);
|
5,667 | protected TableBorders skipFooter(Border[] borders) {
setTableBoundingBorders(borders);
setBottomBorderCollapseWith(null);
return this;
}
<BUG>protected TableBorders considerFooter(TableBorders footerBordersHandler, boolean changeThis) {
((CollapsedTableBorders) footerBordersHandler).setTopBorderCollapseWith(getLastHorizontalBorder());
if (changeThis) {</BUG>
setBottomBorderCollapseWith(footerBordersHandler.getHorizontalBorder(0));
| protected TableBorders considerFooter(TableBorders footerBordersHandler, boolean hasContent) {
((CollapsedTableBorders) footerBordersHandler).setTopBorderCollapseWith(hasContent ? getLastHorizontalBorder() : getTopBorderCollapseWith());
|
5,668 | protected OrientBaseGraph graph;
protected OIdentifiable rawElement;
protected OrientBaseGraph.Settings settings;
protected OrientElement(final OrientBaseGraph rawGraph, final OIdentifiable iRawElement) {
graph = rawGraph;
<BUG>rawElement = iRawElement;
settings = graph.settings;</BUG>
}
public abstract String getBaseClassName();
public abstract String getElementType();
| if (graph != null)
settings = graph.settings;
|
5,669 | if (doc == null)
return null;
rawElement = doc;
return doc;
}
<BUG>public OrientElement detach() {
getRecord().fieldNames();</BUG>
settings = graph.settings.copy();
graph = null;
return this;
| getRecord().setLazyLoad(false);
getRecord().fieldNames();
|
5,670 | package org.searchisko.persistence.service;
import java.util.List;
import org.searchisko.persistence.jpa.model.Tag;
public interface CustomTagPersistenceService {
List<Tag> getTagsByContent(String... contentId);
<BUG>List<Tag> getAllTags();
boolean createTag(Tag tag);</BUG>
void deleteTag(String contentId, String tagLabel);
void deleteTagsForContent(String... contentId);
void changeOwnershipOfTags(String contributorFrom, String contributorTo);
| List<Tag> getTagsByContentType(String contentType);
boolean createTag(Tag tag);
|
5,671 | @GeneratedValue
private long id;
@NotNull
private String contentId;
@NotNull
<BUG>private String contributorId;
private String tagLabel;</BUG>
@NotNull
private Timestamp createdAt;
public Tag() {
| private String tagLabel;
|
5,672 | Role.ADMIN,
Role.PROVIDER,
Role.CONTRIBUTOR,
Role.CONTRIBUTORS_MANAGER,
Role.PROJECTS_MANAGER,
<BUG>Role.TASKS_MANAGER
};</BUG>
public static final String ADMIN = "admin";
public static final String PROVIDER = "provider";
| Role.TASKS_MANAGER,
Role.TAGS_MANAGER
};
|
5,673 | 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 {
|
5,674 | 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));
|
5,675 | } 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()
|
5,676 |
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));
|
5,677 | 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));
|
5,678 | 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 {
|
5,679 | 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);
|
5,680 | 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
|
5,681 | final int lineStride = dst.getScanlineStride();
final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final byte[][] data = dst.getByteDataArrays();
final float[] warpData = new float[2 * dstWidth];
<BUG>int lineOffset = 0;
if (ctable == null) { // source does not have IndexColorModel
if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
| 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++) {
|
5,682 | pixelOffset += pixelStride;
} // COLS LOOP
} // ROWS LOOP
}
} else {// source has IndexColorModel
<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);
| } else if (caseB) {
for (int h = 0; h < dstHeight; h++) {
|
5,683 | 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
|
5,684 | 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++) {
|
5,685 | 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
|
5,686 | 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++) {
|
5,687 | 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
|
5,688 | 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++) {
|
5,689 | 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
|
5,690 | 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++) {
|
5,691 | 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
|
5,692 | 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++) {
|
5,693 | public List<Session> getStandbySessionListByMainNodeAddr(
InetSocketAddress address);
public Set<Session> getSessionSet();
public void setHealSessionInterval(long interval);
public long getHealSessionInterval();
<BUG>public void send(Command packet) throws MemcachedException;
</BUG>
public void setConnectionPoolSize(int connectionPoolSize);
public void setBufferAllocator(BufferAllocator bufferAllocator);
public void removeReconnectRequest(InetSocketAddress address);
| public Session send(Command packet) throws MemcachedException;
|
5,694 | public static final long DEFAULT_HEAL_SESSION_INTERVAL = 2000;
int MAX_QUEUED_NOPS = 40000;
int DYNAMIC_MAX_QUEUED_NOPS = (int) (MAX_QUEUED_NOPS * (Runtime
.getRuntime().maxMemory() / 1024.0 / 1024.0 / 1024.0));
public static final int DEFAULT_MAX_QUEUED_NOPS = DYNAMIC_MAX_QUEUED_NOPS > MAX_QUEUED_NOPS ? MAX_QUEUED_NOPS
<BUG>: DYNAMIC_MAX_QUEUED_NOPS;
public void setMergeFactor(final int mergeFactor);</BUG>
public long getConnectTimeout();
public void setConnectTimeout(long connectTimeout);
public Connector getConnector();
| public static final int DEFAULT_MAX_TIMEOUTEXCEPTION_THRESHOLD = 1000;
public void setMergeFactor(final int mergeFactor);
|
5,695 | protected int connectionPoolSize = DEFAULT_CONNECTION_POOL_SIZE;
protected int maxQueuedNoReplyOperations = DEFAULT_MAX_QUEUED_NOPS;
protected final AtomicInteger serverOrderCount = new AtomicInteger();
private Map<InetSocketAddress, AuthInfo> authInfoMap = new HashMap<InetSocketAddress, AuthInfo>();
private String name; // cache name
<BUG>private volatile boolean failureMode;
private final CopyOnWriteArrayList<MemcachedClientStateListenerAdapter> stateListenerAdapters = new CopyOnWriteArrayList<MemcachedClientStateListenerAdapter>();</BUG>
private Thread shutdownHookThread;
private volatile boolean isHutdownHookCalled = false;
private KeyProvider keyProvider = DefaultKeyProvider.INSTANCE;
| private int timeoutExceptionThreshold = DEFAULT_MAX_TIMEOUTEXCEPTION_THRESHOLD;
private final CopyOnWriteArrayList<MemcachedClientStateListenerAdapter> stateListenerAdapters = new CopyOnWriteArrayList<MemcachedClientStateListenerAdapter>();
|
5,696 | </BUG>
if (this.shutdown) {
throw new MemcachedException("Xmemcached is stopped");
}
<BUG>this.connector.send(cmd);
</BUG>
}
public XMemcachedClient(final String server, final int port)
throws IOException {
this(server, port, 1);
| throws MemcachedException, TimeoutException, InterruptedException {
GetsResponse<T> result = (GetsResponse<T>) this.fetch0(key, keyBytes,
CommandType.GETS_ONE, this.opTimeout, transcoder);
return result;
private final Session sendCommand(final Command cmd) throws MemcachedException {
return this.connector.send(cmd);
|
5,697 | private final <T> Object fetch0(final String key, final byte[] keyBytes,
final CommandType cmdType, final long timeout,
Transcoder<T> transcoder) throws InterruptedException,
TimeoutException, MemcachedException, MemcachedException {
final Command command = this.commandFactory.createGetCommand(key,
<BUG>keyBytes, cmdType, this.transcoder);
this.sendCommand(command);
this.latchWait(command, timeout);</BUG>
command.getIoBuffer().free(); // free buffer
this.checkException(command);
| this.latchWait(command, timeout,this.sendCommand(command));
|
5,698 | throw new MemcachedException("could not find session for "
+ SystemUtils.getRawAddress(address) + ":"
+ address.getPort() + ",maybe it have not been connected");
}
Command command = this.commandFactory.createVerbosityCommand(latch,
<BUG>level, noreply);
sessionQueue.peek().write(command);
if (!noreply) {
this.latchWait(command, this.opTimeout);
</BUG>
}
| [DELETED] |
5,699 | throw new MemcachedException("could not find session for "
+ SystemUtils.getRawAddress(address) + ":"
+ address.getPort() + ",maybe it have not been connected");
}
Command command = this.commandFactory.createFlushAllCommand(latch,
<BUG>exptime, noreply);
sessionQueue.peek().write(command);
if (!noreply) {
this.latchWait(command, timeout);
</BUG>
}
| [DELETED] |
5,700 | throw new MemcachedException("could not find session for "
+ SystemUtils.getRawAddress(address) + ":"
+ address.getPort() + ",maybe it have not been connected");
}
Command command = this.commandFactory.createStatsCommand(address,
<BUG>latch, null);
sessionQueue.peek().write(command);
this.latchWait(command, timeout);
</BUG>
return (Map<String, String>) command.getResult();
| [DELETED] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.