id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
19,801 | sum = 0;
}
}
} else if (setDestinationNoData) {
for (int k2 = 0; k2 < dst_num_bands; k2++) {
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble;
</BUG>
}
}
if (fracx < fracdx1) {
| dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
|
19,802 | s_ix = startPts[0].x;
s_iy = startPts[0].y;
if (setDestinationNoData) {
for (int x = dst_min_x; x < clipMinX; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble;
</BUG>
dstPixelOffset += dstPixelStride;
}
} else
| dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
|
19,803 | final int offsetY = KERNEL_LINE_DIM * (int) (shift * fracy);
final int pos = posx + posy;
if (baseIndex > roiDataLength || roiDataArray[baseIndex] == 0) {
if (setDestinationNoData) {
for (int k2 = 0; k2 < dst_num_bands; k2++) {
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble;
</BUG... | dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
|
19,804 | weight &= (0xffff - (1 << 4 * h + z));
}
}
}
if (weight == 0 || tmpROI == 0) {
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble;
</BUG>
} else {
for (int h = 0; h < KERNEL_LINE_DIM; h++) {
double tempSum = 0;
| dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
|
19,805 | dstPixelOffset += dstPixelStride;
}
if (setDestinationNoData && clipMinX <= clipMaxX) {
for (int x = clipMaxX; x < dst_max_x; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble;
</BUG>
dstPixelOffset += dstPixelStride;
}
}
| dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
|
19,806 | s_ix = startPts[0].x;
s_iy = startPts[0].y;
if (setDestinationNoData) {
for (int x = dst_min_x; x < clipMinX; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble;
</BUG>
dstPixelOffset += dstPixelStride;
}
} else
| dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
|
19,807 | final int offsetY = KERNEL_LINE_DIM * (int) (shift * fracy);
final int pos = posx + posy;
if (!roiBounds.contains(x0, y0)) {
if (setDestinationNoData) {
for (int k2 = 0; k2 < dst_num_bands; k2++) {
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble;
</BUG>
}
}
} else {
| dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
|
19,808 | weight &= (0xffff - (1 << 4 * h + z));
}
}
}
if (weight == 0 || tmpROI == 0) {
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble;
</BUG>
} else {
for (int h = 0; h < KERNEL_LINE_DIM; h++) {
double tempSum = 0;
| dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
|
19,809 | dstPixelOffset += dstPixelStride;
}
if (setDestinationNoData && clipMinX <= clipMaxX) {
for (int x = clipMaxX; x < dst_max_x; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble;
</BUG>
dstPixelOffset += dstPixelStride;
}
}
| dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataDouble[k2];
|
19,810 | package org.lwjglb.game;
<BUG>import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;
import org.joml.Vector2f;</BUG>
import org.joml.Vector3f;
import static org.lwjgl.glfw.GLFW.*;
| import de.matthiasmann.twl.utils.PNGDecoder;
import java.nio.ByteBuffer;
import org.joml.Vector2f;
|
19,811 | import org.lwjglb.engine.IGameLogic;
import org.lwjglb.engine.MouseInput;
import org.lwjglb.engine.Scene;
import org.lwjglb.engine.SceneLight;
import org.lwjglb.engine.Window;
<BUG>import org.lwjglb.engine.graph.Camera;
import org.lwjglb.engine.graph.Material;</BUG>
import org.lwjglb.engine.graph.Mesh;
import org.lwjgl... | import org.lwjglb.engine.graph.HeightMapMesh;
import org.lwjglb.engine.graph.Material;
|
19,812 | float starty = -1.0f;
float inc = blockScale * 2;
float posx = startx;
float posz = startz;
float incy = 0.0f;
<BUG>BufferedImage heightMapImage = ImageIO.read(getClass().getResourceAsStream("/textures/heightmap.png"));
int height = heightMapImage.getHeight();
int width = heightMapImage.getWidth();
int instances = he... | PNGDecoder decoder = new PNGDecoder(getClass().getResourceAsStream("/textures/heightmap.png"));
int height = decoder.getHeight();
int width = decoder.getWidth();
ByteBuffer buf = ByteBuffer.allocateDirect(4 * width * height);
decoder.decode(buf, width * 4, PNGDecoder.Format.RGBA);
buf.flip();
int instances = height * w... |
19,813 | GameItem[] gameItems = new GameItem[instances];
for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) {
GameItem gameItem = new GameItem(mesh);
gameItem.setScale(blockScale);
<BUG>int rgb = heightMapImage.getRGB(j, i);
</BUG>
incy = rgb / (10 * 255 * 255);
gameItem.setPosition(posx, starty + incy, posz);
i... | int rgb = HeightMapMesh.getRGB(i, j, width, buf);
|
19,814 | package org.lwjglb.game;
<BUG>import java.awt.Dimension;
import java.awt.Toolkit;</BUG>
import org.lwjglb.engine.GameEngine;
import org.lwjglb.engine.IGameLogic;
import org.lwjglb.engine.Window;
| [DELETED] |
19,815 | public void invoke(long window, int key, int scancode, int action, int mods) {
if (key == GLFW_KEY_ESCAPE && action == GLFW_RELEASE) {
glfwSetWindowShouldClose(window, true);
}
}
<BUG>});
GLFWVidMode vidmode = glfwGetVideoMode(glfwGetPrimaryMonitor());</BUG>
glfwSetWindowPos(
windowHandle,
(vidmode.width() - width) / 2... | if (!maximized) {
GLFWVidMode vidmode = glfwGetVideoMode(glfwGetPrimaryMonitor());
|
19,816 | private final Timer timer;
private final IGameLogic gameLogic;
private final MouseInput mouseInput;
private double lastFps;
private int fps;
<BUG>private String windowTitle;
public GameEngine(String windowTitle, int width, int height, boolean vSync, Window.WindowOptions opts, IGameLogic gameLogic) throws Exception {</B... | public GameEngine(String windowTitle, boolean vSync, Window.WindowOptions opts, IGameLogic gameLogic) throws Exception {
this(windowTitle, 0, 0, vSync, opts, gameLogic);
}
public GameEngine(String windowTitle, int width, int height, boolean vSync, Window.WindowOptions opts, IGameLogic gameLogic) throws Exception {
|
19,817 | package org.lwjglb.game;
<BUG>import java.awt.Dimension;
import java.awt.Toolkit;</BUG>
import org.lwjglb.engine.GameEngine;
import org.lwjglb.engine.IGameLogic;
import org.lwjglb.engine.Window;
| [DELETED] |
19,818 | private final Timer timer;
private final IGameLogic gameLogic;
private final MouseInput mouseInput;
private double lastFps;
private int fps;
<BUG>private String windowTitle;
public GameEngine(String windowTitle, int width, int height, boolean vSync, Window.WindowOptions opts, IGameLogic gameLogic) throws Exception {</B... | public GameEngine(String windowTitle, boolean vSync, Window.WindowOptions opts, IGameLogic gameLogic) throws Exception {
this(windowTitle, 0, 0, vSync, opts, gameLogic);
}
public GameEngine(String windowTitle, int width, int height, boolean vSync, Window.WindowOptions opts, IGameLogic gameLogic) throws Exception {
|
19,819 | normals.add(normal.z);
}
}
return Utils.listToArray(normals);
}
<BUG>private float getHeight(int x, int z, int width, ByteBuffer buffer) {
byte r = buffer.get(x * 4 + 0 + z * 4 * width);</BUG>
byte g = buffer.get(x * 4 + 1 + z * 4 * width);
byte b = buffer.get(x * 4 + 2 + z * 4 * width);
byte a = buffer.get(x * 4 + 3 +... | int argb = getRGB(x, z, width, buffer);
return this.minY + Math.abs(this.maxY - this.minY) * ((float) argb / (float) MAX_COLOUR);
public static int getRGB(int x, int z, int width, ByteBuffer buffer) {
byte r = buffer.get(x * 4 + 0 + z * 4 * width);
|
19,820 | package org.lwjglb.game;
<BUG>import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;
import org.joml.Vector2f;</BUG>
import org.joml.Vector3f;
import static org.lwjgl.glfw.GLFW.*;
| import de.matthiasmann.twl.utils.PNGDecoder;
import java.nio.ByteBuffer;
import org.joml.Vector2f;
|
19,821 | import org.lwjglb.engine.IGameLogic;
import org.lwjglb.engine.MouseInput;
import org.lwjglb.engine.Scene;
import org.lwjglb.engine.SceneLight;
import org.lwjglb.engine.Window;
<BUG>import org.lwjglb.engine.graph.Camera;
import org.lwjglb.engine.graph.Material;</BUG>
import org.lwjglb.engine.graph.Mesh;
import org.lwjgl... | import org.lwjglb.engine.graph.HeightMapMesh;
import org.lwjglb.engine.graph.Material;
|
19,822 | float starty = -1.0f;
float inc = blockScale * 2;
float posx = startx;
float posz = startz;
float incy = 0.0f;
<BUG>BufferedImage heightMapImage = ImageIO.read(getClass().getResourceAsStream("/textures/heightmap.png"));
int height = heightMapImage.getHeight();
int width = heightMapImage.getWidth();
int instances = he... | PNGDecoder decoder = new PNGDecoder(getClass().getResourceAsStream("/textures/heightmap.png"));
int height = decoder.getHeight();
int width = decoder.getWidth();
ByteBuffer buf = ByteBuffer.allocateDirect(4 * width * height);
decoder.decode(buf, width * 4, PNGDecoder.Format.RGBA);
buf.flip();
int instances = height * w... |
19,823 | GameItem[] gameItems = new GameItem[instances];
for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) {
GameItem gameItem = new GameItem(mesh);
gameItem.setScale(blockScale);
<BUG>int rgb = heightMapImage.getRGB(j, i);
</BUG>
incy = rgb / (10 * 255 * 255);
gameItem.setPosition(posx, starty + incy, posz);
i... | int rgb = HeightMapMesh.getRGB(i, j, width, buf);
|
19,824 | private final Timer timer;
private final IGameLogic gameLogic;
private final MouseInput mouseInput;
private double lastFps;
private int fps;
<BUG>private String windowTitle;
public GameEngine(String windowTitle, int width, int height, boolean vSync, Window.WindowOptions opts, IGameLogic gameLogic) throws Exception {</B... | public GameEngine(String windowTitle, boolean vSync, Window.WindowOptions opts, IGameLogic gameLogic) throws Exception {
this(windowTitle, 0, 0, vSync, opts, gameLogic);
}
public GameEngine(String windowTitle, int width, int height, boolean vSync, Window.WindowOptions opts, IGameLogic gameLogic) throws Exception {
|
19,825 | normals.add(normal.z);
}
}
return Utils.listToArray(normals);
}
<BUG>private float getHeight(int x, int z, int width, ByteBuffer buffer) {
byte r = buffer.get(x * 4 + 0 + z * 4 * width);</BUG>
byte g = buffer.get(x * 4 + 1 + z * 4 * width);
byte b = buffer.get(x * 4 + 2 + z * 4 * width);
byte a = buffer.get(x * 4 + 3 +... | int argb = getRGB(x, z, width, buffer);
return this.minY + Math.abs(this.maxY - this.minY) * ((float) argb / (float) MAX_COLOUR);
public static int getRGB(int x, int z, int width, ByteBuffer buffer) {
byte r = buffer.get(x * 4 + 0 + z * 4 * width);
|
19,826 | package org.lwjglb.game;
<BUG>import java.awt.Dimension;
import java.awt.Toolkit;</BUG>
import org.lwjglb.engine.GameEngine;
import org.lwjglb.engine.IGameLogic;
import org.lwjglb.engine.Window;
| [DELETED] |
19,827 | public void invoke(long window, int key, int scancode, int action, int mods) {
if (key == GLFW_KEY_ESCAPE && action == GLFW_RELEASE) {
glfwSetWindowShouldClose(window, true);
}
}
<BUG>});
GLFWVidMode vidmode = glfwGetVideoMode(glfwGetPrimaryMonitor());</BUG>
glfwSetWindowPos(
windowHandle,
(vidmode.width() - width) / 2... | if (!maximized) {
GLFWVidMode vidmode = glfwGetVideoMode(glfwGetPrimaryMonitor());
|
19,828 | normals.add(normal.z);
}
}
return Utils.listToArray(normals);
}
<BUG>private float getHeight(int x, int z, int width, ByteBuffer buffer) {
byte r = buffer.get(x * 4 + 0 + z * 4 * width);</BUG>
byte g = buffer.get(x * 4 + 1 + z * 4 * width);
byte b = buffer.get(x * 4 + 2 + z * 4 * width);
byte a = buffer.get(x * 4 + 3 +... | int argb = getRGB(x, z, width, buffer);
return this.minY + Math.abs(this.maxY - this.minY) * ((float) argb / (float) MAX_COLOUR);
public static int getRGB(int x, int z, int width, ByteBuffer buffer) {
byte r = buffer.get(x * 4 + 0 + z * 4 * width);
|
19,829 | public void invoke(long window, int key, int scancode, int action, int mods) {
if (key == GLFW_KEY_ESCAPE && action == GLFW_RELEASE) {
glfwSetWindowShouldClose(window, true);
}
}
<BUG>});
GLFWVidMode vidmode = glfwGetVideoMode(glfwGetPrimaryMonitor());</BUG>
glfwSetWindowPos(
windowHandle,
(vidmode.width() - width) / 2... | if (!maximized) {
GLFWVidMode vidmode = glfwGetVideoMode(glfwGetPrimaryMonitor());
|
19,830 | }
}
});
}
} else {
<BUG>if (n <= m) {
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {</BUG>
a[i][j] = operator.applyAsBoolean(a[i][j]);
}
| public boolean[] row(final int rowIndex) {
N.checkArgument(rowIndex >= 0 && rowIndex < n, "Invalid row Index: %s", rowIndex);
return a[rowIndex];
|
19,831 | }
}
});
}
} else {
<BUG>if (n <= m) {
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {</BUG>
result[i][j] = zipFunction.apply(a[i][j], b[i][j]);
}
| public boolean get(final int i, final int j) {
return a[i][j];
|
19,832 | }
}
});
}
} else {
<BUG>if (n <= m) {
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {</BUG>
result[i][j] = zipFunction.apply(a[i][j], b[i][j], c[i][j]);
}
| return new BooleanMatrix(c);
|
19,833 | }
public AsyncExecutor(int maxConcurrentThreadNumber, long keepAliveTime, TimeUnit unit) {
this.maxConcurrentThreadNumber = maxConcurrentThreadNumber;
this.keepAliveTime = keepAliveTime;
this.unit = unit;
<BUG>}
public AsyncExecutor(final ExecutorService executorService) {
this(8, 300, TimeUnit.SECONDS);
this.executorS... | [DELETED] |
19,834 | results.add(execute(cmd));
}
return results;
}
public <T> CompletableFuture<T> execute(final Callable<T> command) {
<BUG>final CompletableFuture<T> future = new CompletableFuture<T>(this, command);
getExecutorService().execute(future);</BUG>
return future;
}
public <T> List<CompletableFuture<T>> execute(final Callable<... | final CompletableFuture<T> future = new CompletableFuture<>(this, command);
getExecutorService().execute(future);
|
19,835 | import java.util.Locale;
import java.util.Map;
import java.util.TreeMap;
public class DependencyConvergenceReport
extends AbstractProjectInfoReport
<BUG>{
private List reactorProjects;
private static final int PERCENTAGE = 100;</BUG>
public String getOutputName()
{
| private static final int PERCENTAGE = 100;
private static final List SUPPORTED_FONT_FAMILY_NAMES = Arrays.asList( GraphicsEnvironment
.getLocalGraphicsEnvironment().getAvailableFontFamilyNames() );
|
19,836 | sink.section1();
sink.sectionTitle1();
sink.text( getI18nString( locale, "title" ) );
sink.sectionTitle1_();
Map dependencyMap = getDependencyMap();
<BUG>generateLegend( locale, sink );
generateStats( locale, sink, dependencyMap );
generateConvergence( locale, sink, dependencyMap );
sink.section1_();</BUG>
sink.body_()... | sink.lineBreak();
sink.section1_();
|
19,837 | Iterator it = artifactMap.keySet().iterator();
while ( it.hasNext() )
{
String version = (String) it.next();
sink.tableRow();
<BUG>sink.tableCell();
sink.text( version );</BUG>
sink.tableCell_();
sink.tableCell();
generateVersionDetails( sink, artifactMap, version );
| sink.tableCell( String.valueOf( cellWidth ) + "px" );
sink.text( version );
|
19,838 | sink.tableCell();
sink.text( getI18nString( locale, "legend.shared" ) );
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableCell();
iconError( sink );</BUG>
sink.tableCell_();
sink.tableCell();
sink.text( getI18nString( locale, "legend.different" ) );
| sink.tableCell( "15px" ); // according /images/icon_error_sml.gif
iconError( sink );
|
19,839 | sink.tableCaption();
sink.text( getI18nString( locale, "stats.caption" ) );
sink.tableCaption_();</BUG>
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.subprojects" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
sink.text( String.valueOf( reactorProjects.size() ) );
s... | sink.bold();
sink.bold_();
sink.tableCaption_();
sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.subprojects" ) );
sink.tableHeaderCell_();
|
19,840 | sink.tableCell();
sink.text( String.valueOf( reactorProjects.size() ) );
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.dependencies" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
sink.text( String.valueOf( depCount ) );
| sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.dependencies" ) );
sink.tableHeaderCell_();
|
19,841 | sink.text( String.valueOf( convergence ) + "%" );
sink.bold_();
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.readyrelease" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
if ( convergence >= PERCENTAGE && snapshotCount <= 0 )
| sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.readyrelease" ) );
sink.tableHeaderCell_();
|
19,842 | {
ReverseDependencyLink p1 = (ReverseDependencyLink) o1;
ReverseDependencyLink p2 = (ReverseDependencyLink) o2;
return p1.getProject().getId().compareTo( p2.getProject().getId() );
}
<BUG>else
{</BUG>
return 0;
}
}
| iconError( sink );
|
19,843 | package com.secretpal.model;
import java.util.UUID;
import org.apache.log4j.Logger;
<BUG>import com.webobjects.foundation.NSArray;
import er.extensions.foundation.ERXStringUtilities;</BUG>
public class SPPerson extends _SPPerson {
private static Logger log = Logger.getLogger(SPPerson.class);
public static String hashPa... | import com.webobjects.foundation.NSValidation;
import er.extensions.eof.ERXEOControlUtilities;
import er.extensions.foundation.ERXStringUtilities;
|
19,844 | catch (IllegalStateException e) {
session().errors().addNotice(e.getMessage());
return null;
}
}
<BUG>public WOActionResults saveEvent() {
_event.editingContext().saveChanges();</BUG>
SPEventPage eventPage = pageWithName(SPEventPage.class);
eventPage.setEvent(_event);
return eventPage;
| if (session().errors().hasNotices()) {
_event.editingContext().saveChanges();
|
19,845 | _password = null;
_confirmPassword = null;
session().errors().addNotice("Your password confirmation didn't match.");
<BUG>return null;
}
if (ERXStringUtilities.nullForEmptyString(_person.name()) == null) {
session().errors().addNotice("You must set a name before logging in.");</BUG>
return null;
}
if (ERXStringUtilitie... | [DELETED] |
19,846 | session().errors().addNotice("Failed to send invitation to '" + localMembership.personName() + "': " + e.getMessage());
SPUtilities.log.error("Failed to send invitation to '" + localMembership.personName() + "'.", e);
}
return null;
}
<BUG>public WOActionResults saveGroup() {
_group.editingContext().saveChanges();</BUG... | if (session().errors().hasNotices()) {
_group.editingContext().saveChanges();
|
19,847 | _password = null;
_confirmPassword = null;
session().errors().addNotice("Your password confirmation didn't match.");
return null;
}
<BUG>_person.setPlainTextPassword(_password);
_person.editingContext().saveChanges();</BUG>
session().notifications().addNotice("Your profile has been updated.");
return pageWithName(Main.... | _person.editingContext().saveChanges();
|
19,848 | _group = SPGroup.createSPGroup(editingContext, "New Group", currentPerson);
SPMembership.createSPMembership(editingContext, Boolean.TRUE, Boolean.TRUE, _group, currentPerson);
}
return _group;
}
<BUG>public WOActionResults addGroup() {
_group.editingContext().saveChanges();</BUG>
SPGroupEditPage groupPage = pageWithNam... | if (session().errors().hasNotices()) {
return null;
_group.editingContext().saveChanges();
|
19,849 | _confirmPassword = null;
session().errors().addNotice("Your password confirmation didn't match.");
return null;
}
_membership.person().setPlainTextPassword(_password);
<BUG>}
if (ERXStringUtilities.nullForEmptyString(_membership.person().name()) == null) {
session().errors().addNotice("You must set your name before acc... | [DELETED] |
19,850 | import com.webobjects.foundation.NSArray;
import com.webobjects.foundation.NSMutableArray;
public class SPNoticeList {
private NSMutableArray<String> _notices;
public SPNoticeList() {
<BUG>_notices = new NSMutableArray<String>();
}</BUG>
public synchronized void addNotice(String error) {
_notices.addObject(error);
}
| public synchronized boolean hasNotices() {
return _notices.count() > 0;
|
19,851 | package com.secretpal;
<BUG>import com.secretpal.components.application.Main;
import com.secretpal.components.application.SPErrorPage;</BUG>
import com.secretpal.components.application.SPSessionExpiredPage;
import com.secretpal.components.group.SPHomePage;
import com.secretpal.components.person.SPConfirmationPage;
| import com.secretpal.components.application.SPBacktrackErrorPage;
import com.secretpal.components.application.SPErrorPage;
|
19,852 | session().errors().addNotice("There was no person found with that email address and password.");
nextPage = pageWithName(Main.class);
}
return nextPage;
}
<BUG>public WOActionResults confirmAction() {
WOActionResults nextPage;</BUG>
EOEditingContext editingContext = ERXEC.newEditingContext();
String confirmationCode = ... | session().logout();
WOActionResults nextPage;
|
19,853 | EOEditingContext editingContext = ERXEC.newEditingContext();
_event = SPEvent.createSPEvent(editingContext, Boolean.TRUE, "New Event", _group.localInstanceIn(editingContext));
}
return _event;
}
<BUG>public WOActionResults addEvent() {
_event.editingContext().saveChanges();</BUG>
SPEventPage eventPage = pageWithName(SP... | if (session().errors().hasNotices()) {
return null;
_event.editingContext().saveChanges();
|
19,854 | public boolean canEdit(SPPerson currentPerson) {
return currentPerson.admin().booleanValue() || ERXEOControlUtilities.eoEquals(owner(), currentPerson);
}
public SPMembership invite(String emailAddress) {
EOEditingContext editingContext = editingContext();
<BUG>SPPerson person = SPPerson.fetchSPPerson(editingContext, SP... | SPPerson person = SPPerson.fetchSPPerson(editingContext, SPPerson.EMAIL_ADDRESS.likeInsensitive(emailAddress));
|
19,855 | } else {
updateMemo();
callback.updateMemo();
}
dismiss();
<BUG>}else{
</BUG>
Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show();
}
}
| [DELETED] |
19,856 | }
@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);
|
19,857 | 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);
|
19,858 | 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(
|
19,859 | 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 {
|
19,860 | 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;
|
19,861 | 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) {
|
19,862 | 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;
|
19,863 | import modtweaker2.mods.exnihilo.ExNihilo;
import modtweaker2.mods.extendedworkbench.ExtendedWorkbench;
import modtweaker2.mods.factorization.Factorization;
import modtweaker2.mods.forestry.Forestry;
import modtweaker2.mods.fsp.Steamcraft;
<BUG>import modtweaker2.mods.mariculture.Mariculture;
import modtweaker2.mods.me... | import modtweaker2.mods.mekanism.Mekanism;
import modtweaker2.mods.metallurgy.Metallurgy;
|
19,864 | TweakerPlugin.register("appliedenergistics2-core", AppliedEnergistics.class);
TweakerPlugin.register("Botania", Botania.class);
TweakerPlugin.register("exnihilo", ExNihilo.class);
TweakerPlugin.register("extendedWorkbench", ExtendedWorkbench.class);
TweakerPlugin.register("factorization", Factorization.class);
<BUG>Twe... | TweakerPlugin.register("Mekanism", Mekanism.class);
TweakerPlugin.register("Metallurgy", Metallurgy.class);
|
19,865 | package modtweaker2.helpers;
<BUG>import static modtweaker2.helpers.InputHelper.toStack;
import minetweaker.api.item.IIngredient;
import minetweaker.api.item.IItemStack;
import minetweaker.api.liquid.ILiquidStack;
import modtweaker2.mods.botania.Botania;
import modtweaker2.utils.TweakerPlugin;</BUG>
import net.minecraf... | import mekanism.api.gas.GasStack;
import minetweaker.api.item.IngredientAny;
import modtweaker2.mods.mekanism.MekanismHelper;
import modtweaker2.mods.mekanism.gas.IGasStack;
import modtweaker2.utils.TweakerPlugin;
|
19,866 | import modtweaker2.mods.botania.lexicon.commands.LexiconPageLogger;
import modtweaker2.mods.chisel.commands.ChiselGroupLogger;
import modtweaker2.mods.chisel.commands.ChiselVariationLogger;
import modtweaker2.mods.exnihilo.commands.ExNihiloLogger;
import modtweaker2.mods.factorization.commands.FactorizationLogger;
<BUG... | import modtweaker2.mods.mekanism.commands.GasLogger;
import modtweaker2.mods.mekanism.commands.MekanismLogger;
import modtweaker2.mods.railcraft.commands.RailcraftLogger;
|
19,867 | MineTweakerAPI.server.addMineTweakerCommand("entities", new String[] { "/minetweaker entities", " Outputs a list of entities class mapping keys and the entity IDs" }, new EntityMappingLogger());
if (TweakerPlugin.isLoaded("appliedenergistics2-core")) {
MineTweakerAPI.server.addMineTweakerCommand("ae2", new String[] ... | MineTweakerAPI.server.addMineTweakerCommand("mekanism", new String[] { "/minetweaker mekanism [FILTER]", " Outputs a list of all Mekanism recipes." }, new MekanismLogger());
|
19,868 | package modtweaker2.helpers;
import java.util.Arrays;
<BUG>import java.util.List;
import minetweaker.MineTweakerAPI;</BUG>
import minetweaker.MineTweakerImplementationAPI;
import minetweaker.api.player.IPlayer;
import minetweaker.mc1710.data.NBTConverter;
| import mekanism.api.gas.GasStack;
import minetweaker.MineTweakerAPI;
|
19,869 | return "<ore:" + (String)object + ">";
} else {
return "\"" + (String)object + "\"";</BUG>
}
<BUG>} else if (object != null) {
return "\"" + object.toString() + "\"";
} else {
return "null";
}
}</BUG>
public static String getListDescription(List<?> objects) {
| sb.append("<liquid:").append(stack.getFluid().getName()).append('>');
if(stack.amount > 1) {
sb.append(" * ").append(stack.amount);
return sb.toString();
public static String getStackDescription(GasStack stack) {
StringBuilder sb = new StringBuilder();
sb.append("<gas:").append(stack.getGas().getName()).append('>');
if... |
19,870 | import java.util.Collections;
import java.util.List;
import org.apache.log4j.Logger;</BUG>
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
<BUG>import org.eclipse.core.runtime.Assert;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
impo... | package org.eclipse.xtext.ui.common.editor.hyperlinking;
|
19,871 | public Object execute(ExecutionEvent event) throws ExecutionException {
XtextEditor activeEditor = (XtextEditor) HandlerUtil.getActiveEditor(event);
final IXtextDocument document = activeEditor.getDocument();
final int offset = ((StyledText) activeEditor.getAdapter(Control.class)).getCaretOffset();
document.readOnly(ne... | public Void exec(XtextResource resource) throws Exception {
OpenDeclarationAction action = helper.getOpenDeclarationAction(resource, offset);
action.run();
|
19,872 | import org.eclipse.xtext.ui.core.ILocationInFileProvider;
import org.eclipse.xtext.ui.core.editor.XtextEditor;
import org.eclipse.xtext.ui.core.editor.model.UnitOfWork;
public class OpenDeclarationAction extends Action {
protected final Logger logger = Logger.getLogger(getClass());
<BUG>private URI uri;
private ILocat... | private final URI uri;
private final ILocationInFileProvider locationProvider;
|
19,873 | this.uri = uri;
this.locationProvider = locationProvider;
}
@Override
public void run() {
<BUG>doOpen(uri);
}</BUG>
public void doOpen(final URI uri) {
IFile file = getContainingResourceSetFile(uri);
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
| public URI getURI() {
return uri;
|
19,874 | if (connect(isProducer)) {
break;
}
} catch (InvalidSelectorException e) {
throw new ConnectionException(
<BUG>"Connection to JMS failed. Invalid message selector");
} catch (JMSException | NamingException e) {
logger.log(LogLevel.ERROR, "RECONNECTION_EXCEPTION",
</BUG>
new Object[] { e.toString() });
| Messages.getString("CONNECTION_TO_JMS_FAILED_INVALID_MSG_SELECTOR")); //$NON-NLS-1$
logger.log(LogLevel.ERROR, "RECONNECTION_EXCEPTION", //$NON-NLS-1$
|
19,875 | private synchronized void createConnectionNoRetry() throws ConnectionException {
if (!isConnectValid()) {
try {
connect(isProducer);
} catch (JMSException e) {
<BUG>logger.log(LogLevel.ERROR, "Connection to JMS failed", new Object[] { e.toString() });
throw new ConnectionException(
"Connection to JMS failed. Did not tr... | logger.log(LogLevel.ERROR, "CONNECTION_TO_JMS_FAILED", new Object[] { e.toString() }); //$NON-NLS-1$
Messages.getString("CONNECTION_TO_JMS_FAILED_NO_RECONNECT_AS_RECONNECT_POLICY_DOES_NOT_APPLY")); //$NON-NLS-1$
|
19,876 | boolean res = false;
int count = 0;
do {
try {
if(count > 0) {
<BUG>logger.log(LogLevel.INFO, "ATTEMPT_TO_RESEND_MESSAGE", new Object[] { count });
</BUG>
Thread.sleep(messageRetryDelay);
}
synchronized (getSession()) {
| logger.log(LogLevel.INFO, "ATTEMPT_TO_RESEND_MESSAGE", new Object[] { count }); //$NON-NLS-1$
|
19,877 | getProducer().send(message);
res = true;
}
}
catch (JMSException e) {
<BUG>logger.log(LogLevel.WARN, "ERROR_DURING_SEND", new Object[] { e.toString() });
logger.log(LogLevel.INFO, "ATTEMPT_TO_RECONNECT");
</BUG>
setConnect(null);
| logger.log(LogLevel.WARN, "ERROR_DURING_SEND", new Object[] { e.toString() }); //$NON-NLS-1$
logger.log(LogLevel.INFO, "ATTEMPT_TO_RECONNECT"); //$NON-NLS-1$
|
19,878 | import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import com.ibm.streams.operator.Attribute;
import com.ibm.streams.operator.StreamSchema;
import com.ibm.streams.operator.Type;
<BUG>import com.ibm.streams.operator.Type.MetaType;
class ConnectionDocumentParser {</BUG>
private static final Set<String> support... | import com.ibm.streamsx.messaging.jms.Messages;
class ConnectionDocumentParser {
|
19,879 | return msgClass;
}
private void convertProviderURLPath(File applicationDir) throws ParseConnectionDocumentException {
if(!isAMQ()) {
if(this.providerURL == null || this.providerURL.trim().length() == 0) {
<BUG>throw new ParseConnectionDocumentException("A value must be specified for provider_url attribute in connection... | throw new ParseConnectionDocumentException(Messages.getString("PROVIDER_URL_MUST_BE_SPECIFIED_IN_CONN_DOC")); //$NON-NLS-1$
|
19,880 | URL absProviderURL = new URL(url.getProtocol(), url.getHost(), applicationDir.getAbsolutePath() + File.separator + path);
this.providerURL = absProviderURL.toExternalForm();
}
}
} catch (MalformedURLException e) {
<BUG>throw new ParseConnectionDocumentException("Invalid provider_url value detected: " + e.getMessage());... | throw new ParseConnectionDocumentException(Messages.getString("INVALID_PROVIDER_URL", e.getMessage())); //$NON-NLS-1$
|
19,881 | for (int j = 0; j < accessSpecChildNodes.getLength(); j++) {
if (accessSpecChildNodes.item(j).getNodeName().equals("destination")) { //$NON-NLS-1$
destIndex = j;
} else if (accessSpecChildNodes.item(j).getNodeName().equals("uses_connection")) { //$NON-NLS-1$
if (!connection.equals(accessSpecChildNodes.item(j).getAttrib... | throw new ParseConnectionDocumentException(Messages.getString("VALUE_OF_CONNECTION_PARAM_NOT_THE_SAME_AS_CONN_USED_BY_ACCESS_ELEMENT", connection, access )); //$NON-NLS-1$
|
19,882 | nativeSchema = access_specification.item(i).getChildNodes().item(nativeSchemaIndex);
}
break;
}
}
<BUG>if (!accessFound) {
throw new ParseConnectionDocumentException("The value of the access parameter " + access
+ " is not found in the connections document");</BUG>
}
return nativeSchema;
| throw new ParseConnectionDocumentException(Messages.getString("VALUE_OF_ACCESS_PARAM_NOT_FOUND_IN_CONN_DOC", access )); //$NON-NLS-1$
|
19,883 | nativeAttrLength = Integer.parseInt((attrList.item(i).getAttributes().getNamedItem("length") //$NON-NLS-1$
.getNodeValue()));
}
if ((msgClass == MessageClass.wbe || msgClass == MessageClass.wbe22)
&& ((streamSchema.getAttribute(nativeAttrName) != null) && (streamSchema
<BUG>.getAttribute(nativeAttrName).getType().getMe... | throw new ParseConnectionDocumentException(Messages.getString("BLOB_NOT_SUPPORTED_FOR_MSG_CLASS", msgClass)); //$NON-NLS-1$
|
19,884 | throw new ParseConnectionDocumentException(" Blob data type is not supported for message class "
+ msgClass);</BUG>
}
Iterator<NativeSchema> it = nativeSchemaObjects.iterator();
while (it.hasNext()) {
<BUG>if (it.next().getName().equals(nativeAttrName)) {
throw new ParseConnectionDocumentException("Parameter name: " + ... | nativeAttrLength = Integer.parseInt((attrList.item(i).getAttributes().getNamedItem("length") //$NON-NLS-1$
.getNodeValue()));
if ((msgClass == MessageClass.wbe || msgClass == MessageClass.wbe22)
&& ((streamSchema.getAttribute(nativeAttrName) != null) && (streamSchema
.getAttribute(nativeAttrName).getType().getMetaType(... |
19,885 | if (msgClass == MessageClass.text) {
typesWithLength = new HashSet<String>(Arrays.asList("Bytes")); //$NON-NLS-1$
}
Set<String> typesWithoutLength = new HashSet<String>(Arrays.asList("Byte", "Short", "Int", "Long", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"Float", "Double", "Boolean")); //$NON-NLS-1$ //$... | throw new ParseConnectionDocumentException(Messages.getString("LENGTH_ATTRIB_SHOULD_NOT_BE_PRESENT_FOR_PARAM_IN_NATIVE_SCHEMA", nativeAttrName )); //$NON-NLS-1$
|
19,886 | if ((nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA)
&& (msgClass == MessageClass.wbe || msgClass == MessageClass.wbe22 || msgClass == MessageClass.xml)
&& (streamSchema.getAttribute(nativeAttrName) != null)
&& (streamSchema.getAttribute(nativeAttrName).getType().getMetaType() != Type.MetaType.RSTRING)
&& (streamSc... | throw new ParseConnectionDocumentException(Messages.getString("LENGTH_ATTRIB_SHOULD_NOT_BE_PRESENT_FOR_PARAM_IN_NATIVE_SCHEMA", nativeAttrName )); //$NON-NLS-1$
|
19,887 | if (streamSchema.getAttribute(nativeAttrName) != null) {
MetaType metaType = streamSchema.getAttribute(nativeAttrName).getType().getMetaType();
if (metaType == Type.MetaType.DECIMAL32 || metaType == Type.MetaType.DECIMAL64
|| metaType == Type.MetaType.DECIMAL128 || metaType == Type.MetaType.TIMESTAMP) {
if (nativeAttrL... | Messages.getString("LENGTH_ATTRIB_SHOULD_NOT_BE_PRESENT_FOR_PARAM_WITH_TYPE_IN_NATIVE_SCHEMA", nativeAttrName, metaType )); //$NON-NLS-1$
|
19,888 | nativeAttrLength = -4;
}
}
}
if (typesWithLength.contains(nativeAttrType)) {
<BUG>if (nativeAttrLength == LENGTH_ABSENT_IN_NATIVE_SCHEMA && msgClass == MessageClass.bytes) {
throw new ParseConnectionDocumentException("Length attribute should be present for parameter: "
+ nativeAttrName + " In native schema file for mes... | throw new ParseConnectionDocumentException(Messages.getString("LENGTH_ATTRIB_SHOULD_NOT_BE_PRESENT_FOR_PARAM_IN_NATIVE_SCHEMA_FOR_MSG_CLASS_BYTES", nativeAttrName )); //$NON-NLS-1$
|
19,889 | if (streamSchema.getAttribute(nativeAttrName) != null) {
streamAttrName = streamSchema.getAttribute(nativeAttrName).getName();
streamAttrMetaType = streamSchema.getAttribute(nativeAttrName).getType().getMetaType();
if ((msgClass == MessageClass.stream || msgClass == MessageClass.map)
&& !mapSPLToNativeSchemaDataTypesFo... | throw new ParseConnectionDocumentException(Messages.getString("ATTRIB_WITH_TYPE_IN_NATIVE_SCHEMA_CANNOT_BE_MAPPED_TO_ATTRIB_WITH_TYPE", nativeAttrName, nativeAttrType, streamAttrName, streamAttrMetaType.getLanguageType())); //$NON-NLS-1$
|
19,890 | + nativeAttrType + " in the native schema cannot be mapped with attribute: "
+ streamAttrName + " with type : " + streamAttrMetaType.getLanguageType());</BUG>
}
else if (msgClass == MessageClass.bytes
&& !mapSPLToNativeSchemaDataTypesForBytes.get(streamAttrMetaType.getLanguageType()).equals(
<BUG>nativeAttrType)) {
thr... | if (streamSchema.getAttribute(nativeAttrName) != null) {
streamAttrName = streamSchema.getAttribute(nativeAttrName).getName();
streamAttrMetaType = streamSchema.getAttribute(nativeAttrName).getType().getMetaType();
if ((msgClass == MessageClass.stream || msgClass == MessageClass.map)
&& !mapSPLToNativeSchemaDataTypesFo... |
19,891 | package com.ibm.streamsx.messaging.i18n;
import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
public class Messages {
<BUG>private static final String BUNDLE_NAME = "com.ibm.streamsx.messaging.mqtt.MQTTMessages"; //$NON-NLS-1$
</BUG>
private static final ResourceBu... | private static final String BUNDLE_NAME = "com.ibm.streamsx.messaging.i18n.CommonMessages"; //$NON-NLS-1$
|
19,892 | package org.dawnsci.datavis.model.test;
<BUG>import static org.junit.Assert.*;
import org.dawnsci.datavis.model.DataOptions;
import org.dawnsci.datavis.model.FileController;
import org.dawnsci.datavis.model.IPlotMode;</BUG>
import org.dawnsci.datavis.model.LoadedFile;
| import java.util.Optional;
import org.dawnsci.datavis.model.IFileController;
import org.dawnsci.datavis.model.IPlotMode;
|
19,893 | import org.junit.Test;
import uk.ac.diamond.scisoft.analysis.io.LoaderFactory;
import uk.ac.diamond.scisoft.analysis.io.LoaderServiceImpl;
public class PlotControllerTest extends AbstractTestModel {
private static PlotController plotManager;
<BUG>private static FileController fileController;
</BUG>
private static IPlot... | private static IFileController fileController;
|
19,894 | public static void buildData() throws Exception {
AbstractTestModel.buildData();
plottingSystem = new MockPlottingSystem();
plotManager = new PlotController(plottingSystem);
ServiceManager.setLoaderService(new LoaderServiceImpl());
<BUG>fileController = FileController.getInstance();
</BUG>
}
@Before
public void clearAl... | fileController = new FileController();
|
19,895 | fileController.unloadAll();
plottingSystem.clear();
}
private void setUpAndSelectFirstFile1D(){
fileController.loadFile(file.getAbsolutePath());
<BUG>LoadedFile lf = fileController.getLoadedFiles().getLoadedFile(file.getAbsolutePath());
DataOptions dop = lf.getDataOption("/entry/dataset1");</BUG>
fileController.setCurr... | LoadedFile lf = fileController.getLoadedFiles().stream().filter(f -> f.getLongName().equals(file.getAbsolutePath())).findFirst().get();
DataOptions dop = lf.getDataOption("/entry/dataset1");
|
19,896 | setUpAndSelectFile2D(file.getAbsolutePath());
fileController.loadFile(file.getAbsolutePath());
}
private void setUpAndSelectFile2D(String path){
fileController.loadFile(path);
<BUG>LoadedFile lf = fileController.getLoadedFiles().getLoadedFile(path);
DataOptions dop = lf.getDataOption("/entry/dataset2");</BUG>
fileContr... | LoadedFile lf = fileController.getLoadedFiles().stream().filter(f -> f.getLongName().equals(path)).findFirst().get();
DataOptions dop = lf.getDataOption("/entry/dataset2");
|
19,897 | package org.dawnsci.datavis.model.test;
<BUG>import static org.junit.Assert.*;
import org.dawnsci.datavis.model.DataOptions;
import org.dawnsci.datavis.model.FileController;
import org.dawnsci.datavis.model.LoadedFile;</BUG>
import org.dawnsci.datavis.model.ServiceManager;
| import java.util.Optional;
import java.util.stream.Stream;
import org.dawnsci.datavis.model.IFileController;
import org.dawnsci.datavis.model.LoadedFile;
|
19,898 | import org.dawnsci.datavis.model.ServiceManager;
import org.junit.BeforeClass;
import org.junit.Test;
import uk.ac.diamond.scisoft.analysis.io.LoaderServiceImpl;
public class FileControllerTest extends AbstractTestModel{
<BUG>private static FileController fileController;
</BUG>
@BeforeClass
public static void buildData... | private static IFileController fileController;
|
19,899 | </BUG>
@BeforeClass
public static void buildData() throws Exception {
AbstractTestModel.buildData();
ServiceManager.setLoaderService(new LoaderServiceImpl());
<BUG>fileController = FileController.getInstance();
}
@Test
public void testGetInstance() {
assertNotNull(FileController.getInstance());</BUG>
}
| import org.dawnsci.datavis.model.ServiceManager;
import org.junit.BeforeClass;
import org.junit.Test;
import uk.ac.diamond.scisoft.analysis.io.LoaderServiceImpl;
public class FileControllerTest extends AbstractTestModel{
private static IFileController fileController;
fileController = new FileController();
|
19,900 | fileController.loadFile(file.getAbsolutePath());
}
@Test
public void testSetCurrentFile() {
assertNull(fileController.getCurrentFile());
<BUG>fileController.setCurrentFile(fileController.getLoadedFiles().getLoadedFile(file.getAbsolutePath()),false);
assertNotNull(fileController.getCurrentFile());</BUG>
fileController.s... | Optional<LoadedFile> lf = fileController.getLoadedFiles().stream().filter(f -> f.getLongName().equals(file.getAbsolutePath())).findFirst();
fileController.setCurrentFile(lf.get(),false);
assertNotNull(fileController.getCurrentFile());
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.