id
int64 1
49k
| buggy
stringlengths 34
37.5k
| fixed
stringlengths 2
37k
|
---|---|---|
201 | public static void addTextSimple(PDPageContentStream stream, PdfTextStyle textConfig, float textX, float textY, String text) {
try {
stream.setFont(textConfig.getFont(), textConfig.getFontSize());
stream.setNonStrokingColor(textConfig.getColor());
stream.beginText();
<BUG>stream.newLineAtOffset(textX, textY);
stream.showText(text);</BUG>
} catch (Exception e) {
LOG.warn("Could not add text: " + e.getClass() + " - " + e.getMessage());
}
| stream.setTextMatrix(new Matrix(1,0,0,1, textX, textY));
stream.showText(text);
|
202 | public static void addTextSimpleUnderlined(PDPageContentStream stream, PdfTextStyle textConfig, float textX, float textY, String text) {
addTextSimple(stream, textConfig, textX, textY, text);
try {
float lineOffset = textConfig.getFontSize() / 8F;
stream.setStrokingColor(textConfig.getColor());
<BUG>stream.setLineWidth(0.5F);
stream.drawLine(textX, textY - lineOffset, textX + getTextWidth(textConfig.getFont(), textConfig.getFontSize(), text), textY - lineOffset);
</BUG>
stream.stroke();
} catch (IOException e) {
| stream.moveTo(textX, textY - lineOffset);
stream.lineTo(textX + getTextWidth(textConfig.getFont(), textConfig.getFontSize(), text), textY - lineOffset);
|
203 | list.add(text.length());
return list;
}
public static String[] splitText(PDFont font, int fontSize, float allowedWidth, String text) {
String endPart = "";
<BUG>String shortenedText = text;
List<String> breakSplitted = Arrays.asList(shortenedText.split("(\\r\\n)|(\\n)|(\\n\\r)")).stream().collect(Collectors.toList());
if (breakSplitted.size() > 1) {</BUG>
String[] splittedFirst = splitText(font, fontSize, allowedWidth, breakSplitted.get(0));
StringBuilder remaining = new StringBuilder(splittedFirst[1] == null ? "" : splittedFirst[1] + "\n");
| List<String> breakSplitted = Arrays.asList(text.split("(\\r\\n)|(\\n)|(\\n\\r)")).stream().collect(Collectors.toList());
if (breakSplitted.size() > 1) {
|
204 | package cc.catalysts.boot.report.pdf.elements;
import org.apache.pdfbox.pdmodel.PDDocument;
<BUG>import org.apache.pdfbox.pdmodel.edit.PDPageContentStream;
import java.io.IOException;</BUG>
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
| import org.apache.pdfbox.pdmodel.PDPageContentStream;
import java.io.IOException;
|
205 | import org.spongepowered.api.world.Locatable;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;
import javax.annotation.Nullable;
import java.util.List;
<BUG>import java.util.Optional;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG>
public class CommandDelete extends FCCommandBase {
private static final FlagMapper MAPPER = map -> key -> value -> {
map.put(key, value);
| import java.util.stream.Stream;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
|
206 | .append(Text.of(TextColors.GREEN, "Usage: "))
.append(getUsage(source))
.build());
return CommandResult.empty();
} else if (isIn(REGIONS_ALIASES, parse.args[0])) {
<BUG>if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!"));
IRegion region = FGManager.getInstance().getRegion(parse.args[1]);
</BUG>
boolean isWorldRegion = false;
if (region == null) {
| String regionName = parse.args[1];
IRegion region = FGManager.getInstance().getRegion(regionName).orElse(null);
|
207 | </BUG>
isWorldRegion = true;
}
if (region == null)
<BUG>throw new CommandException(Text.of("No region exists with the name \"" + parse.args[1] + "\"!"));
if (region instanceof GlobalWorldRegion) {
</BUG>
throw new CommandException(Text.of("You may not delete the global region!"));
}
| if (world == null)
throw new CommandException(Text.of("No world exists with name \"" + worldName + "\"!"));
if (world == null) throw new CommandException(Text.of("Must specify a world!"));
region = FGManager.getInstance().getWorldRegion(world, regionName).orElse(null);
throw new CommandException(Text.of("No region exists with the name \"" + regionName + "\"!"));
if (region instanceof IGlobal) {
|
208 | source.getName() + " deleted " + (isWorldRegion ? "world" : "") + "region"
);
return CommandResult.success();
} else if (isIn(HANDLERS_ALIASES, parse.args[0])) {
if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!"));
<BUG>IHandler handler = FGManager.getInstance().gethandler(parse.args[1]);
if (handler == null)
throw new ArgumentParseException(Text.of("No handler exists with that name!"), parse.args[1], 1);
if (handler instanceof GlobalHandler)</BUG>
throw new CommandException(Text.of("You may not delete the global handler!"));
| Optional<IHandler> handlerOpt = FGManager.getInstance().gethandler(parse.args[1]);
if (!handlerOpt.isPresent())
IHandler handler = handlerOpt.get();
if (handler instanceof GlobalHandler)
|
209 | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "handler").stream()
.filter(new StartsWithPredicate(parse.current.token))</BUG>
.map(args -> parse.current.prefix + args)
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index == 1) {
| return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
210 | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "handler").stream()
.filter(new StartsWithPredicate(parse.current.token))</BUG>
.map(args -> parse.current.prefix + args)
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index == 1) {
| return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
211 | @Dependency(id = "foxcore")
},
description = "A world protection plugin built for SpongeAPI. Requires FoxCore.",
authors = {"gravityfox"},
url = "https://github.com/FoxDenStudio/FoxGuard")
<BUG>public final class FoxGuardMain {
public final Cause pluginCause = Cause.builder().named("plugin", this).build();
private static FoxGuardMain instanceField;</BUG>
@Inject
private Logger logger;
| private static FoxGuardMain instanceField;
|
212 | private UserStorageService userStorage;
private EconomyService economyService = null;
private boolean loaded = false;
private FCCommandDispatcher fgDispatcher;
public static FoxGuardMain instance() {
<BUG>return instanceField;
}</BUG>
@Listener
public void construct(GameConstructionEvent event) {
instanceField = this;
| }
public static Cause getCause() {
return instance().pluginCause;
}
|
213 | return configDirectory;
}
public boolean isLoaded() {
return loaded;
}
<BUG>public static Cause getCause() {
return instance().pluginCause;
}</BUG>
public EconomyService getEconomyService() {
return economyService;
| [DELETED] |
214 | import org.spongepowered.api.world.Locatable;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;
import javax.annotation.Nullable;
import java.util.*;
<BUG>import java.util.stream.Collectors;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG>
public class CommandHere extends FCCommandBase {
private static final String[] PRIORITY_ALIASES = {"priority", "prio", "p"};
private static final FlagMapper MAPPER = map -> key -> value -> {
| import java.util.stream.Stream;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
|
215 | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "handler").stream()
.filter(new StartsWithPredicate(parse.current.token))</BUG>
.map(args -> parse.current.prefix + args)
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index > 0) {
| return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
216 | private static FGStorageManager instance;
private final Logger logger = FoxGuardMain.instance().getLogger();</BUG>
private final Set<LoadEntry> loaded = new HashSet<>();
private final Path directory = getDirectory();
private final Map<String, Path> worldDirectories;
<BUG>private FGStorageManager() {
defaultModifiedMap = new CacheMap<>((k, m) -> {</BUG>
if (k instanceof IFGObject) {
m.put((IFGObject) k, true);
return true;
| public final HashMap<IFGObject, Boolean> defaultModifiedMap;
private final UserStorageService userStorageService;
private final Logger logger = FoxGuardMain.instance().getLogger();
userStorageService = FoxGuardMain.instance().getUserStorage();
defaultModifiedMap = new CacheMap<>((k, m) -> {
|
217 | String name = fgObject.getName();
Path singleDir = dir.resolve(name.toLowerCase());
</BUG>
boolean shouldSave = fgObject.shouldSave();
if (force || shouldSave) {
<BUG>logger.info((shouldSave ? "S" : "Force s") + "aving handler \"" + name + "\" in directory: " + singleDir);
</BUG>
constructDirectory(singleDir);
try {
fgObject.save(singleDir);
| UUID owner = fgObject.getOwner();
boolean isOwned = !owner.equals(SERVER_UUID);
Optional<User> userOwner = userStorageService.get(owner);
String logName = (userOwner.isPresent() ? userOwner.get().getName() + ":" : "") + (isOwned ? owner + ":" : "") + name;
if (fgObject.autoSave()) {
Path singleDir = serverDir.resolve(name.toLowerCase());
logger.info((shouldSave ? "S" : "Force s") + "aving handler " + logName + " in directory: " + singleDir);
|
218 | if (fgObject.autoSave()) {
Path singleDir = dir.resolve(name.toLowerCase());
</BUG>
boolean shouldSave = fgObject.shouldSave();
if (force || shouldSave) {
<BUG>logger.info((shouldSave ? "S" : "Force s") + "aving world region \"" + name + "\" in directory: " + singleDir);
</BUG>
constructDirectory(singleDir);
try {
fgObject.save(singleDir);
| Path singleDir = serverDir.resolve(name.toLowerCase());
logger.info((shouldSave ? "S" : "Force s") + "aving world region " + logName + " in directory: " + singleDir);
|
219 | public synchronized void loadRegionLinks() {
logger.info("Loading region links");
try (DB mainDB = DBMaker.fileDB(directory.resolve("regions.foxdb").normalize().toString()).make()) {
Map<String, String> linksMap = mainDB.hashMap("links", Serializer.STRING, Serializer.STRING).createOrOpen();
linksMap.entrySet().forEach(entry -> {
<BUG>IRegion region = FGManager.getInstance().getRegion(entry.getKey());
if (region != null) {
logger.info("Loading links for region \"" + region.getName() + "\"");</BUG>
String handlersString = entry.getValue();
| Optional<IRegion> regionOpt = FGManager.getInstance().getRegion(entry.getKey());
if (regionOpt.isPresent()) {
IRegion region = regionOpt.get();
logger.info("Loading links for region \"" + region.getName() + "\"");
|
220 | public synchronized void loadWorldRegionLinks(World world) {
logger.info("Loading world region links for world \"" + world.getName() + "\"");
try (DB mainDB = DBMaker.fileDB(worldDirectories.get(world.getName()).resolve("wregions.foxdb").normalize().toString()).make()) {
Map<String, String> linksMap = mainDB.hashMap("links", Serializer.STRING, Serializer.STRING).createOrOpen();
linksMap.entrySet().forEach(entry -> {
<BUG>IRegion region = FGManager.getInstance().getWorldRegion(world, entry.getKey());
if (region != null) {
logger.info("Loading links for world region \"" + region.getName() + "\"");</BUG>
String handlersString = entry.getValue();
| Optional<IWorldRegion> regionOpt = FGManager.getInstance().getWorldRegion(world, entry.getKey());
if (regionOpt.isPresent()) {
IWorldRegion region = regionOpt.get();
logger.info("Loading links for world region \"" + region.getName() + "\"");
|
221 | StringBuilder builder = new StringBuilder();
for (Iterator<IHandler> it = handlers.iterator(); it.hasNext(); ) {
builder.append(it.next().getName());
if (it.hasNext()) builder.append(",");
}
<BUG>return builder.toString();
}</BUG>
private final class LoadEntry {
public final String name;
public final Type type;
| public enum Type {
REGION, WREGION, HANDLER
|
222 | .autoCloseQuotes(true)
.leaveFinalAsIs(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "worldregion", "handler", "controller").stream()
</BUG>
.filter(new StartsWithPredicate(parse.current.token))
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index == 1) {
| return Stream.of("region", "worldregion", "handler", "controller")
|
223 | 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 {
|
224 | 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));
|
225 | } 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()
|
226 |
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));
|
227 | 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));
|
228 | 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 {
|
229 | 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);
|
230 | import com.intellij.execution.ui.ConsoleView;
import com.intellij.execution.ui.ConsoleViewContentType;
import com.intellij.execution.ui.RunContentDescriptor;
import com.intellij.execution.ui.actions.CloseAction;
import com.intellij.ide.scratch.ScratchFileService;
<BUG>import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.editor.Document;</BUG>
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.ex.util.EditorUtil;
import com.intellij.openapi.fileEditor.FileEditor;
| import com.intellij.openapi.application.Application;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.editor.Document;
|
231 | import java.lang.ref.WeakReference;
import java.util.List;
import java.util.Map;
public class RunIdeConsoleAction extends DumbAwareAction {
private static final String DEFAULT_FILE_NAME = "ide-scripting";
<BUG>private static final Key<WeakReference<ConsoleView>> CONSOLE_VIEW_KEY = Key.create("CONSOLE_VIEW_KEY");
private static final Key<ConsoleHistoryController> HISTORY_CONTROLLER_KEY = Key.create("HISTORY_CONTROLLER_KEY");</BUG>
static class Engines {
static final Map<String, ScriptEngineFactory> ourEngines = ContainerUtil.newLinkedHashMap();
static {
| private static final Key<WeakReference<RunContentDescriptor>> DESCRIPTOR_KEY = Key.create("DESCRIPTOR_KEY");
private static final Key<ConsoleHistoryController> HISTORY_CONTROLLER_KEY = Key.create("HISTORY_CONTROLLER_KEY");
|
232 | return factory.getScriptEngine();
}
}
return null;
}
<BUG>private static void executeQuery(@NotNull Project project,
</BUG>
@NotNull VirtualFile file,
@NotNull Editor editor,
@NotNull ScriptEngine engine) {
| private static void executeQuery(@NotNull final Project project_,
|
233 | public void print(String s) {
consoleView.print(s + "\n", ConsoleViewContentType.NORMAL_OUTPUT);
</BUG>
}
public void error(String s) {
<BUG>consoleView.print(s + "\n", ConsoleViewContentType.ERROR_OUTPUT);
</BUG>
}
}
consoleView.print("> " + command, ConsoleViewContentType.USER_INPUT);
| printInContent(descriptor, s + "\n", ConsoleViewContentType.NORMAL_OUTPUT);
printInContent(descriptor, s + "\n", ConsoleViewContentType.ERROR_OUTPUT);
|
234 | import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.security.DigestOutputStream;
import java.security.MessageDigest;
<BUG>import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;</BUG>
public final class PatchUtils {
| import java.text.DateFormat;
import java.util.Date;
import java.util.List;
|
235 | 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;
|
236 | private static final String PATH_DELIMITER = "/";
public static final byte[] NO_CONTENT = PatchingTask.NO_CONTENT;
enum Element {
ADDED_BUNDLE("added-bundle"),
ADDED_MISC_CONTENT("added-misc-content"),
<BUG>ADDED_MODULE("added-module"),
BUNDLES("bundles"),</BUG>
CUMULATIVE("cumulative"),
DESCRIPTION("description"),
MISC_FILES("misc-files"),
| APPLIES_TO_VERSION("applies-to-version"),
BUNDLES("bundles"),
|
237 | final int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
final String value = reader.getAttributeValue(i);
final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
<BUG>case APPLIES_TO_VERSION:
builder.addAppliesTo(value);
break;</BUG>
case RESULTING_VERSION:
if(type == Patch.PatchType.CUMULATIVE) {
| [DELETED] |
238 | final StringBuilder path = new StringBuilder();
for(final String p : item.getPath()) {
path.append(p).append(PATH_DELIMITER);
}
path.append(item.getName());
<BUG>writer.writeAttribute(Attribute.PATH.name, path.toString());
if(type != ModificationType.REMOVE) {</BUG>
writer.writeAttribute(Attribute.HASH.name, bytesToHexString(item.getContentHash()));
}
if(type != ModificationType.ADD) {
| if (item.isDirectory()) {
writer.writeAttribute(Attribute.DIRECTORY.name, "true");
if(type != ModificationType.REMOVE) {
|
239 | 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;
|
240 | package org.rstudio.studio.client.workbench.views.vcs.dialog;
<BUG>import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.HasClickHandlers;</BUG>
import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
| import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.HasClickHandlers;
|
241 | import com.google.gwt.user.client.ui.ScrollPanel;
import com.google.gwt.user.client.ui.SplitLayoutPanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
import org.rstudio.core.client.widget.LeftRightToggleButton;
<BUG>import org.rstudio.core.client.widget.Toolbar;
import org.rstudio.studio.client.workbench.views.vcs.BranchToolbarButton;</BUG>
import org.rstudio.studio.client.workbench.views.vcs.dialog.HistoryPresenter.CommitDetailDisplay;
import org.rstudio.studio.client.workbench.views.vcs.dialog.HistoryPresenter.CommitListDisplay;
import org.rstudio.studio.client.workbench.views.vcs.dialog.HistoryPresenter.Display;
| import org.rstudio.core.client.widget.ToolbarButton;
import org.rstudio.studio.client.workbench.commands.Commands;
import org.rstudio.studio.client.workbench.views.vcs.BranchToolbarButton;
|
242 | String commitDetail();
}
interface Binder extends UiBinder<Widget, HistoryPanel>
{}
@Inject
<BUG>public HistoryPanel(BranchToolbarButton branchToolbarButton)
{</BUG>
splitPanel_ = new SplitLayoutPanel(4);
initWidget(GWT.<Binder>create(Binder.class).createAndBindUi(this));
| public HistoryPanel(BranchToolbarButton branchToolbarButton,
Commands commands)
{
|
243 | static CommandLineParser cmdParser = new BasicParser();
static {
options = new Options();
options.addOption("c", true, "The corpus directory containing files with year metadata")
.addOption("o", true, "Output directory where output will be stored")
<BUG>.addOption("w", true, "The window size used to compute the co-occurrences")
</BUG>
.addOption("e", true, "The class used to extract the content from files")
.addOption("r", true, "Regular expression used to fetch files (optional, default \".+\")");
}
| .addOption("w", true, "The window size used to compute the co-occurrences (optional, default 5)")
|
244 | import java.sql.SQLException;
import java.sql.Statement;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collection;
<BUG>import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;</BUG>
import java.util.concurrent.locks.Lock;
| import java.util.HashMap;
import java.util.Map;
import java.util.Set;
|
245 | if (msgin != null) {
try {
msgin.close();
} catch (IOException e) {
}
<BUG>}
}
}
protected void updateSourceSequence(SourceSequence seq)
</BUG>
throws SQLException {
| releaseResources(stmt, null);
protected void storeMessage(Identifier sid, RMMessage msg, boolean outbound)
throws IOException, SQLException {
storeMessage(connection, sid, msg, outbound);
protected void updateSourceSequence(Connection con, SourceSequence seq)
|
246 | } catch (SQLException ex) {
if (!isTableExistsError(ex)) {
throw ex;
} else {
LOG.fine("Table CXF_RM_SRC_SEQUENCES already exists.");
<BUG>verifyTable(SRC_SEQUENCES_TABLE_NAME, SRC_SEQUENCES_TABLE_COLS);
</BUG>
}
} finally {
stmt.close();
| verifyTable(con, SRC_SEQUENCES_TABLE_NAME, SRC_SEQUENCES_TABLE_COLS);
|
247 | } catch (SQLException ex) {
if (!isTableExistsError(ex)) {
throw ex;
} else {
LOG.fine("Table CXF_RM_DEST_SEQUENCES already exists.");
<BUG>verifyTable(DEST_SEQUENCES_TABLE_NAME, DEST_SEQUENCES_TABLE_COLS);
</BUG>
}
} finally {
stmt.close();
| LOG.fine("Table CXF_RM_SRC_SEQUENCES already exists.");
verifyTable(con, SRC_SEQUENCES_TABLE_NAME, SRC_SEQUENCES_TABLE_COLS);
|
248 | }
} finally {
stmt.close();
}
for (String tableName : new String[] {OUTBOUND_MSGS_TABLE_NAME, INBOUND_MSGS_TABLE_NAME}) {
<BUG>stmt = connection.createStatement();
try {</BUG>
stmt.executeUpdate(MessageFormat.format(CREATE_MESSAGES_TABLE_STMT, tableName));
} catch (SQLException ex) {
if (!isTableExistsError(ex)) {
| stmt = con.createStatement();
try {
stmt.executeUpdate(CREATE_DEST_SEQUENCES_TABLE_STMT);
|
249 | throw ex;
} else {
if (LOG.isLoggable(Level.FINE)) {
LOG.fine("Table " + tableName + " already exists.");
}
<BUG>verifyTable(tableName, MESSAGES_TABLE_COLS);
</BUG>
}
} finally {
stmt.close();
| LOG.fine("Table CXF_RM_SRC_SEQUENCES already exists.");
verifyTable(con, SRC_SEQUENCES_TABLE_NAME, SRC_SEQUENCES_TABLE_COLS);
|
250 | if (newCols.size() > 0) {
if (LOG.isLoggable(Level.FINE)) {
LOG.log(Level.FINE, "Table " + tableName + " needs additional columns");
}
for (String[] newCol : newCols) {
<BUG>Statement st = connection.createStatement();
try {</BUG>
st.executeUpdate(MessageFormat.format(ALTER_TABLE_STMT_STR,
tableName, newCol[0], newCol[1]));
if (LOG.isLoggable(Level.FINE)) {
| Statement st = con.createStatement();
try {
|
251 | if (nextReconnectAttempt < System.currentTimeMillis()) {
nextReconnectAttempt = System.currentTimeMillis() + reconnectDelay;
reconnectDelay = reconnectDelay * useExponentialBackOff;
}
}
<BUG>}
public static void deleteDatabaseFiles() {</BUG>
deleteDatabaseFiles(DEFAULT_DATABASE_NAME, true);
}
public static void deleteDatabaseFiles(String dbName, boolean now) {
| public static void deleteDatabaseFiles() {
|
252 | package eu.isas.peptideshaker.cmd;
import com.compomics.software.CompomicsWrapper;
<BUG>import com.compomics.software.settings.UtilitiesPathPreferences;
import static eu.isas.peptideshaker.cmd.PeptideShakerCLI.redirectErrorStream;</BUG>
import eu.isas.peptideshaker.preferences.PeptideShakerPathPreferences;
import java.io.File;
import java.io.PrintWriter;
| import com.compomics.util.gui.waiting.waitinghandlers.WaitingHandlerCLIImpl;
import com.compomics.util.waiting.WaitingHandler;
import static eu.isas.peptideshaker.cmd.PeptideShakerCLI.redirectErrorStream;
|
253 | if (!path.equals("")) {
try {
PeptideShakerPathPreferences.setAllPathsIn(path);
} catch (Exception e) {
System.out.println("An error occurred when setting the temporary folder path.");
<BUG>e.printStackTrace();
}</BUG>
}
HashMap<String, String> pathInput = pathSettingsCLIInputBean.getPaths();
for (String id : pathInput.keySet()) {
| waitingHandler.setRunCanceled();
|
254 | } else {
PeptideShakerPathPreferences.setPathPreference(peptideShakerPathKey, pathInput.get(id));
}
} catch (Exception e) {
System.out.println("An error occurred when setting the path " + id + ".");
<BUG>e.printStackTrace();
}</BUG>
}
File destinationFile = new File(getJarFilePath(), UtilitiesPathPreferences.configurationFileName);
try {
| UtilitiesPathPreferences.setPathPreference(utilitiesPathKey, pathInput.get(id));
waitingHandler.setRunCanceled();
|
255 | File destinationFile = new File(getJarFilePath(), UtilitiesPathPreferences.configurationFileName);
try {
PeptideShakerPathPreferences.writeConfigurationToFile(destinationFile);
} catch (Exception e) {
System.out.println("An error occurred when saving the path preference to " + destinationFile.getAbsolutePath() + ".");
<BUG>e.printStackTrace();
}
System.out.println("Path configuration completed.");
}</BUG>
public String getJarFilePath() {
| waitingHandler.setRunCanceled();
if (!waitingHandler.isRunCanceled()) {
|
256 | import com.compomics.util.db.DerbyUtil;</BUG>
import com.compomics.util.experiment.biology.EnzymeFactory;
import com.compomics.util.experiment.biology.PTMFactory;
import com.compomics.util.experiment.biology.taxonomy.SpeciesFactory;
<BUG>import com.compomics.util.experiment.identification.protein_sequences.SequenceFactory;
import com.compomics.util.experiment.massspectrometry.SpectrumFactory;</BUG>
import com.compomics.util.waiting.WaitingHandler;
import com.compomics.util.gui.waiting.waitinghandlers.WaitingHandlerCLIImpl;
import com.compomics.util.preferences.UtilitiesUserPreferences;
import eu.isas.peptideshaker.PeptideShaker;
| package eu.isas.peptideshaker.cmd;
import com.compomics.software.settings.PathKey;
import com.compomics.software.settings.UtilitiesPathPreferences;
|
257 | import com.compomics.util.db.DerbyUtil;</BUG>
import com.compomics.util.experiment.biology.EnzymeFactory;
import com.compomics.util.experiment.biology.PTMFactory;
import com.compomics.util.experiment.biology.taxonomy.SpeciesFactory;
<BUG>import com.compomics.util.experiment.identification.protein_sequences.SequenceFactory;
import com.compomics.util.experiment.massspectrometry.SpectrumFactory;</BUG>
import com.compomics.util.gui.waiting.waitinghandlers.WaitingHandlerCLIImpl;
import com.compomics.util.preferences.UtilitiesUserPreferences;
import com.compomics.util.waiting.WaitingHandler;
import eu.isas.peptideshaker.PeptideShaker;
| package eu.isas.peptideshaker.cmd;
import com.compomics.software.settings.PathKey;
import com.compomics.software.settings.UtilitiesPathPreferences;
|
258 | waitingHandler.appendReport("An error occurred while closing PeptideShaker.", true, true);
e2.printStackTrace();
}</BUG>
waitingHandler.appendReport("MzIdentML export completed.", true, true);
System.exit(0);
<BUG>return null;
}</BUG>
private void setPathConfiguration() throws IOException {
File pathConfigurationFile = new File(PeptideShaker.getJarFilePath(), UtilitiesPathPreferences.configurationFileName);
| }
if (!waitingHandler.isRunCanceled()) {
return 0;
} else {
System.exit(1);
return 1;
}
}
|
259 | customTokens.put("%%mlFinalForestsPerHost%%", hubConfig.finalForestsPerHost.toString());
customTokens.put("%%mlTraceAppserverName%%", hubConfig.traceHttpName);
customTokens.put("%%mlTracePort%%", hubConfig.tracePort.toString());
customTokens.put("%%mlTraceDbName%%", hubConfig.traceDbName);
customTokens.put("%%mlTraceForestsPerHost%%", hubConfig.traceForestsPerHost.toString());
<BUG>customTokens.put("%%mlModulesDbName%%", hubConfig.modulesDbName);
}</BUG>
public void init() {
try {
LOGGER.error("PLUGINS DIR: " + pluginsDir.toString());
| customTokens.put("%%mlTriggersDbName%%", hubConfig.triggersDbName);
customTokens.put("%%mlSchemasDbName%%", hubConfig.schemasDbName);
}
|
260 | Assert.assertEquals(msg, result2);
}
@Test
public void testAsciiConverter() {
HttpResponse response = createOkResponse();
<BUG>byte[] payload = parser.marshalToBytes(response);
</BUG>
ConvertAscii converter = new ConvertAscii();
String readableForm = converter.convertToReadableForm(payload);
Assert.assertEquals(
| byte[] payload = unwrap(parser.marshalToByteBuffer(response));
|
261 | Assert.assertEquals(response, httpMessage);
}
@Test
public void test2AndHalfHttpMessages() {
HttpResponse response = createOkResponse();
<BUG>byte[] payload = parser.marshalToBytes(response);
</BUG>
byte[] first = new byte[2*payload.length + 20];
byte[] second = new byte[payload.length - 20];
System.arraycopy(payload, 0, first, 0, payload.length);
| byte[] payload = unwrap(parser.marshalToByteBuffer(response));
|
262 | DataWrapper payload1 = dataGen.wrapByteArray("0123456789".getBytes());
HttpChunk chunk = new HttpChunk();
chunk.addExtension(new HttpChunkExtension("asdf", "value"));
chunk.addExtension(new HttpChunkExtension("something"));
chunk.setBody(payload1);
<BUG>byte[] payload = parser.marshalToBytes(chunk);
</BUG>
String str = new String(payload);
Assert.assertEquals("a;asdf=value;something\r\n0123456789\r\n", str);
HttpLastChunk lastChunk = new HttpLastChunk();
| byte[] payload = unwrap(parser.marshalToByteBuffer(chunk));
|
263 | HttpLastChunk lastChunk = new HttpLastChunk();
lastChunk.addExtension(new HttpChunkExtension("this", "that"));
lastChunk.addHeader(new Header("customer", "value"));
String lastPayload = parser.marshalToString(lastChunk);
Assert.assertEquals("0;this=that\r\ncustomer: value\r\n\r\n", lastPayload);
<BUG>byte[] lastBytes = parser.marshalToBytes(lastChunk);
</BUG>
String lastPayloadFromBytes = new String(lastBytes, HttpParserFactory.iso8859_1);
Assert.assertEquals("0;this=that\r\ncustomer: value\r\n\r\n", lastPayloadFromBytes);
}
| byte[] lastBytes = unwrap(parser.marshalToByteBuffer(lastChunk));
|
264 | import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
<BUG>import org.slf4j.Logger;
import org.slf4j.LoggerFactory;</BUG>
import org.webpieces.data.api.BufferPool;
import org.webpieces.data.api.DataWrapper;
import org.webpieces.data.api.DataWrapperGenerator;
| [DELETED] |
265 | import java.nio.ByteBuffer;
import org.webpieces.data.api.DataWrapper;
import org.webpieces.httpparser.api.dto.HttpPayload;
public interface HttpParser {
ByteBuffer marshalToByteBuffer(HttpPayload request);
<BUG>byte[] marshalToBytes(HttpPayload request);</BUG>
String marshalToString(HttpPayload request);
Memento prepareToParse();
Memento parse(Memento state, DataWrapper moreData);
HttpPayload unmarshal(byte[] msg);
}
| [DELETED] |
266 | HttpRequestLine requestLine = new HttpRequestLine();
requestLine.setMethod(KnownHttpMethod.GET);
requestLine.setUri(new HttpUri("http://www.deano.com"));
HttpRequest req = new HttpRequest();
req.setRequestLine(requestLine);
<BUG>byte[] array = parser.marshalToBytes(req);
</BUG>
ByteBuffer buffer = ByteBuffer.wrap(array);
dataListener.incomingData(mockTcpChannel, ByteBuffer.allocate(0));
dataListener.incomingData(mockTcpChannel, buffer);
| byte[] array = unwrap(parser.marshalToByteBuffer(req));
|
267 | Assert.assertEquals(msg, result2);
}
@Test
public void testAsciiConverter() {
HttpRequest request = createPostRequest();
<BUG>byte[] payload = parser.marshalToBytes(request);
</BUG>
ConvertAscii converter = new ConvertAscii();
String readableForm = converter.convertToReadableForm(payload);
String expected = "POST\\s http://myhost.com\\s HTTP/1.1\\r\\n\r\n"
| byte[] payload = unwrap(parser.marshalToByteBuffer(request));
|
268 | Assert.assertEquals(request, httpMessage);
}
@Test
public void test2AndHalfHttpMessages() {
HttpRequest request = createPostRequest();
<BUG>byte[] payload = parser.marshalToBytes(request);
</BUG>
byte[] first = new byte[2*payload.length + 20];
byte[] second = new byte[payload.length - 20];
System.arraycopy(payload, 0, first, 0, payload.length);
| byte[] payload = unwrap(parser.marshalToByteBuffer(request));
|
269 | import org.junit.Assert;
import org.junit.Test;
import org.powermock.reflect.Whitebox;
import tachyon.TachyonURI;
import tachyon.client.TachyonFSTestUtils;
<BUG>import tachyon.client.TachyonStorageType;
import tachyon.client.UnderStorageType;
import tachyon.client.file.TachyonFile;</BUG>
import tachyon.exception.TachyonException;
| import tachyon.client.WriteType;
|
270 | import tachyon.shell.AbstractTfsShellTest;
public class ChgrpCommandTest extends AbstractTfsShellTest {
@Test
public void chgrpTest() throws IOException, TachyonException {
Whitebox.setInternalState(LoginUser.class, "sLoginUser", (String) null);
<BUG>TachyonFSTestUtils.createByteFile(mTfs, "/testFile", TachyonStorageType.STORE,
UnderStorageType.NO_PERSIST, 10);
mFsShell.run("chgrp", "group1", "/testFile");
TachyonFile tf = mTfs.open(new TachyonURI("/testFile"));
String group = mTfs.getInfo(tf).getGroupName();</BUG>
Assert.assertEquals("group1", group);
| TachyonFSTestUtils.createByteFile(mTfs, "/testFile", WriteType.MUST_CACHE, 10);
String group = mTfs.getStatus(new TachyonURI("/testFile")).getGroupName();
|
271 | public void setAclTest() throws Exception {
TachyonURI filePath = new TachyonURI("/file");
ClientContext.getConf().set(Constants.SECURITY_LOGIN_USERNAME, "tachyon");
CreateFileOptions op =
CreateFileOptions.defaults().setBlockSizeBytes(64);
<BUG>mTfs.createFile(filePath, op).close();
mTfs.setAcl(filePath,
new SetAclOptions.Builder().setOwner("user1").setRecursive(false).build());
mTfs.setAcl(filePath,
new SetAclOptions.Builder().setGroup("group1").setRecursive(false).build());
mTfs.setAcl(filePath,
new SetAclOptions.Builder().setPermission((short) 0400).setRecursive(false).build());
</BUG>
URIStatus status = mTfs.getStatus(filePath);
| mTfs.setAcl(filePath, SetAclOptions.defaults().setOwner("user1").setRecursive(false));
mTfs.setAcl(filePath, SetAclOptions.defaults().setGroup("group1").setRecursive(false));
mTfs.setAcl(filePath, SetAclOptions.defaults().setPermission((short) 0400).setRecursive(false));
|
272 | import org.junit.Assert;
import org.junit.Test;
import org.powermock.reflect.Whitebox;
import tachyon.TachyonURI;
import tachyon.client.TachyonFSTestUtils;
<BUG>import tachyon.client.TachyonStorageType;
import tachyon.client.UnderStorageType;
import tachyon.client.file.TachyonFile;</BUG>
import tachyon.exception.TachyonException;
| import tachyon.client.WriteType;
|
273 | public class ChgrprCommandTest extends AbstractTfsShellTest {
@Test
public void chgrprTest() throws IOException, TachyonException {
Whitebox.setInternalState(LoginUser.class, "sLoginUser", (String) null);
mFsShell.run("mkdir", "/testFolder1");
<BUG>TachyonFSTestUtils.createByteFile(mTfs, "/testFolder1/testFile", TachyonStorageType.STORE,
UnderStorageType.NO_PERSIST, 10);
mFsShell.run("chgrpr", "group1", "/testFolder1");
TachyonFile tf = mTfs.open(new TachyonURI("/testFolder1/testFile"));
String group = mTfs.getInfo(tf).getGroupName();</BUG>
Assert.assertEquals("group1", group);
| TachyonFSTestUtils.createByteFile(mTfs, "/testFolder1/testFile", WriteType.MUST_CACHE, 10);
String group = mTfs.getStatus(new TachyonURI("/testFolder1/testFile")).getGroupName();
|
274 | import org.junit.Assert;
import org.junit.Test;
import org.powermock.reflect.Whitebox;
import tachyon.TachyonURI;
import tachyon.client.TachyonFSTestUtils;
<BUG>import tachyon.client.TachyonStorageType;
import tachyon.client.UnderStorageType;
import tachyon.client.file.TachyonFile;</BUG>
import tachyon.exception.TachyonException;
| import tachyon.client.WriteType;
|
275 | import tachyon.shell.AbstractTfsShellTest;
public class ChownCommandTest extends AbstractTfsShellTest {
@Test
public void chownTest() throws IOException, TachyonException {
Whitebox.setInternalState(LoginUser.class, "sLoginUser", (String) null);
<BUG>TachyonFSTestUtils.createByteFile(mTfs, "/testFile", TachyonStorageType.STORE,
UnderStorageType.NO_PERSIST, 10);
mFsShell.run("chown", "user1", "/testFile");
TachyonFile tf = mTfs.open(new TachyonURI("/testFile"));
String owner = mTfs.getInfo(tf).getUserName();</BUG>
Assert.assertEquals("user1", owner);
| TachyonFSTestUtils.createByteFile(mTfs, "/testFile", WriteType.MUST_CACHE, 10);
String owner = mTfs.getStatus(new TachyonURI("/testFile")).getUserName();
|
276 | import org.junit.Assert;
import org.junit.Test;
import org.powermock.reflect.Whitebox;
import tachyon.TachyonURI;
import tachyon.client.TachyonFSTestUtils;
<BUG>import tachyon.client.TachyonStorageType;
import tachyon.client.UnderStorageType;
import tachyon.client.file.TachyonFile;</BUG>
import tachyon.exception.TachyonException;
| import tachyon.client.WriteType;
|
277 | import tachyon.shell.AbstractTfsShellTest;
public class ChmodCommandTest extends AbstractTfsShellTest {
@Test
public void chmodTest() throws IOException, TachyonException {
Whitebox.setInternalState(LoginUser.class, "sLoginUser", (String) null);
<BUG>TachyonFSTestUtils.createByteFile(mTfs, "/testFile", TachyonStorageType.STORE,
UnderStorageType.NO_PERSIST, 10);
mFsShell.run("chmod", "777", "/testFile");
TachyonFile tf = mTfs.open(new TachyonURI("/testFile"));
int permission = mTfs.getInfo(tf).getPermission();</BUG>
Assert.assertEquals((short) 0777, permission);
| TachyonFSTestUtils.createByteFile(mTfs, "/testFile", WriteType.MUST_CACHE, 10);
int permission = mTfs.getStatus(new TachyonURI("/testFile")).getPermission();
|
278 | import org.junit.Assert;
import org.junit.Test;
import org.powermock.reflect.Whitebox;
import tachyon.TachyonURI;
import tachyon.client.TachyonFSTestUtils;
<BUG>import tachyon.client.TachyonStorageType;
import tachyon.client.UnderStorageType;
import tachyon.client.file.TachyonFile;</BUG>
import tachyon.exception.TachyonException;
| import tachyon.client.WriteType;
|
279 | import org.junit.Assert;
import org.junit.Test;
import org.powermock.reflect.Whitebox;
import tachyon.TachyonURI;
import tachyon.client.TachyonFSTestUtils;
<BUG>import tachyon.client.TachyonStorageType;
import tachyon.client.UnderStorageType;
import tachyon.client.file.TachyonFile;</BUG>
import tachyon.exception.TachyonException;
| import tachyon.client.WriteType;
|
280 | public class ChmodrCommandTest extends AbstractTfsShellTest {
@Test
public void chmodrTest() throws IOException, TachyonException {
Whitebox.setInternalState(LoginUser.class, "sLoginUser", (String) null);
mFsShell.run("mkdir", "/testFolder1");
<BUG>TachyonFSTestUtils.createByteFile(mTfs, "/testFolder1/testFile", TachyonStorageType.STORE,
UnderStorageType.NO_PERSIST, 10);
mFsShell.run("chmodr", "777", "/testFolder1");
TachyonFile tf = mTfs.open(new TachyonURI("/testFolder1"));
int permission = mTfs.getInfo(tf).getPermission();</BUG>
Assert.assertEquals((short) 0777, permission);
| TachyonFSTestUtils.createByteFile(mTfs, "/testFolder1/testFile", WriteType.MUST_CACHE, 10);
int permission = mTfs.getStatus(new TachyonURI("/testFolder1")).getPermission();
|
281 | 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;
|
282 | put(grammarAccess.getElkEdgeAccess().getGroup_1(), "rule__ElkEdge__Group_1__0");
put(grammarAccess.getElkEdgeAccess().getGroup_3(), "rule__ElkEdge__Group_3__0");
put(grammarAccess.getElkEdgeAccess().getGroup_6(), "rule__ElkEdge__Group_6__0");
put(grammarAccess.getElkEdgeAccess().getGroup_7(), "rule__ElkEdge__Group_7__0");
put(grammarAccess.getEdgeLayoutAccess().getGroup(), "rule__EdgeLayout__Group__0");
<BUG>put(grammarAccess.getElkSingleEdgeSectionAccess().getGroup(), "rule__ElkSingleEdgeSection__Group__0");
put(grammarAccess.getElkSingleEdgeSectionAccess().getGroup_1_0(), "rule__ElkSingleEdgeSection__Group_1_0__0");
put(grammarAccess.getElkSingleEdgeSectionAccess().getGroup_1_1(), "rule__ElkSingleEdgeSection__Group_1_1__0");
put(grammarAccess.getElkSingleEdgeSectionAccess().getGroup_1_2(), "rule__ElkSingleEdgeSection__Group_1_2__0");
put(grammarAccess.getElkSingleEdgeSectionAccess().getGroup_1_3(), "rule__ElkSingleEdgeSection__Group_1_3__0");
put(grammarAccess.getElkSingleEdgeSectionAccess().getGroup_1_4(), "rule__ElkSingleEdgeSection__Group_1_4__0");
put(grammarAccess.getElkSingleEdgeSectionAccess().getGroup_1_4_3(), "rule__ElkSingleEdgeSection__Group_1_4_3__0");
</BUG>
put(grammarAccess.getElkEdgeSectionAccess().getGroup(), "rule__ElkEdgeSection__Group__0");
| put(grammarAccess.getElkSingleEdgeSectionAccess().getGroup_1(), "rule__ElkSingleEdgeSection__Group_1__0");
put(grammarAccess.getElkSingleEdgeSectionAccess().getGroup_1_0_0(), "rule__ElkSingleEdgeSection__Group_1_0_0__0");
put(grammarAccess.getElkSingleEdgeSectionAccess().getGroup_1_0_1(), "rule__ElkSingleEdgeSection__Group_1_0_1__0");
put(grammarAccess.getElkSingleEdgeSectionAccess().getGroup_1_0_2(), "rule__ElkSingleEdgeSection__Group_1_0_2__0");
put(grammarAccess.getElkSingleEdgeSectionAccess().getGroup_1_0_3(), "rule__ElkSingleEdgeSection__Group_1_0_3__0");
put(grammarAccess.getElkSingleEdgeSectionAccess().getGroup_1_1_3(), "rule__ElkSingleEdgeSection__Group_1_1_3__0");
|
283 | put(grammarAccess.getPropertyAccess().getValueAssignment_2_0(), "rule__Property__ValueAssignment_2_0");
put(grammarAccess.getPropertyAccess().getValueAssignment_2_1(), "rule__Property__ValueAssignment_2_1");
put(grammarAccess.getPropertyAccess().getValueAssignment_2_2(), "rule__Property__ValueAssignment_2_2");
put(grammarAccess.getPropertyAccess().getValueAssignment_2_3(), "rule__Property__ValueAssignment_2_3");
put(grammarAccess.getShapeLayoutAccess().getUnorderedGroup_2(), "rule__ShapeLayout__UnorderedGroup_2");
<BUG>put(grammarAccess.getElkSingleEdgeSectionAccess().getUnorderedGroup_1(), "rule__ElkSingleEdgeSection__UnorderedGroup_1");
put(grammarAccess.getElkEdgeSectionAccess().getUnorderedGroup_4(), "rule__ElkEdgeSection__UnorderedGroup_4");
</BUG>
}
| put(grammarAccess.getElkSingleEdgeSectionAccess().getUnorderedGroup_1_0(), "rule__ElkSingleEdgeSection__UnorderedGroup_1_0");
put(grammarAccess.getElkEdgeSectionAccess().getUnorderedGroup_4_0(), "rule__ElkEdgeSection__UnorderedGroup_4_0");
|
284 | import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import java.io.File;
@Mod(modid = Qubble.MODID, name = "Qubble", version = Qubble.VERSION, dependencies = "required-after:llibrary@[" + Qubble.LLIBRARY_VERSION + ",)", clientSideOnly = true)
public class Qubble {
public static final String MODID = "qubble";
<BUG>public static final String VERSION = "1.0.0-dev";
</BUG>
public static final String LLIBRARY_VERSION = "1.3.0";
@Mod.Instance(Qubble.MODID)
public static Qubble INSTANCE;
| public static final String VERSION = "1.0.0-develop";
|
285 | import net.minecraft.client.renderer.VertexBuffer;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;</BUG>
import net.minecraft.nbt.CompressedStreamTools;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
<BUG>import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;</BUG>
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
| import net.ilexiconn.qubble.client.gui.element.*;
import net.ilexiconn.qubble.server.model.importer.IModelImporter;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.ScaledResolution;
|
286 | import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@SideOnly(Side.CLIENT)
<BUG>public class QubbleGUI extends GuiScreen {
</BUG>
private GuiScreen parent;
private ScaledResolution resolution;
private ToolbarElement toolbar;
| public class QubbleGUI extends ElementGUI {
|
287 | private ModelMode mode = ModelMode.MODEL;
public QubbleGUI(GuiScreen parent) {
this.parent = parent;
}
@Override
<BUG>public void initGui() {
ElementHandler.INSTANCE.clearGUI(this);</BUG>
ElementHandler.INSTANCE.addElement(this, this.modelView = new ModelViewElement(this));
ElementHandler.INSTANCE.addElement(this, this.modelTree = new ModelTreeElement(this));
| public void initElements() {
|
288 | {
private Boolean trust = Boolean.FALSE;
public CertificateTrustDialog(int position, X509Certificate cert)
{
super(position, cert);
<BUG>setTitle(i18n.tr("Sicherheitsabfrage"));
setText(i18n.tr("Das Zertifikat des Systems konnte nicht verifiziert werden.\n" +
"Bitte prüfen Sie die Eigenschaften des Zertifikates und entscheiden Sie,\nob Sie ihm " +
"vertrauen möchten."));</BUG>
}
| setText(i18n.tr("Bitte prüfen Sie die Eigenschaften des Server-Zertifikates und " +
"entscheiden Sie,\nob Sie ihm vertrauen möchten."));
|
289 | this.setSize(440,SWT.DEFAULT);
this.certs.addAll(certs);
this.cnIssuer = this.createLabel(i18n.tr("Common Name (CN)"));
this.oIssuer = this.createLabel(i18n.tr("Organisation (O)"));
this.ouIssuer = this.createLabel(i18n.tr("Abteilung (OU)"));
<BUG>this.cnSubject = this.createLabel(i18n.tr("Common Name (CN)"));
</BUG>
this.oSubject = this.createLabel(i18n.tr("Organisation (O)"));
this.ouSubject = this.createLabel(i18n.tr("Abteilung (OU)"));
this.validity = this.createLabel(i18n.tr("Gültigkeit"));
| this.cnSubject = this.createLink(i18n.tr("Common Name (CN)"));
|
290 | private void addBuffer() {
try {
if (!isClosed && bufferQueue.size() <= BUFFER_QUEUE_SIZE)
bufferQueue.put(new byte[size]);
} catch (InterruptedException e) {
<BUG>LOGGER.log(LogLevel.INFO, "Unable to add buffer to buffer queue", e);
}</BUG>
}
}
public AsyncBufferWriter(OutputStream outputStream, int size, ThreadFactory threadFactory, byte[] newline) {
| LOGGER.log(LogLevel.INFO, Messages.getString("HDFS_ASYNC_UNABLE_ADD_TO_QUEUE"), e);
|
291 | isClosed = true;
exService.shutdown();
try {
exService.awaitTermination(Integer.MAX_VALUE, TimeUnit.SECONDS);
} catch (InterruptedException e) {
<BUG>LOGGER.log(LogLevel.WARN, "Execution Service shutdown is interrupted.", e);
}finally {</BUG>
flushNow();
out.close();
bufferQueue.clear();
| LOGGER.log(LogLevel.WARN, Messages.getString("HDFS_ASYNC_SERVICE_SHUTDOWN_INTERRUPTED"), e);
}finally {
|
292 | @Inject
private PerWorldInventory plugin;
@Inject
private GroupManager groupManager;
@Inject
<BUG>private PermissionManager permissionManager;
private PermissionNode permissionNode = AdminPermission.RELOAD;</BUG>
@Override
public void executeCommand(CommandSender sender, List<String> args) {
if (!permissionManager.hasPermission(sender, permissionNode)) {
| private Settings settings;
private PermissionNode permissionNode = AdminPermission.RELOAD;
|
293 | @Override
public void executeCommand(CommandSender sender, List<String> args) {
if (!permissionManager.hasPermission(sender, permissionNode)) {
sender.sendMessage(ChatColor.DARK_RED + "» " + ChatColor.GRAY + "You do not have permission to do that.");
return;
<BUG>}
plugin.reloadConfig();
Settings.reloadSettings(plugin.getConfig());
if (Settings.getInt("config-version") < PerWorldInventory.CONFIG_VERSION) {
plugin.getLogger().warning("Your PerWorldInventory config is out of date! Some options may be missing.");
plugin.getLogger().warning("Copy the new options from here: https://www.spigotmc.org/resources/per-world-inventory.4482/");
}</BUG>
groupManager.loadGroupsToMemory(plugin.getWorldsConfig());
| settings.reload();
PerWorldInventory.reload();
|
294 | import me.gnat008.perworldinventory.commands.ExecutableCommand;
import me.gnat008.perworldinventory.commands.HelpCommand;
import me.gnat008.perworldinventory.commands.PerWorldInventoryCommand;
import me.gnat008.perworldinventory.commands.ReloadCommand;
import me.gnat008.perworldinventory.commands.SetWorldDefaultCommand;
<BUG>import me.gnat008.perworldinventory.commands.VersionCommand;
import me.gnat008.perworldinventory.config.Settings;</BUG>
import me.gnat008.perworldinventory.data.DataWriter;
import me.gnat008.perworldinventory.data.FileWriter;
import me.gnat008.perworldinventory.data.players.PWIPlayerManager;
| import me.gnat008.perworldinventory.config.PwiProperties;
import me.gnat008.perworldinventory.config.Settings;
|
295 | Player player = (Player) sender;
Group group;
if (args.size() == 1) {
String name = args.get(0);
group = name.equalsIgnoreCase("serverDefault") ? new Group("__default", null, null) : groupManager.getGroup(name);
<BUG>} else if (args.size() == 0 || args.isEmpty()) {
try {</BUG>
group = groupManager.getGroupFromWorld(player.getWorld().getName());
} catch (IllegalArgumentException ex) {
player.sendMessage(ChatColor.DARK_RED + "» " + ChatColor.GRAY + "You are not standing in a valid world!");
| } else if (args.isEmpty()) {
try {
|
296 | package me.gnat008.perworldinventory.api;
<BUG>import me.gnat008.perworldinventory.PerWorldInventory;
import me.gnat008.perworldinventory.config.Settings;</BUG>
import me.gnat008.perworldinventory.data.players.PWIPlayer;
import me.gnat008.perworldinventory.data.players.PWIPlayerManager;
import me.gnat008.perworldinventory.groups.Group;
| import me.gnat008.perworldinventory.config.PwiProperties;
import me.gnat008.perworldinventory.config.Settings;
|
297 | @Inject
private PermissionManager permissionManager;
@Inject
private PerWorldInventory plugin;
@Inject
<BUG>private PWIPlayerManager playerManager;
PerWorldInventoryAPI() {</BUG>
}
public boolean canWorldsShare(String first, String second) {
Group firstGroup = groupManager.getGroupFromWorld(first);
| private GroupManager groupManager;
private Settings settings;
PerWorldInventoryAPI() {
|
298 | }
public boolean canWorldsShare(String first, String second) {
Group firstGroup = groupManager.getGroupFromWorld(first);
Group otherGroup = groupManager.getGroupFromWorld(second);
if (!firstGroup.isConfigured() || !otherGroup.isConfigured()) {
<BUG>return firstGroup.containsWorld(second) || Settings.getBoolean("share-if-unconfigured");
} else {</BUG>
return firstGroup.containsWorld(second);
}
}
| return firstGroup.containsWorld(second) || settings.getProperty(PwiProperties.SHARE_IF_UNCONFIGURED);
} else {
|
299 | package com.firebase.ui.auth;
<BUG>import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import com.firebase.ui.auth.ui.ActivityHelper;</BUG>
import com.firebase.ui.auth.ui.AppCompatBase;
| import android.content.DialogInterface;
import android.net.ConnectivityManager;
import android.util.Log;
import com.firebase.ui.auth.ui.ActivityHelper;
|
300 | long receiveId = _context.random().nextLong(Packet.MAX_STREAM_ID-1)+1;
boolean reject = false;
int active = 0;
int total = 0;
if (locked_tooManyStreams()) {
<BUG>if (_log.shouldLog(Log.WARN))
_log.warn("Refusing connection since we have exceeded our max of "
</BUG>
+ _maxConcurrentStreams + " connections");
reject = true;
| _log.logAlways(Log.WARN, "Refusing connection since we have exceeded our max of "
|