id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
1,101
import com.archimatetool.editor.model.IModelExporter; import com.archimatetool.model.IArchimateElement; import com.archimatetool.model.IArchimateModel; <BUG>import com.archimatetool.model.IBounds; import com.archimatetool.model.IDiagramModelBendpoint; import com.archimatetool.model.IProperty;</BUG> import com.archimate...
import com.archimatetool.model.IFolder; import com.archimatetool.model.IProperty;
1,102
nbElement++; exportProperties(dbObject); } else { if ( eObject instanceof IRelationship ) { <BUG>DBPlugin.update(db, "INSERT INTO relationship (id, model, version, name, source, target, type, documentation)", dbObject.getId(), dbObject.getModelId(), dbObject.getVersion(), dbObject.getName(), dbObject.getSourceId(), dbO...
DBPlugin.update(db, "INSERT INTO relationship (id, model, version, name, source, target, type, documentation, folder)", dbObject.getId(), dbObject.getModelId(), dbObject.getVersion(), dbObject.getName(), dbObject.getSourceId(), dbObject.getTargetId(), dbObject.getClassSimpleName(), dbObject.getDocumentation(), dbObject...
1,103
try { db.rollback(); } catch (Exception ee) {} } try { db.close(); } catch (SQLException e) {}</BUG> } private void exportProperties(DBObject _dbObject) throws SQLException { <BUG>if ( _dbObject.getProperties() != null ) { for(IProperty property: _dbObject.getProperties() ) { DBPlugin.update(db, "INSERT INTO property (...
}); try { db.close(); } catch (SQLException e) {} int id=0; DBPlugin.update(db, "INSERT INTO property (id, parent, model, version, name, value)", id++, _dbObject.getId(), _dbObject.getModelId(), _dbObject.getVersion(), property.getKey(), property.getValue());
1,104
for(IProperty property: _dbModel.getProperties() ) { DBPlugin.update(db, "INSERT INTO property (parent, model, version, name, value)", _dbModel.getId(), _dbModel.getId(), _dbModel.getVersion(), property.getKey(), property.getValue()); </BUG> nbExported++; <BUG>nbProperty++; }</BUG> } } private void exportDiagramModelAr...
DBPlugin.update(db, "INSERT INTO property (id, parent, model, version, name, value)", rank, _dbModel.getModelId(), _dbModel.getModelId(), _dbModel.getVersion(), property.getKey(), property.getValue()); rank++;
1,105
import java.sql.ResultSet; import java.sql.SQLException; import java.util.HashMap; import org.archicontribs.database.DBPlugin.Level; import org.eclipse.emf.ecore.EClass; <BUG>import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.swt.widgets.Display; import com.archimatetool.editor.model.IEditorModelManager...
import org.eclipse.swt.custom.BusyIndicator; import com.archimatetool.canvas.model.ICanvasFactory; import com.archimatetool.editor.model.IEditorModelManager;
1,106
import com.archimatetool.editor.model.ISelectedModelImporter; import com.archimatetool.model.FolderType; import com.archimatetool.model.IArchimateFactory; import com.archimatetool.model.IArchimateModel; import com.archimatetool.model.IArchimatePackage; <BUG>import com.archimatetool.model.IDiagramModelConnection; import...
import com.archimatetool.model.IFolder; import com.archimatetool.model.IProperty;
1,107
private int nbProperty; private int nbBound; private int nbBendpoint; private int nbDiagramObject; private int nbConnection; <BUG>private int nbDiagramGroup; private int nbDiagramNote; @Override</BUG> public void doImport() throws IOException { doImport(null);
private int nbCanvas; private int nbCanvasModelBlock; private int nbCanvasModelSticky; private int nbFolder; DBList selectedModels; HashMap<String,String> modelSelected; @Override
1,108
} catch (SQLException e) { DBPlugin.popup(Level.Error, "An error occured while importing the model from the database.\n\nThe model imported into Archi might be incomplete !!!", e); try { db.close(); } catch (Exception ee) {} return; } <BUG>} private void importArchimateElement(DBModel _dbModel) throws SQLException { Re...
}); ResultSet result = DBPlugin.select(db, "SELECT * FROM archimateelement WHERE model = ? AND version = ?", _dbModel.getModelId(), _dbModel.getVersion());
1,109
dbObject.setLineWidth(result.getInt("linewidth")); dbObject.setTextAlignment(result.getInt("textalignment")); importBounds(dbObject); switch (result.getString("class")) { case "DiagramModelArchimateObject" : <BUG>nbDiagramObject++; dbObject.setArchimateElement(ArchimateModelUtils.getObjectByID(_dbModel.getModel(), _dbM...
dbObject.setArchimateElement(ArchimateModelUtils.getObjectByID(_dbModel.getModel(), _dbModel.generateId(result.getString("archimateelement"))));
1,110
dbObject.setBorderType(result.getInt("bordertype")); dbObject.setContent(result.getString("content")); break; default : //should never be here DBPlugin.popup(Level.Error,"Don't know how to import objects of type " + result.getString("class")); <BUG>} dbParent.addChild(dbObject);</BUG> } result.close(); }
nbDiagramObject++; dbParent.addChild(dbObject);
1,111
nbBound++; } result.close(); } private void importProperties(DBObject _dbObject) throws SQLException { <BUG>ResultSet result = DBPlugin.select(db, "SELECT name, value FROM property WHERE parent = ? AND model = ? AND version = ?", _dbObject.getId(), _dbObject.getModelId(), _dbObject.getVersion()); </BUG> while(result.ne...
ResultSet result = DBPlugin.select(db, "SELECT name, value FROM property WHERE parent = ? AND model = ? AND version = ? ORDER BY id", _dbObject.getId(), _dbObject.getModelId(), _dbObject.getVersion());
1,112
} @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...
return Task.named("exec", "/bin/sh").ofType(Exec.Result.class) .in(() -> task1)
1,113
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, s...
return Task.named("MyTask", parameter).ofType(String.class) .in(() -> Adder.create(parameter.length(), PLUS))
1,114
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...
Task<Long> task1 = Task.named("Foo", "Bar", 39).ofType(Long.class) Task<String> task2 = Task.named("Baz", 40).ofType(String.class) .in(() -> task1)
1,115
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 +...
Task<String> task = Task.named("WithRef").ofType(String.class) .process(() -> instanceField + " causes an outer reference");
1,116
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.e...
Task<String> task = Task.named("WithLocalRef").ofType(String.class) .process(() -> local + " won't cause an outer reference");
1,117
} @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);
1,118
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);
1,119
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);
1,120
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(() ...
TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
1,121
import java.util.TimerTask; import java.util.TreeMap; import java.util.TreeSet; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; <BUG>import java.util.concurrent.atomic.AtomicReference; import java.util.regex.Pattern;</BUG> import org.apache.accumulo.core.client.BatchScanner; import ...
import java.util.regex.Matcher; import java.util.regex.Pattern;
1,122
RegExFilter.setRegexs(setting, null, null, pattern.toString(), null, false, true); scanner.addScanIterator(setting); } } private Set<Tag> expandTagValues(Entry<String, String> firstTag, Iterator<Pair<String, String>> knownKeyValues) { <BUG>Set<Tag> result = new HashSet<>(); while (knownKeyValues.hasNext()) {</BUG> Pair...
Matcher matcher = null; if (null != firstTag && isTagValueRegex(firstTag.getValue())) { matcher = Pattern.compile(firstTag.getValue()).matcher(""); while (knownKeyValues.hasNext()) {
1,123
LOG.trace("Adding tag {}={}", knownKeyValue.getFirst(), knownKeyValue.getSecond()); result.add(new Tag(knownKeyValue.getFirst(), knownKeyValue.getSecond())); } else { LOG.trace("Testing requested tag {}={}", firstTag.getKey(), firstTag.getValue()); if (firstTag.getKey().equals(knownKeyValue.getFirst())) { <BUG>if (firs...
if (null != matcher) { matcher.reset(knownKeyValue.getSecond()); if (matcher.matches()) {
1,124
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.TangoC...
import com.google.atap.tangoservice.TangoErrorException; import com.google.atap.tangoservice.TangoEvent;
1,125
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();
1,126
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: " +
1,127
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....
import org.rajawali3d.math.Quaternion; import org.rajawali3d.math.vector.Vector3;
1,128
translationMoon.setRepeatMode(Animation.RepeatMode.INFINITE); translationMoon.setTransformable3D(moon); getCurrentScene().registerAnimation(translationMoon); translationMoon.play(); } <BUG>public void updateRenderCameraPose(TangoPoseData devicePose, DeviceExtrinsics extrinsics) { Pose cameraPose = ScenePoseCalculator.t...
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()...
1,129
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.tangos...
import com.google.atap.tangoservice.TangoAreaDescriptionMetaData; import com.google.atap.tangoservice.TangoConfig;
1,130
VolumeInfo volumeInfo = new VolumeInfo(volumeId); List<VolumeInfo> volumeInfos = db.query(volumeInfo); if(volumeInfos.size() > 0) { VolumeInfo foundVolumeInfo = volumeInfos.get(0); if(foundVolumeInfo.getStatus().equals(StorageProperties.Status.available.toString())) { <BUG>if(StorageProperties.shouldEnforceUsageLimits ...
if(StorageProperties.shouldEnforceUsageLimits) { int volSize = foundVolumeInfo.getSize();
1,131
package org.hqu.production_ms.controller; import java.util.HashMap; import java.util.List; <BUG>import java.util.Map; import org.apache.shiro.SecurityUtils;</BUG> import org.apache.shiro.subject.Subject; import org.hqu.production_ms.domain.custom.ActiveUser; import org.hqu.production_ms.domain.custom.CustomResult;
import javax.validation.Valid; import org.apache.shiro.SecurityUtils;
1,132
EUDataGridResult result = materialConsumeService.getList(page, rows, materialConsume); return result; } @RequestMapping(value="/insert", method=RequestMethod.POST) @ResponseBody <BUG>private CustomResult insert(MaterialConsumePO materialConsume) throws Exception { CustomResult result; if(materialConsumeService.get(mat...
private CustomResult insert(@Valid MaterialConsumePO materialConsume, BindingResult bindingResult) throws Exception { if(bindingResult.hasErrors()){ FieldError fieldError = bindingResult.getFieldError(); return CustomResult.build(100, fieldError.getDefaultMessage()); if(materialConsumeService.get(materialConsume.getCon...
1,133
import org.apache.commons.lang3.math.NumberUtils; import org.json.JSONException; import org.mariotaku.microblog.library.MicroBlog; import org.mariotaku.microblog.library.MicroBlogException; import org.mariotaku.microblog.library.twitter.model.RateLimitStatus; <BUG>import org.mariotaku.microblog.library.twitter.model.St...
import org.mariotaku.pickncrop.library.PNCUtils; import org.mariotaku.sqliteqb.library.AllColumns;
1,134
context.getApplicationContext().sendBroadcast(intent); } } @Nullable public static Location getCachedLocation(Context context) { <BUG>if (BuildConfig.DEBUG) { Log.v(LOGTAG, "Fetching cached location", new Exception()); }</BUG> Location location = null;
DebugLog.v(LOGTAG, "Fetching cached location", new Exception());
1,135
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); twitter.updateProfileBannerImage(fileBody); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, String.form...
if (deleteImage) { Utils.deleteMedia(context, imageUri);
1,136
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); twitter.updateProfileBackgroundImage(fileBody, tile); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, S...
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);
1,137
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); return twitter.updateProfileImage(fileBody); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, String.for...
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);
1,138
import org.mariotaku.twidere.receiver.NotificationReceiver; import org.mariotaku.twidere.service.LengthyOperationsService; import org.mariotaku.twidere.util.ActivityTracker; import org.mariotaku.twidere.util.AsyncTwitterWrapper; import org.mariotaku.twidere.util.DataStoreFunctionsKt; <BUG>import org.mariotaku.twidere.u...
import org.mariotaku.twidere.util.DebugLog; import org.mariotaku.twidere.util.ImagePreloader;
1,139
final List<InetAddress> addresses = mDns.lookup(host); for (InetAddress address : addresses) { c.addRow(new String[]{host, address.getHostAddress()}); } } catch (final IOException ignore) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, ignore); }</BUG> }
DebugLog.w(LOGTAG, null, ignore);
1,140
for (Location location : twitter.getAvailableTrends()) { map.put(location); } return map.pack(); } catch (final MicroBlogException e) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, e); }</BUG> }
DebugLog.w(LOGTAG, null, e);
1,141
import android.content.Context; import android.content.SharedPreferences; import android.location.Location; import android.os.AsyncTask; import android.support.annotation.NonNull; <BUG>import android.util.Log; import org.mariotaku.twidere.BuildConfig; import org.mariotaku.twidere.Constants; import org.mariotaku.twidere...
import org.mariotaku.twidere.util.DebugLog; import org.mariotaku.twidere.util.JsonSerializer;
1,142
} public static LatLng getCachedLatLng(@NonNull final Context context) { final Context appContext = context.getApplicationContext(); final SharedPreferences prefs = DependencyHolder.Companion.get(context).getPreferences(); if (!prefs.getBoolean(KEY_USAGE_STATISTICS, false)) return null; <BUG>if (BuildConfig.DEBUG) { Lo...
DebugLog.d(HotMobiLogger.LOGTAG, "getting cached location", null);
1,143
public int destroySavedSearchAsync(final UserKey accountKey, final long searchId) { final DestroySavedSearchTask task = new DestroySavedSearchTask(accountKey, searchId); return asyncTaskManager.add(task, true); } public int destroyStatusAsync(final UserKey accountKey, final String statusId) { <BUG>final DestroyStatusTa...
final DestroyStatusTask task = new DestroyStatusTask(context, accountKey, statusId);
1,144
@Override public void afterExecute(Bus handler, SingleResponse<Relationship> result) { if (result.hasData()) { handler.post(new FriendshipUpdatedEvent(accountKey, userKey, result.getData())); } else if (result.hasException()) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, "Unable to update friendship", result.getExcepti...
public UserKey[] getAccountKeys() { return DataStoreUtils.getActivatedAccountKeys(context);
1,145
MicroBlog microBlog = MicroBlogAPIFactory.getInstance(context, accountId); if (!Utils.isOfficialCredentials(context, accountId)) continue; try { microBlog.setActivitiesAboutMeUnread(cursor); } catch (MicroBlogException e) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, e); }</BUG> }
DebugLog.w(LOGTAG, null, e);
1,146
this.shared = shared; this._csg_plane = Plane.createFromPoints( vertices.get(0).pos, vertices.get(1).pos, vertices.get(2).pos); <BUG>this.plane = eu.mihosoft.vvecmath.Plane.fromPoints( vertices.get(0).pos, vertices.get(1).pos, vertices.get(2).pos);</BUG> validateAndInit(vertices);
this.plane = eu.mihosoft.vvecmath.Plane. fromPointAndNormal(centroid(), _csg_plane.normal);
1,147
"" + c.getRed() + " " + c.getGreen() + " " + c.getBlue()); return result; } <BUG>public ObjFile toObj() { StringBuilder objSb = new StringBuilder();</BUG> objSb.append("mtllib " + ObjFile.MTL_NAME); objSb.append("# Group").append("\n"); objSb.append("g v3d.csg\n");
return toObj(3); public ObjFile toObj(int maxNumberOfVerts) { StringBuilder objSb = new StringBuilder();
1,148
package eu.mihosoft.jcsg.playground; import eu.mihosoft.jcsg.Bounds; import eu.mihosoft.jcsg.CSG; <BUG>import eu.mihosoft.jcsg.Cube; import eu.mihosoft.jcsg.Polygon; import eu.mihosoft.jcsg.Sphere;</BUG> import eu.mihosoft.jcsg.Vertex; import eu.mihosoft.vvecmath.Plane;
import eu.mihosoft.jcsg.ObjFile; import eu.mihosoft.jcsg.STL; import eu.mihosoft.jcsg.Sphere;
1,149
List<Polygon> result2 = splitPolygons( c2.getPolygons(), c1.getPolygons(), c2.getBounds(), c1.getBounds()); List<Polygon> splitted = new ArrayList<>(); splitted.addAll(result1); <BUG>splitted.addAll(result2); Files.write(Paths.get("test-split1.stl"),</BUG> CSG.fromPolygons(splitted).toStlString().getBytes()); List<Poly...
CSG.fromPolygons(splitted).toObj(100).toFiles(Paths.get("test-split1.obj")); Files.write(Paths.get("test-split1.stl"),
1,150
double TOL = 1e-8; if (!p1.getBounds().intersects(b)) { return PolygonType.OUTSIDE; } Vector3d rayCenter = p1.centroid(); <BUG>Vector3d rayDirection = p1.plane.normal; </BUG> List<RayIntersection> intersections = getPolygonsThatIntersectWithRay( rayCenter, rayDirection, polygons, TOL); if (intersections.isEmpty()) {
Vector3d rayDirection = p1.plane.getNormal();
1,151
prevDist = dist; min = ri; } } int frontOrBack = p1.plane.compare(min.polygon.centroid(), TOL); <BUG>Vector3d planePoint = p1.plane.normal.normalized().times(p1.plane.getDist()); int towardsOrAwayFrom = p1.plane.compare( planePoint.plus(min.polygon.plane.normal), TOL); </BUG> if (frontOrBack > 0 && towardsOrAwayFrom < ...
Vector3d planePoint = p1.plane.getAnchor(); planePoint.plus(min.polygon.plane.getNormal()), TOL);
1,152
@Override public void store(String userId, Credential credential) throws IOException { lock.lock(); try { credentials.store(userId, credential); <BUG>writeCredentials(userId, credential); } finally {</BUG> lock.unlock(); } }
save(); } finally {
1,153
@Override public void delete(String userId, Credential credential) throws IOException { lock.lock(); try { credentials.delete(userId); <BUG>writeCredentials(userId, credential); } finally {</BUG> lock.unlock(); } }
public void store(String userId, Credential credential) throws IOException { credentials.store(userId, credential); save(); } finally {
1,154
this.credentials = this.jsonFactory.fromInputStream(is, FilePersistedCredentials.class); } finally { is.close(); } } <BUG>private void writeCredentials(String userId, Credential credential) throws IOException { FileOutputStream fos = new FileOutputStream(file);</BUG> try { JsonGenerator generator = jsonFactory.createJs...
private void save() throws IOException { FileOutputStream fos = new FileOutputStream(file);
1,155
public MultiFlatFileRecordReader(final List<File> files) { super(files); this.charsetName = Charset.defaultCharset().name();</BUG> } <BUG>public MultiFlatFileRecordReader(final List<File> files, final String charsetName) { super(files); this.charsetName = charsetName;</BUG> }
this(files, Charset.defaultCharset()); public MultiFlatFileRecordReader(final List<File> files, final Charset charset) { super(files, charset);
1,156
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 ...
@Override public boolean isrunning(){ if ( filePlayback!=null ) return filePlayback.isrunning(); return false; } void initFiles() throws FileNotFoundException {
1,157
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 fin...
[DELETED]
1,158
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>publi...
public static final int THREAD_INFO_TYPE = 0;
1,159
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...
import nl.dcc.buffer_bci.C; public class ThreadInfo implements Parcelable {
1,160
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, 0xf8c...
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(MPSCommon...
1,161
} } 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(_param...
public void doUpdate(@NotNull AnActionEvent event, final Map<String, Object> _params) { this.setEnabledState(event.getPresentation(), this.isApplicable(event, _params));
1,162
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 je...
import jetbrains.mps.project.MPSProject; import jetbrains.mps.smodel.ModelAccessHelper;
1,163
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 je...
import jetbrains.mps.project.MPSProject; import jetbrains.mps.smodel.ModelAccessHelper;
1,164
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 je...
import jetbrains.mps.project.MPSProject; import jetbrains.mps.smodel.ModelAccessHelper;
1,165
import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.security.DigestOutputStream; import java.security.MessageDigest; <BUG>import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.Collections; import java.util.List;</BUG> public final class ...
import java.text.DateFormat; import java.util.Date; import java.util.List;
1,166
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;
1,167
private static final String PATH_DELIMITER = "/"; public static final byte[] NO_CONTENT = PatchingTask.NO_CONTENT; enum Element { ADDED_BUNDLE("added-bundle"), ADDED_MISC_CONTENT("added-misc-content"), <BUG>ADDED_MODULE("added-module"), BUNDLES("bundles"),</BUG> CUMULATIVE("cumulative"), DESCRIPTION("description"), MIS...
APPLIES_TO_VERSION("applies-to-version"), BUNDLES("bundles"),
1,168
final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { <BUG>case APPLIES_TO_VERSION: builder.addAppliesTo(value); break;</BUG> case RESULTING_VE...
[DELETED]
1,169
final StringBuilder path = new StringBuilder(); for(final String p : item.getPath()) { path.append(p).append(PATH_DELIMITER); } path.append(item.getName()); <BUG>writer.writeAttribute(Attribute.PATH.name, path.toString()); if(type != ModificationType.REMOVE) {</BUG> writer.writeAttribute(Attribute.HASH.name, bytesToHex...
if (item.isDirectory()) { writer.writeAttribute(Attribute.DIRECTORY.name, "true"); if(type != ModificationType.REMOVE) {
1,170
package org.jboss.as.patching; import org.jboss.as.controller.OperationFailedException; import org.jboss.as.patching.runner.PatchingException; import org.jboss.logging.Messages; import org.jboss.logging.annotations.Message; <BUG>import org.jboss.logging.annotations.MessageBundle; import java.io.IOException;</BUG> impor...
import org.jboss.logging.annotations.Cause; import java.io.IOException;
1,171
} else { updateMemo(); callback.updateMemo(); } dismiss(); <BUG>}else{ </BUG> Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show(); } }
[DELETED]
1,172
} @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);
1,173
MemoEntry.COLUMN_REF_TOPIC__ID + " = ?" , new String[]{String.valueOf(topicId)}); } public Cursor selectMemo(long topicId) { Cursor c = db.query(MemoEntry.TABLE_NAME, null, MemoEntry.COLUMN_REF_TOPIC__ID + " = ?", new String[]{String.valueOf(topicId)}, null, null, <BUG>MemoEntry._ID + " DESC", null); </BUG> if (c != nu...
MemoEntry.COLUMN_ORDER + " ASC", null);
1,174
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(
1,175
import android.widget.RelativeLayout; import android.widget.TextView; import com.kiminonawa.mydiary.R; import com.kiminonawa.mydiary.db.DBManager; import com.kiminonawa.mydiary.shared.EditMode; <BUG>import com.kiminonawa.mydiary.shared.ThemeManager; import java.util.List; public class MemoAdapter extends RecyclerView.A...
import com.marshalchen.ultimaterecyclerview.dragsortadapter.DragSortAdapter; public class MemoAdapter extends DragSortAdapter<DragSortAdapter.ViewHolder> implements EditMode {
1,176
private DBManager dbManager; private boolean isEditMode = false; private EditMemoDialogFragment.MemoCallback callback; private static final int TYPE_HEADER = 0; private static final int TYPE_ITEM = 1; <BUG>public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMe...
public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback, RecyclerView recyclerView) { super(recyclerView); this.mActivity = activity;
1,177
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) {
1,178
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;
1,179
import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; <BUG>import javax.xml.xpath.XPath; import javax.xml.xpath.XPathFactory;<...
import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory;
1,180
if (consumer instanceof EventDrivenPollingConsumer) { EventDrivenPollingConsumer edpc = (EventDrivenPollingConsumer) consumer; boolean fileBasedConsumer = edpc.getEndpoint().getEndpointKey().startsWith("file") || edpc.getEndpoint().getEndpointKey().startsWith("ftp"); boolean fileBasedExchange = exchange.getFromEndpoint...
throw new IllegalArgumentException("Camel currently does not support pollEnrich from a file/ftp endpoint"
1,181
} protected void doStop() throws Exception { consumer.stop(); } private static class CopyAggregationStrategy implements AggregationStrategy { <BUG>public Exchange aggregate(Exchange oldExchange, Exchange newExchange) { copyResultsPreservePattern(oldExchange, newExchange); return oldExchange;</BUG> } }
} else { if (LOG.isTraceEnabled()) { LOG.trace("Cannot aggregate exchange as its filtered: " + resourceExchange);
1,182
} else { prepareResult(exchange); Boolean filtered = resourceExchange.getProperty(Exchange.FILTERED, Boolean.class); if (filtered == null || !filtered) { ExchangeHelper.prepareAggregation(exchange, resourceExchange); <BUG>Exchange aggregatedExchange = aggregationStrategy.aggregate(exchange, resourceExchange); copyResul...
if (aggregatedExchange != null) { }
1,183
return size()+offset; } public PlaLineInt[] to_array() { return a_list.toArray(new PlaLineInt[size()]); <BUG>} @Override</BUG> public Iterator<PlaLineInt> iterator() { return a_list.iterator();
public ArrayList<PlaLineInt>to_alist() return a_list; @Override
1,184
while (Math.abs(prev_dist) < c_epsilon) { ++corners_skipped_before; int curr_no = p_start_no - corners_skipped_before; if (curr_no < 0) return null; <BUG>prev_corner = p_line_arr[curr_no].intersection_approx(p_line_arr[curr_no + 1]); </BUG> prev_dist = translate_line.distance_signed(prev_corner); } double next_dist = t...
prev_corner = p_line_arr.get(curr_no).intersection_approx(p_line_arr.get(curr_no + 1));
1,185
</BUG> { return null; } <BUG>next_corner = p_line_arr[curr_no].intersection_approx(p_line_arr[curr_no + 1]); </BUG> next_dist = translate_line.distance_signed(next_corner); } if (Signum.of(prev_dist) != Signum.of(next_dist)) {
double next_dist = translate_line.distance_signed(next_corner); while (Math.abs(next_dist) < c_epsilon) ++corners_skipped_after; int curr_no = p_start_no + 3 + corners_skipped_after; if (curr_no >= p_line_arr.size() - 2) next_corner = p_line_arr.get(curr_no).intersection_approx(p_line_arr.get(curr_no + 1));
1,186
check_ok = r_board.check_trace(shape_to_check, curr_layer, curr_net_no_arr, curr_cl_type, contact_pins); } delta_dist /= 2; if (check_ok) { <BUG>result = curr_lines[p_start_no + 2]; </BUG> if (translate_dist == max_translate_dist) break; translate_dist += delta_dist; }
result = curr_lines.get(p_start_no + 2);
1,187
translate_dist -= shorten_value; delta_dist -= shorten_value; } } if (result == null) return null; <BUG>PlaPointFloat new_prev_corner = curr_lines[p_start_no].intersection_approx(curr_lines[p_start_no + 1]); PlaPointFloat new_next_corner = curr_lines[p_start_no + 3].intersection_approx(curr_lines[p_start_no + 4]); </B...
PlaPointFloat new_prev_corner = curr_lines.get(p_start_no).intersection_approx(curr_lines.get(p_start_no + 1)); PlaPointFloat new_next_corner = curr_lines.get(p_start_no + 3).intersection_approx(curr_lines.get(p_start_no + 4));
1,188
this.applyMprocRulesOnSuccess(sms, ProcessingType.SMPP); sms.getSmsSet().setStatus(ErrorCode.SUCCESS); this.postProcessSucceeded(sms, dlvMessageId, clusterName); boolean isPartial = MessageUtil.isSmsNotLastSegment(sms); this.generateCDR(sms, isPartial ? CdrGenerator.CDR_PARTIAL_ESME : CdrGenerator.CDR_SUCCESS_ESME, <BU...
CdrGenerator.CDR_SUCCESS_NO_REASON, confirmMessageInSendingPool.splittedMessage, true); this.generateSuccessReceipt(smsSet, sms);
1,189
+ status); } } private void onDeliveryError(SmsSet smsSet, ErrorAction errorAction, ErrorCode smStatus, String reason) { try { <BUG>smscStatAggregator.updateMsgOutFailedAll(); this.generateTemporaryFailureCDR(CdrGenerator.CDR_TEMP_FAILED_ESME, reason);</BUG> ArrayList<Sms> lstPermFailured = new ArrayList<Sms>(); ArrayL...
if (smscPropertiesManagement.getGenerateTempFailureCdr()) this.generateTemporaryFailureCDR(CdrGenerator.CDR_TEMP_FAILED_ESME, reason);
1,190
ProcessingType.SS7_MT); } protected void onDeliveryError(SmsSet smsSet, ErrorAction errorAction, ErrorCode smStatus, String reason, boolean removeSmsSet, MAPErrorMessage errMessage, boolean isImsiVlrReject, ProcessingType processingType) { try { <BUG>smscStatAggregator.updateMsgOutFailedAll(); this.generateTemporaryFai...
if (smscPropertiesManagement.getGenerateTempFailureCdr()) this.generateTemporaryFailureCDR(CdrGenerator.CDR_TEMP_FAILED, reason);
1,191
ConfirmMessageInSendingPool res = new ConfirmMessageInSendingPool(); for (int i1 = 0; i1 < sequenceNumbers.length; i1++) { if (this.sequenceNumbers[i1] == sequenceNumber && !this.confirmations[i1]) { this.confirmations[i1] = true; res.sequenceNumberFound = true; <BUG>res.msgNum = i1; if (isSent(i1)) {</BUG> res.confirm...
if (this.sequenceNumbersExtra[i1] != null) res.splittedMessage = true; if (isSent(i1)) {
1,192
if (this.sequenceNumbersExtra[i1] != null) { for (int i2 = 0; i2 < this.sequenceNumbersExtra[i1].length; i2++) { if (this.sequenceNumbersExtra[i1][i2] == sequenceNumber && !this.confirmationsExtra[i1][i2]) { this.confirmationsExtra[i1][i2] = true; res.sequenceNumberFound = true; <BUG>res.msgNum = i1; if (isSent(i1)) {<...
res.splittedMessage = true; if (isSent(i1)) {
1,193
private static final String SMPP_ENCODING_FOR_GSM7 = "smppEncodingForGsm7"; private static final String SMS_HOME_ROUTING = "smsHomeRouting"; private static final String ESME_DEFAULT_CLUSTER_NAME = "esmeDefaultCluster"; private static final String REVISE_SECONDS_ON_SMSC_START = "reviseSecondsOnSmscStart"; private static...
private static final String GENERATE_TEMP_FAILURE_CDR = "generateTempFailureCdr"; private static final String CALCULATE_MSG_PARTS_LEN_CDR = "calculateMsgPartsLenCdr"; private static final String RECEIPTS_DISABLING = "receiptsDisabling";
1,194
private int deliveryTimeout = 120; private int vpProlong = 120; private String esmeDefaultClusterName; private int reviseSecondsOnSmscStart = 60; private int processingSmsSetTimeout = 10 * 60; <BUG>private boolean generateReceiptCdr = false; private boolean receiptsDisabling = false;</BUG> private boolean incomeReceipt...
private boolean generateTempFailureCdr = true; private boolean calculateMsgPartsLenCdr = false; private boolean receiptsDisabling = false;
1,195
writer.write(this.smppEncodingForUCS2.toString(), SMPP_ENCODING_FOR_UCS2, String.class); writer.write(this.httpEncodingForGsm7.toString(), HTTP_ENCODING_FOR_GSM7, String.class); writer.write(this.httpEncodingForUCS2.toString(), HTTP_ENCODING_FOR_UCS2, String.class); writer.write(this.reviseSecondsOnSmscStart, REVISE_SE...
writer.write(this.generateTempFailureCdr, GENERATE_TEMP_FAILURE_CDR, Boolean.class); writer.write(this.calculateMsgPartsLenCdr, CALCULATE_MSG_PARTS_LEN_CDR, Boolean.class); writer.write(this.receiptsDisabling, RECEIPTS_DISABLING, Boolean.class);
1,196
this.applyMprocRulesOnSuccess(sms, ProcessingType.SIP); sms.getSmsSet().setStatus(ErrorCode.SUCCESS); this.postProcessSucceeded(sms, null, null); boolean isPartial = MessageUtil.isSmsNotLastSegment(sms); this.generateCDR(sms, isPartial ? CdrGenerator.CDR_PARTIAL_SIP : CdrGenerator.CDR_SUCCESS_SIP, <BUG>CdrGenerator.CDR...
CdrGenerator.CDR_SUCCESS_NO_REASON, false, true);
1,197
protected void onDeliveryTimeout(SmsSet smsSet, String reason) { this.onDeliveryError(smsSet, ErrorAction.temporaryFailure, ErrorCode.SC_SYSTEM_ERROR, reason); } private void onDeliveryError(SmsSet smsSet, ErrorAction errorAction, ErrorCode smStatus, String reason) { try { <BUG>smscStatAggregator.updateMsgOutFailedAll(...
if (smscPropertiesManagement.getGenerateTempFailureCdr()) this.generateTemporaryFailureCDR(CdrGenerator.CDR_TEMP_FAILED_SIP, reason);
1,198
import org.mobicents.smsc.library.Sms; public class ConfirmMessageInSendingPool { public boolean sequenceNumberFound; public boolean confirmed; public Sms sms; <BUG>public int msgNum; @Override</BUG> public String toString() { StringBuilder sb = new StringBuilder(); sb.append("ConfirmMessageInSendingPool=[");
public boolean splittedMessage; @Override
1,199
smscStatAggregator.updateMsgOutSentSs7(); Sms sms = this.getMessageInSendingPool(0); int messageSegmentNumber = this.getMessageSegmentNumber(); SmsSignalInfo[] segments = this.getSegments(); if (segments != null && messageSegmentNumber < segments.length - 1) { <BUG>this.generateCDR(sms, CdrGenerator.CDR_PARTIAL, CdrGen...
this.generateCDR(sms, CdrGenerator.CDR_PARTIAL, CdrGenerator.CDR_SUCCESS_NO_REASON, true, false);
1,200
this.applyMprocRulesOnSuccess(sms, ProcessingType.SS7_MT); sms.getSmsSet().setStatus(ErrorCode.SUCCESS); this.postProcessSucceeded(sms, null, null); boolean isPartial = MessageUtil.isSmsNotLastSegment(sms); this.generateCDR(sms, isPartial ? CdrGenerator.CDR_PARTIAL : CdrGenerator.CDR_SUCCESS, <BUG>CdrGenerator.CDR_SUCC...
CdrGenerator.CDR_SUCCESS_NO_REASON, segments != null, true);