id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
4,601 | 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
|
4,602 | 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++) {
|
4,603 | 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
|
4,604 | 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++) {
|
4,605 | import com.squareup.okhttp.MediaType;
import com.squareup.okhttp.RequestBody;
import retrofit.Converter;
import java.io.IOException;
public class JSONAPIRequestBodyConverter<T> implements Converter<T, RequestBody> {
<BUG>private ResourceConverter converter;
</BUG>
public JSONAPIRequestBodyConverter(ResourceConverter converter) {
this.converter = converter;
}
| private final ResourceConverter converter;
|
4,606 | package com.github.jasminb.jsonapi;
public enum RelType {
SELF (JSONAPISpecConstants.SELF),
RELATED (JSONAPISpecConstants.RELATED);
private String relName;
<BUG>private RelType(String relName) {
this.relName = relName;</BUG>
}
public String getRelName() {
return relName;
| this.relName = relName;
|
4,607 | package com.github.jasminb.jsonapi;
import java.util.HashSet;
import java.util.Set;
public enum DeserializationFeature {
REQUIRE_RESOURCE_ID(true);
<BUG>boolean enabled;
</BUG>
DeserializationFeature(boolean enabled) {
this.enabled = enabled;
}
| final boolean enabled;
|
4,608 | import java.util.List;
import java.util.Map;
import java.util.Set;
import static com.github.jasminb.jsonapi.JSONAPISpecConstants.*;
public class ResourceConverter {
<BUG>private ConverterConfiguration configuration;
private ObjectMapper objectMapper;
private RelationshipResolver globalResolver;
private Map<Class<?>, RelationshipResolver> typedResolvers = new HashMap<>();
private ResourceCache resourceCache;
private Set<DeserializationFeature> deserializationFeatures = DeserializationFeature.getDefaultFeatures();</BUG>
public ResourceConverter(Class<?>... classes) {
| private final ConverterConfiguration configuration;
private final ObjectMapper objectMapper;
private final Map<Class<?>, RelationshipResolver> typedResolvers = new HashMap<>();
private final ResourceCache resourceCache;
private final Set<DeserializationFeature> deserializationFeatures = DeserializationFeature.getDefaultFeatures();
|
4,609 | String relType = configuration.getFieldRelationship(relationshipField).relType().getRelName();
JsonNode linkNode = relationship.get(LINKS).get(relType);
String link;
if (linkNode != null && ((link = getLink(linkNode)) != null)) {
if (isCollection(relationship)) {
<BUG>relationshipField.set(object, readObjectCollection(resolver.resolve(link), type));
} else {
relationshipField.set(object, readObject(resolver.resolve(link), type));
</BUG>
}
| relationshipField.set(object,
readDocumentCollection(resolver.resolve(link), type).get());
relationshipField.set(object, readDocument(resolver.resolve(link), type).get());
|
4,610 | import com.github.jasminb.jsonapi.ResourceConverter;
import com.squareup.okhttp.ResponseBody;
import retrofit.Converter;
import java.io.IOException;
public class JSONAPIResponseBodyConverter<T> implements Converter<ResponseBody, T> {
<BUG>private Class<?> clazz;
private Boolean isCollection;
private ResourceConverter parser;
</BUG>
public JSONAPIResponseBodyConverter(ResourceConverter parser, Class<?> clazz, boolean isCollection) {
| private final Class<?> clazz;
private final Boolean isCollection;
private final ResourceConverter parser;
|
4,611 | private final Map<String, Class<?>> typeToClassMapping = new HashMap<>();
private final Map<Class<?>, Type> typeAnnotations = new HashMap<>();
private final Map<Class<?>, Field> idMap = new HashMap<>();
private final Map<Class<?>, List<Field>> relationshipMap = new HashMap<>();
private final Map<Class<?>, Map<String, Class<?>>> relationshipTypeMap = new HashMap<>();
<BUG>private final Map<Class<?>, Map<String, Field>> relationshipFieldmap = new HashMap<>();
</BUG>
private final Map<Field, Relationship> fieldRelationshipMap = new HashMap<>();
private final Map<Class<?>, Class<?>> metaTypeMap = new HashMap<>();
private final Map<Class<?>, Field> metaFieldMap = new HashMap<>();
| private final Map<Class<?>, Map<String, Field>> relationshipFieldMap = new HashMap<>();
|
4,612 | if (clazz.isAnnotationPresent(Type.class)) {
Type annotation = clazz.getAnnotation(Type.class);
typeToClassMapping.put(annotation.value(), clazz);
typeAnnotations.put(clazz, annotation);
relationshipTypeMap.put(clazz, new HashMap<String, Class<?>>());
<BUG>relationshipFieldmap.put(clazz, new HashMap<String, Field>());
</BUG>
List<Field> relationshipFields = ReflectionUtils.getAnnotatedFields(clazz, Relationship.class, true);
for (Field relationshipField : relationshipFields) {
relationshipField.setAccessible(true);
| relationshipFieldMap.put(clazz, new HashMap<String, Field>());
|
4,613 | for (Field relationshipField : relationshipFields) {
relationshipField.setAccessible(true);
Relationship relationship = relationshipField.getAnnotation(Relationship.class);
Class<?> targetType = ReflectionUtils.getFieldType(relationshipField);
relationshipTypeMap.get(clazz).put(relationship.value(), targetType);
<BUG>relationshipFieldmap.get(clazz).put(relationship.value(), relationshipField);
</BUG>
fieldRelationshipMap.put(relationshipField, relationship);
if (relationship.resolve() && relationship.relType() == null) {
throw new IllegalArgumentException("@Relationship on " + clazz.getName() + "#" +
| relationshipFieldMap.get(clazz).put(relationship.value(), relationshipField);
|
4,614 | String rawData = IOUtils.getResourceAsString("user-john-empty-id.json");
converter.readDocument(rawData.getBytes(StandardCharsets.UTF_8), User.class);
}
@Test
public void testDisableEnforceIdDeserialisationOption() throws Exception {
<BUG>converter.disableDeserialisationOption(DeserializationFeature.REQUIRE_RESOURCE_ID);
</BUG>
String rawData = IOUtils.getResourceAsString("user-john-no-id.json");
User user = converter.readDocument(rawData.getBytes(StandardCharsets.UTF_8), User.class).get();
Assert.assertNotNull(user);
| converter.disableDeserializationOption(DeserializationFeature.REQUIRE_RESOURCE_ID);
|
4,615 | package com.github.jasminb.jsonapi.exceptions;
import com.github.jasminb.jsonapi.models.errors.ErrorResponse;
public class ResourceParseException extends RuntimeException {
<BUG>private ErrorResponse errorResponse;
</BUG>
public ResourceParseException(ErrorResponse errorResponse) {
super(errorResponse.toString());
this.errorResponse = errorResponse;
| private final ErrorResponse errorResponse;
|
4,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)
|
4,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))
|
4,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)
|
4,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");
|
4,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");
|
4,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);
|
4,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);
|
4,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);
|
4,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);
|
4,625 | 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;
|
4,626 | 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();
|
4,627 | 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: " +
|
4,628 | 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;
|
4,629 | 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]);
|
4,630 | 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;
|
4,631 | 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 {
|
4,632 | 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));
|
4,633 | } 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()
|
4,634 |
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));
|
4,635 | 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));
|
4,636 | 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 {
|
4,637 | 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);
|
4,638 | @NonNls
static final String ITERATOR_TEXT = "iterator()";
@NonNls
static final String KEY_SET_ITERATOR_TEXT = "keySet().iterator()";
@NonNls
<BUG>static final String VALUES_ITERATOR_TEXT = "values().iterator()";
@NotNull</BUG>
public String getDisplayName() {
return InspectionGadgetsBundle.message(
"enumeration.can.be.iteration.display.name");
| private static final int KEEP_NOTHING = 0;
private static final int KEEP_INITIALIZATION = 1;
private static final int KEEP_DECLARATION = 2;
@NotNull
|
4,639 | final PsiStatement statement =
PsiTreeUtil.getParentOfType(element, PsiStatement.class);
if (statement == null) {
return;
}
<BUG>deleteInitializationStatement |= replaceMethodCalls(variable,
statement.getTextOffset(), variableName);</BUG>
final PsiType variableType = variable.getType();
if (!(variableType instanceof PsiClassType)) {
return;
| final int result = replaceMethodCalls(variable,
statement.getTextOffset(), variableName);
|
4,640 | final PsiElement statementGrandParent =
statementParent.getParent();
statementGrandParent.addBefore(newStatement,
statementParent);
} else {
<BUG>statementParent.addAfter(newStatement, statement);
}
if (parent == variable) {
final PsiExpression initializer = variable.getInitializer();
if (initializer != null) {
initializer.delete();
}
}</BUG>
}
| statementParent.addAfter(newStatement, anchor);
|
4,641 | methodExpression);
final JavaCodeStyleManager styleManager = JavaCodeStyleManager.getInstance(project);
styleManager.shortenClassReferences(statement);
return statement;
}
<BUG>private static boolean replaceMethodCalls(
</BUG>
PsiVariable enumerationVariable,
int startOffset,
String newVariableName)
| private static int replaceMethodCalls(
|
4,642 | PsiVariable enumerationVariable,
int startOffset,
String newVariableName)
throws IncorrectOperationException {
final PsiManager manager = enumerationVariable.getManager();
<BUG>final PsiElementFactory factory = JavaPsiFacade.getInstance(manager.getProject()).getElementFactory();
final Query<PsiReference> query = ReferencesSearch.search(</BUG>
enumerationVariable);
final List<PsiElement> referenceElements = new ArrayList();
for (PsiReference reference : query) {
| final Project project = manager.getProject();
final JavaPsiFacade facade = JavaPsiFacade.getInstance(project);
final PsiElementFactory factory = facade.getElementFactory();
final Query<PsiReference> query = ReferencesSearch.search(
|
4,643 | (PsiReferenceExpression) referenceElement;
final PsiElement referenceParent =
referenceExpression.getParent();
if (!(referenceParent instanceof PsiReferenceExpression)) {
if (referenceParent instanceof PsiAssignmentExpression) {
<BUG>deleteInitialization = false;
break;
}
continue;</BUG>
}
| result = KEEP_DECLARATION;
result = KEEP_INITIALIZATION;
continue;
|
4,644 | if ("hasMoreElements".equals(foundName)) {
newExpressionText = newVariableName + ".hasNext()";
} else if ("nextElement".equals(foundName)) {
newExpressionText = newVariableName + ".next()";
} else {
<BUG>deleteInitialization = false;
continue;</BUG>
}
final PsiExpression newExpression =
factory.createExpressionFromText(newExpressionText,
| result = KEEP_INITIALIZATION;
continue;
|
4,645 | package com.redhat.rhn.manager.ssm.test;
import java.util.Map;
import com.redhat.rhn.common.db.datasource.DataResult;
<BUG>import com.redhat.rhn.domain.user.User;
import com.redhat.rhn.manager.ssm.SsmOperationManager;
import com.redhat.rhn.manager.ssm.SsmOperationStatus;
import com.redhat.rhn.testing.RhnBaseTestCase;</BUG>
import com.redhat.rhn.testing.UserTestUtils;
| import com.redhat.rhn.domain.server.test.ServerFactoryTest;
import com.redhat.rhn.domain.server.Server;
import com.redhat.rhn.domain.rhnset.RhnSet;
import com.redhat.rhn.domain.rhnset.SetCleanup;
import com.redhat.rhn.manager.rhnset.RhnSetDecl;
import com.redhat.rhn.manager.rhnset.RhnSetManager;
import com.redhat.rhn.testing.RhnBaseTestCase;
|
4,646 | }
public static DataResult allOperations(User user) {
if (user == null) {
throw new IllegalArgumentException("user cannot be null");
}
<BUG>SelectMode m = ModeFactory.getMode("ssm_queries", "find_all_operations");
</BUG>
Map<String, Object> params = new HashMap<String, Object>(1);
params.put("user_id", user.getId());
DataResult result = m.execute(params);
| SelectMode m = ModeFactory.getMode("ssm_operation_queries", "find_all_operations");
|
4,647 | return result;
}
public static DataResult inProgressOperations(User user) {
if (user == null) {
throw new IllegalArgumentException("user cannot be null");
<BUG>}
SelectMode m = ModeFactory.getMode("ssm_queries", "find_operations_with_status");
</BUG>
Map<String, Object> params = new HashMap<String, Object>(2);
params.put("user_id", user.getId());
| SelectMode m =
ModeFactory.getMode("ssm_operation_queries", "find_operations_with_status");
|
4,648 | }</BUG>
public static void completeOperation(User user, long operationId) {
if (user == null) {
throw new IllegalArgumentException("user cannot be null");
<BUG>}
WriteMode m = ModeFactory.getWriteMode("ssm_queries", "update_status_and_progress");
</BUG>
Map<String, Object> params = new HashMap<String, Object>(3);
params.put("user_id", user.getId());
params.put("op_id", operationId);
| [DELETED] |
4,649 | 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;
|
4,650 | public NodeFirstRelationshipStage( Configuration config, NodeStore nodeStore,
RelationshipGroupStore relationshipGroupStore, NodeRelationshipLink cache )
{
super( "Node --> Relationship", config, false );
add( new ReadNodeRecordsStep( control(), config.batchSize(), config.movingAverageSize(), nodeStore ) );
<BUG>add( new NodeFirstRelationshipStep( control(), config.workAheadSize(), config.movingAverageSize(),
nodeStore, relationshipGroupStore, cache ) );
add( new UpdateRecordsStep<>( control(), config.workAheadSize(), config.movingAverageSize(), nodeStore ) );</BUG>
}
| add( new RecordProcessorStep<>( control(), "LINK", config.workAheadSize(), config.movingAverageSize(),
new NodeFirstRelationshipProcessor( relationshipGroupStore, cache ), false ) );
add( new UpdateRecordsStep<>( control(), config.workAheadSize(), config.movingAverageSize(), nodeStore ) );
|
4,651 | import org.neo4j.kernel.impl.api.CountsAccessor;
import org.neo4j.kernel.impl.store.NodeLabelsField;
import org.neo4j.kernel.impl.store.NodeStore;
import org.neo4j.kernel.impl.store.record.NodeRecord;
import org.neo4j.unsafe.impl.batchimport.cache.NodeLabelsCache;
<BUG>public class NodeCountsProcessor implements StoreProcessor<NodeRecord>
</BUG>
{
private final NodeStore nodeStore;
private final long[] labelCounts;
| public class NodeCountsProcessor implements RecordProcessor<NodeRecord>
|
4,652 | super.addStatsProviders( providers );
providers.add( monitor );
}
@Override
protected void done()
<BUG>{
monitor.stop();</BUG>
}
@Override
public int numberOfProcessors()
| super.done();
monitor.stop();
|
4,653 | import org.neo4j.kernel.impl.store.RelationshipGroupStore;
import org.neo4j.kernel.impl.store.record.NodeRecord;
import org.neo4j.kernel.impl.store.record.RelationshipGroupRecord;
import org.neo4j.unsafe.impl.batchimport.cache.NodeRelationshipLink;
import org.neo4j.unsafe.impl.batchimport.cache.NodeRelationshipLink.GroupVisitor;
<BUG>public class NodeFirstRelationshipProcessor implements StoreProcessor<NodeRecord>, GroupVisitor
</BUG>
{
private final RelationshipGroupStore relGroupStore;
private final NodeRelationshipLink nodeRelationshipLink;
| public class NodeFirstRelationshipProcessor implements RecordProcessor<NodeRecord>, GroupVisitor
|
4,654 | } else {
updateMemo();
callback.updateMemo();
}
dismiss();
<BUG>}else{
</BUG>
Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show();
}
}
| [DELETED] |
4,655 | }
@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);
|
4,656 | 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);
|
4,657 | 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(
|
4,658 | 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 {
|
4,659 | 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;
|
4,660 | 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) {
|
4,661 | 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;
|
4,662 | public void addCommand(Widget widget)
{
headerBarCommandsPanel_.add(widget);
}
@Override
<BUG>public void addCommandSeparator()
{
headerBarCommandsPanel_.add(createCommandSeparator());
}</BUG>
@Override
| public Widget addCommandSeparator()
Widget separator = createCommandSeparator();
headerBarCommandsPanel_.add(separator);
return separator;
|
4,663 | public void addProjectCommand(Widget widget)
{
projectBarCommandsPanel_.add(widget);
}
@Override
<BUG>public void addProjectCommandSeparator()
{
projectBarCommandsPanel_.add(createCommandSeparator());
}</BUG>
@Override
| public Widget addProjectCommandSeparator()
Widget separator = createCommandSeparator();
projectBarCommandsPanel_.add(separator);
return separator;
|
4,664 | package net.java.sip.communicator.impl.gui.main.configforms;
import java.awt.*;
import java.awt.event.*;
<BUG>import java.io.*;
import java.util.*;
import javax.imageio.*;</BUG>
import javax.swing.*;
import net.java.sip.communicator.impl.gui.customcontrols.*;
| [DELETED] |
4,665 | this.add(iconLabel);
this.add(textLabel);
}
public Component getListCellRendererComponent(JList list, Object value,
int index, boolean isSelected, boolean cellHasFocus)
<BUG>{
ConfigurationForm configForm = (ConfigurationForm) value;
byte[] configFormIcon = configForm.getIcon();
if(configFormIcon != null)
iconLabel.setIcon(new ImageIcon(ImageLoader.getBytesInImage(
configFormIcon)));
textLabel.setText(configForm.getTitle());
</BUG>
this.isSelected = isSelected;
| ConfigFormDescriptor cfDescriptor = (ConfigFormDescriptor) value;
if(cfDescriptor.getConfigFormIcon() != null)
iconLabel.setIcon(cfDescriptor.getConfigFormIcon());
if(cfDescriptor.getConfigFormTitle() != null)
textLabel.setText(cfDescriptor.getConfigFormTitle());
|
4,666 | this.configFrame = configFrame;
this.setCellRenderer(new ConfigFormListCellRenderer());
this.setModel(listModel);
this.addListSelectionListener(this);
}
<BUG>public void addConfigForm(ConfigurationForm configForm)
</BUG>
{
listModel.addElement(configForm);
}
| public void addConfigForm(ConfigFormDescriptor configForm)
|
4,667 | </BUG>
{
listModel.addElement(configForm);
}
public void removeConfigForm(ConfigurationForm configForm)
<BUG>{
listModel.removeElement(configForm);
}</BUG>
public void valueChanged(ListSelectionEvent e)
| this.configFrame = configFrame;
this.setCellRenderer(new ConfigFormListCellRenderer());
this.setModel(listModel);
this.addListSelectionListener(this);
public void addConfigForm(ConfigFormDescriptor configForm)
|
4,668 | e.printStackTrace();
}
filePlayback=null;
}
@Override
<BUG>public void stop() { if ( filePlayback!=null ) filePlayback.stop(); }
void initFiles() throws FileNotFoundException {</BUG>
if ((dataDir.length() != 0) && !dataDir.endsWith("/")) { dataDir = dataDir + "/"; } // guard path if needed
String samples_str = dataDir + "samples";
String events_str = dataDir + "events";
| @Override public boolean isrunning(){ if ( filePlayback!=null ) return filePlayback.isrunning(); return false; }
void initFiles() throws FileNotFoundException {
|
4,669 | public class BufferMonitor extends Thread implements FieldtripBufferMonitor {
public static final String TAG = BufferMonitor.class.toString();
private final Context context;
private final SparseArray<BufferConnectionInfo> clients = new SparseArray<BufferConnectionInfo>();
private final BufferInfo info;
<BUG>private final BroadcastReceiver mMessageReceiver = new BroadcastReceiver() {
@Override
public void onReceive(final Context context, final Intent intent) {
if (intent.getIntExtra(C.MESSAGE_TYPE, -1) == C.UPDATE_REQUEST) {
Log.i(TAG, "Received update request.");
sendAllInfo();
}
}
};</BUG>
private boolean run = true;
| [DELETED] |
4,670 | public static final String CLIENT_INFO_TIME = "c_time";
public static final String CLIENT_INFO_WAITTIMEOUT = "c_waitTimeout";
public static final String CLIENT_INFO_CONNECTED = "c_connected";
public static final String CLIENT_INFO_CHANGED = "c_changed";
public static final String CLIENT_INFO_DIFF = "c_diff";
<BUG>public static final int UPDATE_REQUEST = 0;
</BUG>
public static final int UPDATE = 1;
public static final int REQUEST_PUT_HEADER = 2;
public static final int REQUEST_FLUSH_HEADER = 3;
| public static final int THREAD_INFO_TYPE = 0;
|
4,671 | package nl.dcc.buffer_bci.bufferclientsservice;
import android.os.Parcel;
import android.os.Parcelable;
<BUG>import nl.dcc.buffer_bci.bufferservicecontroller.C;
public class ThreadInfo implements Parcelable {</BUG>
public static final Creator<ThreadInfo> CREATOR = new Creator<ThreadInfo>() {
@Override
public ThreadInfo createFromParcel(final Parcel in) {
| import nl.dcc.buffer_bci.C;
public class ThreadInfo implements Parcelable {
|
4,672 | throw new IllegalStateException("Unable to deserialize oject", ue);
}
}
public String serialize(Object obj) {
try {
<BUG>if (obj instanceof Long) {
obj = new LongWrapper((Long)obj);
}</BUG>
return _serializer.toJSON(obj);
}
| [DELETED] |
4,673 | import java.math.BigInteger;
public class Curve {
private Field f;
private FieldElement d;
private FieldElement d2;
<BUG>private FieldElement I;
private final GroupElement zeroP3;</BUG>
private final GroupElement zeroPrecomp;
public Curve(Field f, BigInteger d) {
this.f = f;
| private final GroupElement zeroP2;
private final GroupElement zeroP3;
|
4,674 | private final GroupElement zeroPrecomp;
public Curve(Field f, BigInteger d) {
this.f = f;
this.d = fromBigInteger(d);
this.d2 = this.d.multiply(fromBigInteger(Constants.TWO));
<BUG>this.I = fromBigInteger(Constants.TWO).modPow(f.getQ().subtract(Constants.ONE).divide(Constants.FOUR), f.getQ());
zeroP3 = createPoint(Constants.ZERO, Constants.ONE);
zeroPrecomp = GroupElement.precomp(this, fromBigInteger(Constants.ONE),
fromBigInteger(Constants.ONE), fromBigInteger(Constants.ZERO));</BUG>
}
| FieldElement zero = fromBigInteger(Constants.ZERO);
FieldElement one = fromBigInteger(Constants.ONE);
zeroP2 = GroupElement.p2(this, zero, one, one);
zeroPrecomp = GroupElement.precomp(this, one, one, zero);
|
4,675 | for (i = 0; i < 64; i += 2) {
t = select(i/2, e[i]);
h = h.madd(t).toP3();
}
return h;
<BUG>}
@Override</BUG>
public String toString() {
return "[GroupElement\nX="+X+"\nY="+Y+"\nZ="+Z+"\nT="+T+"\n]";
}
| public GroupElement doubleScalarMultiply(GroupElement A, byte[] a, byte[] b) {
GroupElement r = curve.getZero(Representation.P2);
return r.toP2();
@Override
|
4,676 | logger.debug("received {} on {}",aMsg.getText(),aMsg.getChannelName());
String sender = aMsg.getSource().getNick();
String roomName = aMsg.getChannelName();
DefaultBindingMessage message = new DefaultBindingMessage();
message.addBody(new TextBodyPart(aMsg.getText()));
<BUG>message.setSender(sender);
message.setDestination(roomName);
</BUG>
message.setRoomName(roomName);
for (BindingListener listener : listeners) {
| message.setSender(new IrcResource(sender,null));
message.setDestination(new IrcResource(roomName,null));
|
4,677 | public IrcRoom(IrcBinding connection) {
super(connection);
}
@Override
public boolean sendMessage(Message message) {
<BUG>IRCApi ircApi = connection.getWrappedConnection();
StringTokenizer tokenizer = new StringTokenizer(message.getBody(),"\n");</BUG>
while (tokenizer.hasMoreElements()){
ircApi.message("#"+configuration.getName(),tokenizer.nextToken());
}
| IRCApi ircApi = connection.getConnection();
StringTokenizer tokenizer = new StringTokenizer(message.getBody(),"\n");
|
4,678 | return true;
}
@Override
public boolean join(final RoomConfiguration configuration) {
this.configuration = configuration;
<BUG>IRCApi ircApi = connection.getWrappedConnection();
ircApi.joinChannel(configuration.getName(), new Callback<IRCChannel>() {</BUG>
@Override
public void onSuccess(IRCChannel ircChannel) {
logger.info("[IRC] joining room {}",configuration.getName());
| IRCApi ircApi = connection.getConnection();
ircApi.joinChannel(configuration.getName(), new Callback<IRCChannel>() {
|
4,679 | import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.wanna.jabbot.binding.AbstractRoom;
import org.wanna.jabbot.binding.BindingListener;
import org.wanna.jabbot.binding.DefaultBindingMessage;
<BUG>import org.wanna.jabbot.binding.config.RoomConfiguration;
import org.wanna.jabbot.binding.messaging.Message;</BUG>
import org.wanna.jabbot.binding.messaging.body.BodyPart;
import org.wanna.jabbot.binding.messaging.body.TextBodyPart;
import java.io.BufferedReader;
| import org.wanna.jabbot.binding.messaging.DefaultResource;
import org.wanna.jabbot.binding.messaging.Message;
|
4,680 | }
}
}
@Override
public boolean connect(BindingConfiguration configuration) {
<BUG>connection = new XMPPTCPConnection(newConnectionConfiguration(configuration));
try {</BUG>
connection.connect();
connection.login();
PingManager.getInstanceFor(connection).setPingInterval(pingInterval);
| if(configuration.getParameters().containsKey("allow_self_signed")){
allowSelfSigned = (boolean)configuration.getParameters().get("allow_self_signed");
privilegeMapper = new PrivilegeMapper(connection);
try {
|
4,681 | return rooms.get(XmppStringUtils.parseBareJid(roomName));
}
@Override
public void sendMessage(BindingMessage message) {
if(! (message instanceof XmppMessage)) return;
<BUG>if(message.getRoomName() != null){
Room room = getRoom(message.getRoomName());
if(room != null){</BUG>
room.sendMessage(message);
}
| if(message.getDestination().getType().equals(Resource.Type.ROOM)){
Room room = getRoom(message.getDestination().getAddress());
if(room != null){
|
4,682 | package org.wanna.jabbot.binding.xmpp;
import org.jivesoftware.smack.util.XmlStringBuilder;
import org.jivesoftware.smackx.xhtmlim.packet.XHTMLExtension;
<BUG>import org.jxmpp.util.XmppStringUtils;
import org.wanna.jabbot.binding.messaging.body.BodyPart;</BUG>
import org.wanna.jabbot.binding.messaging.body.TextBodyPart;
public final class MessageHelper {
private final static char[] escapeChars = new char[]{'\f','\b'};
| import org.wanna.jabbot.binding.messaging.Resource;
import org.wanna.jabbot.binding.messaging.body.BodyPart;
|
4,683 | xhtmlExtension = new XHTMLExtension();
xmppMessage.addExtension(xhtmlExtension);
}
xhtmlExtension.addBody(sb);
}
<BUG>if(message.getRoomName() != null){
xmppMessage.setType(org.jivesoftware.smack.packet.Message.Type.groupchat);
xmppMessage.setTo(message.getRoomName());
}else{
xmppMessage.setTo(message.getDestination());
</BUG>
xmppMessage.setThread(message.getThread());
| if(message.getDestination().getType().equals(Resource.Type.ROOM)){
xmppMessage.setTo(message.getDestination().getAddress());
xmppMessage.setTo(message.getDestination().getAddress());
|
4,684 | package org.wanna.jabbot.binding.xmpp;
<BUG>import org.wanna.jabbot.binding.BindingMessage;
import org.wanna.jabbot.binding.messaging.body.BodyPart;</BUG>
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
| import org.wanna.jabbot.binding.messaging.Resource;
import org.wanna.jabbot.binding.messaging.body.BodyPart;
|
4,685 | import java.util.Map;
public class XmppMessage implements BindingMessage {
private String id;
private String thread;
private Map<BodyPart.Type,BodyPart> bodies = new HashMap<>();
<BUG>private String sender;
private String destination;
</BUG>
private String roomName;
| private Resource sender;
private Resource destination;
|
4,686 | return thread;
}
public void setThread(String thread) {
this.thread = thread;
}
<BUG>public void setDestination(String destination) {
this.destination = destination;
}</BUG>
public void setRoomName(String roomName) {
this.roomName = roomName;
| [DELETED] |
4,687 | package com.teamwizardry.wizardry.common.world;
import com.teamwizardry.wizardry.init.ModBlocks;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EnumCreatureType;
<BUG>import net.minecraft.init.Biomes;
</BUG>
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
| import com.teamwizardry.wizardry.common.entity.EntityFairy;
import net.minecraft.init.Blocks;
|
4,688 | ChunkPrimer chunkprimer = new ChunkPrimer();
generate(x, z, chunkprimer);
Chunk chunk = new Chunk(world, chunkprimer, x, z);
byte[] biomeArray = chunk.getBiomeArray();
for (int i = 0; i < biomeArray.length; ++i) {
<BUG>biomeArray[i] = (byte) Biome.getIdForBiome(Biomes.PLAINS);
}</BUG>
chunk.generateSkylightMap();
return chunk;
}
| biomeArray[i] = (byte) 42;
|
4,689 | return false;
}
@NotNull
@Override
public List<Biome.SpawnListEntry> getPossibleCreatures(@NotNull EnumCreatureType creatureType, @NotNull BlockPos pos) {
<BUG>return Collections.emptyList();
}</BUG>
@Nullable
@Override
public BlockPos getStrongholdGen(@NotNull World worldIn, @NotNull String structureName, @NotNull BlockPos position) {
| ArrayList<Biome.SpawnListEntry> list = new ArrayList<>();
list.add(new Biome.SpawnListEntry(EntityFairy.class, 1, 1, 3));
return list;
|
4,690 | import com.teamwizardry.wizardry.common.entity.EntityDevilDust;
import com.teamwizardry.wizardry.common.entity.EntityFairy;
import com.teamwizardry.wizardry.common.entity.EntitySpellCodex;
import com.teamwizardry.wizardry.common.tile.TilePedestal;
import com.teamwizardry.wizardry.init.ModBlocks;
<BUG>import com.teamwizardry.wizardry.init.ModItems;
import net.minecraft.entity.item.EntityItem;</BUG>
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
| import com.teamwizardry.wizardry.init.ModPotions;
import net.minecraft.entity.item.EntityItem;
|
4,691 | public void onFallDamage(LivingHurtEvent event) {
if (!(event.getEntity() instanceof EntityPlayer)) return;
if (event.getSource() == EntityDamageSource.outOfWorld) {
EntityPlayer player = ((EntityPlayer) event.getEntityLiving());
BlockPos spawn = player.isSpawnForced(0) ? player.getBedLocation(0) : player.world.getSpawnPoint().add(player.world.rand.nextGaussian() * 16, 0, player.world.rand.nextGaussian() * 16);
<BUG>BlockPos teleportTo = spawn.add(0, 255 - spawn.getY(), 0);
</BUG>
TeleportUtil.teleportToDimension((EntityPlayer) event.getEntity(), 0, teleportTo.getX(), teleportTo.getY(), teleportTo.getZ());
event.getEntity().fallDistance = -500;
event.setCanceled(true);
| BlockPos teleportTo = spawn.add(0, 300 - spawn.getY(), 0);
|
4,692 | if (event.getEntity().fallDistance >= 250) {
BlockPos location = event.getEntity().getPosition();
BlockPos bedrock = PosUtils.checkNeighbor(event.getEntity().getEntityWorld(), location, Blocks.BEDROCK);
if (bedrock != null) {
if (event.getEntity().getEntityWorld().getBlockState(bedrock).getBlock() == Blocks.BEDROCK) {
<BUG>TeleportUtil.teleportToDimension((EntityPlayer) event.getEntity(), Wizardry.underWorld.getId(), 0, 100, 0);
fallResetUUIDs.add(event.getEntity().getUniqueID());</BUG>
((EntityPlayer) event.getEntity()).addStat(Achievements.CRUNCH);
event.setCanceled(true);
| TeleportUtil.teleportToDimension((EntityPlayer) event.getEntity(), Wizardry.underWorld.getId(), 0, 300, 0);
((EntityPlayer) event.getEntity()).addPotionEffect(new PotionEffect(ModPotions.NULLIFY_GRAVITY, 100, 1, false, false));
fallResetUUIDs.add(event.getEntity().getUniqueID());
|
4,693 | if (event.getEntityPlayer().fallDistance >= 250) {
BlockPos location = event.getEntityPlayer().getPosition();
BlockPos bedrock = PosUtils.checkNeighbor(event.getEntity().getEntityWorld(), location, Blocks.BEDROCK);
if (bedrock != null) {
if (event.getEntity().getEntityWorld().getBlockState(bedrock).getBlock() == Blocks.BEDROCK) {
<BUG>TeleportUtil.teleportToDimension(event.getEntityPlayer(), Wizardry.underWorld.getId(), 0, 100, 0);
fallResetUUIDs.add(event.getEntityPlayer().getUniqueID());</BUG>
event.getEntityPlayer().addStat(Achievements.CRUNCH);
}
| TeleportUtil.teleportToDimension(event.getEntityPlayer(), Wizardry.underWorld.getId(), 0, 300, 0);
((EntityPlayer) event.getEntity()).addPotionEffect(new PotionEffect(ModPotions.NULLIFY_GRAVITY, 100, 1, false, false));
fallResetUUIDs.add(event.getEntityPlayer().getUniqueID());
|
4,694 | package com.teamwizardry.wizardry.common.world;
<BUG>import com.teamwizardry.wizardry.Wizardry;
import net.minecraft.client.Minecraft;</BUG>
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
| import com.teamwizardry.wizardry.common.world.biome.BiomeUnderWorld;
import net.minecraft.client.Minecraft;
|
4,695 | ModBlocks.init();
Achievements.init();
Fluids.preInit();
ModEntities.init();
ModPotions.init();
<BUG>ModCapabilities.preInit();
WizardryPacketHandler.registerMessages();</BUG>
NetworkRegistry.INSTANCE.registerGuiHandler(Wizardry.instance, new GuiHandler());
ModStructures.INSTANCE.getClass();
Wizardry.underWorld = DimensionType.register("underworld", "_dim", Config.underworld_id, WorldProviderUnderWorld.class, false);
| ModBiomes.init();
WizardryPacketHandler.registerMessages();
|
4,696 | package wew.water.gpf;
<BUG>import org.esa.beam.framework.gpf.OperatorException;
public class ChlorophyllNetworkOperation implements NeuralNetworkOperation {
@Override
public void compute(float[] in, float[] out, int mask, int errMask, float a) {</BUG>
if(in.length != getNumberOfInputNodes()) {
| public class ChlorophyllNetworkOperation {
public static int compute(float[] in, float[] out) {
|
4,697 | if(in.length != getNumberOfInputNodes()) {
throw new IllegalArgumentException("Wrong input array size");
}
if(out.length != getNumberOfOutputNodes()) {
throw new IllegalArgumentException("Wrong output array size");
<BUG>}
NeuralNetworkComputer.compute(in, out, mask, errMask, a,
</BUG>
NeuralNetworkConstants.INPUT_SCALE_LIMITS,
NeuralNetworkConstants.INPUT_SCALE_OFFSET_FACTORS,
| final int[] rangeCheckErrorMasks = {
WaterProcessorOp.RESULT_ERROR_VALUES[1],
WaterProcessorOp.RESULT_ERROR_VALUES[2]
};
return NeuralNetworkComputer.compute(in, out, rangeCheckErrorMasks,
|
4,698 | +4.332827e-01, +4.453712e-01, -2.355489e-01, +4.329192e-02,
-3.259577e-02, +4.245090e-01, -1.132328e-01, +2.511418e-01,
-1.995074e-01, +1.797701e-01, -3.817864e-01, +2.854951e-01,
},
};
<BUG>private final double[][] input_hidden_weights = new double[][]{
</BUG>
{
-5.127986e-01, +5.872741e-01, +4.411426e-01, +1.344507e+00,
-7.758738e-01, -7.235078e-01, +2.421909e+00, +1.923607e-02,
| private static final double[][] input_hidden_weights = new double[][]{
|
4,699 | -1.875955e-01, +7.851294e-01, -1.226189e+00, -1.852845e-01,
+9.392875e-01, +9.886471e-01, +8.400441e-01, -1.657109e+00,
+8.292500e-01, +6.291445e-01, +1.855838e+00, +7.817575e-01,
},
};
<BUG>private final double[][] input_intercept_and_slope = new double[][]{
</BUG>
{+4.165578e-02, +1.161174e-02},
{+3.520901e-02, +1.063665e-02},
{+2.920864e-02, +1.050035e-02},
| private static final double[][] input_intercept_and_slope = new double[][]{
|
4,700 | {+2.468300e-01, +8.368545e-01},
{-6.613120e-01, +1.469582e+00},
{-6.613120e-01, +1.469582e+00},
{+7.501110e-01, +2.776545e-01},
};
<BUG>private final double[][] output_weights = new double[][]{
</BUG>
{-6.498447e+00,},
{-1.118659e+01,},
{+7.141798e+00,},
| private static final double[][] output_weights = new double[][]{
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.