id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
8,801 | public static double betterRound(double numIn, int decPlac){
double opOn = Math.round(numIn * Math.pow(10, decPlac)) / Math.pow(10D, decPlac);
return opOn;
}
public static double centerCeil(double numIn, int tiers){
<BUG>return ((numIn > 0) ? Math.ceil(numIn * tiers) : Math.floor(numIn * tiers)) / tiers;
</BUG>
}
public static double findEfficiency(double speedIn, double lowerLimit, double upperLimit){
speedIn = Math.abs(speedIn);
| return ((numIn > 0) ? Math.ceil(numIn * (double) tiers) : Math.floor(numIn * (double) tiers)) / (double) tiers;
|
8,802 | package com.Da_Technomancer.crossroads.API;
import com.Da_Technomancer.crossroads.API.DefaultStorageHelper.DefaultStorage;
import com.Da_Technomancer.crossroads.API.heat.DefaultHeatHandler;
import com.Da_Technomancer.crossroads.API.heat.IHeatHandler;
import com.Da_Technomancer.crossroads.API.magic.DefaultMagicHandler;
<BUG>import com.Da_Technomancer.crossroads.API.magic.IMagicHandler;
import com.Da_Technomancer.crossroads.API.rotary.DefaultRotaryHandler;
import com.Da_Technomancer.crossroads.API.rotary.IRotaryHandler;
</BUG>
import net.minecraftforge.common.capabilities.Capability;
| import com.Da_Technomancer.crossroads.API.rotary.DefaultAxleHandler;
import com.Da_Technomancer.crossroads.API.rotary.DefaultCogHandler;
import com.Da_Technomancer.crossroads.API.rotary.IAxleHandler;
import com.Da_Technomancer.crossroads.API.rotary.ICogHandler;
|
8,803 | import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.CapabilityInject;
import net.minecraftforge.common.capabilities.CapabilityManager;
public class Capabilities{
@CapabilityInject(IHeatHandler.class)
<BUG>public static Capability<IHeatHandler> HEAT_HANDLER_CAPABILITY = null;
@CapabilityInject(IRotaryHandler.class)
public static Capability<IRotaryHandler> ROTARY_HANDLER_CAPABILITY = null;
</BUG>
@CapabilityInject(IMagicHandler.class)
| @CapabilityInject(IAxleHandler.class)
public static Capability<IAxleHandler> AXLE_HANDLER_CAPABILITY = null;
@CapabilityInject(ICogHandler.class)
public static Capability<ICogHandler> COG_HANDLER_CAPABILITY = null;
|
8,804 | public IEffect getMixEffect(Color col){
if(col == null){
return effect;
}
int top = Math.max(col.getBlue(), Math.max(col.getRed(), col.getGreen()));
<BUG>if(top < rand.nextInt(128) + 128){
return voidEffect;</BUG>
}
return effect;
}
| if(top != 255){
return voidEffect;
|
8,805 | 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.*;
|
8,806 | .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);
|
8,807 | </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) {
|
8,808 | 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)
|
8,809 | .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))
|
8,810 | .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))
|
8,811 | @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;
|
8,812 | 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;
}
|
8,813 | return configDirectory;
}
public boolean isLoaded() {
return loaded;
}
<BUG>public static Cause getCause() {
return instance().pluginCause;
}</BUG>
public EconomyService getEconomyService() {
return economyService;
| [DELETED] |
8,814 | 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.*;
|
8,815 | .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))
|
8,816 | 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) -> {
|
8,817 | 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);
|
8,818 | 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);
|
8,819 | 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() + "\"");
|
8,820 | 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() + "\"");
|
8,821 | 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
|
8,822 | .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")
|
8,823 | return componentName;
}
public String getRoleName() {
return roleName;
}
<BUG>public ServerStatus getServerStatus() {
</BUG>
return serverStatus;
}
public void setClusterId(String clusterId) {
| public State getServerStatus() {
|
8,824 | import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
<BUG>@XmlType(name = "", propOrder = {"responseId","timestamp", "clusterId",
"hostname", "bluePrintName", "bluePrintRevision", "hardwareProfile",
"actionResults", "serversStatus", "idle"})
public class HeartBeat {</BUG>
@XmlElement
| @XmlType(name = "", propOrder = {"responseId","timestamp",
"hostname", "hardwareProfile", "installedRoleStates",
"actionResults", "idle"})
public class HeartBeat {
|
8,825 | add("cleanUpCommandResults");
add("actionResults");
add("serversStatus");
add("cmd");
add("commands");
<BUG>add("cleanUpCommands");
}</BUG>
};
public AgentJAXBContextResolver() throws Exception {
Map<String, Object> props = new HashMap<String, Object>();
| add("installedRoleStates");
}
|
8,826 | import javax.ws.rs.core.Response;
import org.apache.ambari.common.rest.entities.ClusterDefinition;
import org.apache.ambari.common.rest.entities.ClusterState;
import org.apache.ambari.common.rest.entities.Node;
import org.apache.ambari.common.rest.entities.RoleToNodes;
<BUG>import org.apache.ambari.common.util.ExceptionUtil;
import org.apache.ambari.resource.statemachine.StateMachineInvoker;</BUG>
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class Clusters {
| import org.apache.ambari.resource.statemachine.ClusterFSM;
import org.apache.ambari.resource.statemachine.StateMachineInvoker;
|
8,827 | package org.apache.felix.karaf.admin.internal;
<BUG>import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.util.Properties;</BUG>
import org.apache.felix.karaf.admin.Instance;
| import java.io.*;
import java.net.URL;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
|
8,828 | }
public synchronized void stop() throws Exception {
checkProcess();
if (this.process == null) {
throw new IllegalStateException("Instance not started");
<BUG>}
this.process.destroy();
}</BUG>
public synchronized void destroy() throws Exception {
checkProcess();
| public InstanceImpl(AdminServiceImpl service, String name, String location, boolean root) {
this.service = service;
this.name = name;
this.location = location;
this.root = root;
public void attach(int pid) throws IOException {
|
8,829 | }
}
}
result &= fileToDelete.delete();
return result;
<BUG>}
}
</BUG>
| public int getPid() {
checkProcess();
return this.process != null ? this.process.getPid() : 0;
|
8,830 | package org.primftpd;
<BUG>import java.util.ArrayList;
import java.util.List;</BUG>
import org.apache.ftpserver.ftplet.Authentication;
import org.apache.ftpserver.ftplet.AuthenticationFailedException;
import org.apache.ftpserver.ftplet.Authority;
| import android.os.Environment;
|
8,831 | import org.apache.ftpserver.ftplet.Authentication;
import org.apache.ftpserver.ftplet.AuthenticationFailedException;
import org.apache.ftpserver.ftplet.Authority;
import org.apache.ftpserver.ftplet.FtpException;
import org.apache.ftpserver.ftplet.User;
<BUG>import org.apache.ftpserver.ftplet.UserManager;
import org.apache.ftpserver.usermanager.UsernamePasswordAuthentication;</BUG>
import org.apache.ftpserver.usermanager.impl.BaseUser;
import org.apache.ftpserver.usermanager.impl.ConcurrentLoginPermission;
import org.apache.ftpserver.usermanager.impl.TransferRatePermission;
| import org.apache.ftpserver.usermanager.AnonymousAuthentication;
import org.apache.ftpserver.usermanager.UsernamePasswordAuthentication;
|
8,832 | import org.apache.ftpserver.usermanager.impl.WritePermission;
import org.primftpd.util.EncryptionUtil;
import org.primftpd.util.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
<BUG>import android.os.Environment;
public class AndroidPrefsUserManager implements UserManager {</BUG>
protected final Logger logger = LoggerFactory.getLogger(getClass());
private final PrefsBean prefsBean;
public AndroidPrefsUserManager(PrefsBean prefsBean) {
| import java.util.ArrayList;
import java.util.List;
public class AndroidPrefsUserManager implements UserManager {
|
8,833 | user.setEnabled(true);
String rootDir = Environment.getExternalStorageDirectory().getAbsolutePath();
logger.debug("rootDir: {}", rootDir);
user.setHomeDirectory(rootDir);
user.setMaxIdleTime(60);
<BUG>user.setName(prefsBean.getUserName());
user.setPassword(prefsBean.getPassword());
user.setAuthorities(buildAuthorities());</BUG>
return user;
}
| user.setName(username);
if(password != null) {
user.setAuthorities(buildAuthorities());
|
8,834 | String storedPW = prefsBean.getPassword();
if (storedPW.equals(encryptedPW)) {
return buildUser();
}
}
<BUG>}
}</BUG>
throw new AuthenticationFailedException();
}
@Override
| } else if(authentication instanceof AnonymousAuthentication) {
if(prefsBean.isAnonymousLogin()) {
return anonymousUser();
|
8,835 | if (prefsBean != null) {
intent.putExtra(EXTRA_PREFS_BEAN, prefsBean);
}
}
protected static boolean isPasswordOk(PrefsBean prefsBean) {
<BUG>if (!prefsBean.getServerToStart().isPasswordMandatory()
</BUG>
&& prefsBean.isPubKeyAuth())
{
return true;
| if (prefsBean.isAnonymousLogin() || !prefsBean.getServerToStart().isPasswordMandatory()
|
8,836 | return port;
}
static boolean validatePort(int port) {
return port > 1024 && port <= 64000;
}
<BUG>public static PrefsBean loadPrefs(Logger logger, SharedPreferences prefs) {
String userName = userName(prefs);</BUG>
logger.debug("got userName: {}", userName);
String password = password(prefs);
logger.debug("got password: {}", password);
| boolean anonymousLogin = anonymousLogin(prefs);
logger.debug("got anonymousLogin: {}", Boolean.valueOf(anonymousLogin));
String userName = userName(prefs);
|
8,837 | logger.debug("got 'port': {}", Integer.valueOf(port));
int securePort = loadPortSecure(logger, prefs);
logger.debug("got 'secure port': {}", Integer.valueOf(securePort));
return new PrefsBean(
userName,
<BUG>password,
port,
securePort,
startDir,
announce,
wakelock,
pubKeyAuth,</BUG>
serverToStart);
| anonymousLogin, securePort, startDir, announce, wakelock, pubKeyAuth, port,
|
8,838 | setTheme(theme.resourceId());
setContentView(R.layout.main);
calcPubkeyFingerprints();
showKeyFingerprints();
((TextView)findViewById(R.id.addressesLabel)).setText(
<BUG>getText(R.string.ipAddrLabel) + " (" +
getText(R.string.ifacesLabel) + ")");
((TextView)findViewById(R.id.portsLabel)).setText(
getText(R.string.protocolLabel) + " / " +
getText(R.string.portLabel) + " / " +
getText(R.string.state));
}</BUG>
@Override
| String.format("%s (%s)", getText(R.string.ipAddrLabel), getText(R.string.ifacesLabel) )
String.format("%s / %s / %s", getText(R.string.protocolLabel), getText(R.string.portLabel),
getText(R.string.state))
}
|
8,839 | ifaceDispName,
inetAddr.isLoopbackAddress()});
if (inetAddr.isLoopbackAddress()) {
continue;
}
<BUG>String displayText = hostAddr + " (" + ifaceDispName + ")";
TextView textView = new TextView(container.getContext());</BUG>
container.addView(textView);
textView.setText(displayText);
textView.setGravity(Gravity.CENTER_HORIZONTAL);
| if(displayText.contains("::")) {
logger.debug("Skipping IPv6 address '{}'", displayText);
TextView textView = new TextView(container.getContext());
|
8,840 | } catch (SocketException e) {
logger.info("exception while iterating network interfaces", e);
String msg = getText(R.string.ifacesError) + e.getLocalizedMessage();
Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
}
<BUG>}
protected void showPortsAndServerState() {</BUG>
((TextView)findViewById(R.id.ftpTextView))
.setText("ftp / " + prefsBean.getPortStr() + " / " +
getText(serversRunning.ftp
| @SuppressLint("SetTextI18n")
protected void showPortsAndServerState() {
|
8,841 | import com.intellij.openapi.vcs.FilePath;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vcs.history.VcsFileRevision;
import com.intellij.openapi.vcs.history.VcsRevisionNumber;
import com.intellij.openapi.vfs.VirtualFile;
<BUG>import git4idea.commands.GitBinaryHandler;
import git4idea.commands.GitCommand;</BUG>
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
| import git4idea.commands.GitFileUtils;
|
8,842 | public String getBranchName() {
return branch;
}
public synchronized void loadContent() throws VcsException {
final VirtualFile root = GitUtil.getGitRoot(path);
<BUG>GitBinaryHandler h = new GitBinaryHandler(project, root, GitCommand.SHOW);
h.setNoSSH(true);
h.setSilent(true);
h.addParameters(revision.getRev() + ":" + GitUtil.relativePath(root, path));
content = h.run();
}</BUG>
public synchronized byte[] getContent() throws IOException {
| [DELETED] |
8,843 | import com.intellij.openapi.vcs.changes.ContentRevision;
import com.intellij.openapi.vcs.changes.CurrentContentRevision;
import com.intellij.openapi.vcs.history.VcsRevisionNumber;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.vcsUtil.VcsUtil;
<BUG>import git4idea.commands.GitBinaryHandler;
import git4idea.commands.GitCommand;</BUG>
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
| import git4idea.commands.GitFileUtils;
|
8,844 | @Nullable
public String getContent() throws VcsException {
if (myFile.isDirectory()) {
return null;
}
<BUG>VirtualFile root = GitUtil.getGitRoot(myFile);
GitBinaryHandler h = new GitBinaryHandler(myProject, root, GitCommand.SHOW);
h.setCharset(myCharset);
h.setNoSSH(true);
h.setSilent(true);
h.addParameters(myRevision.getRev() + ":" + GitUtil.relativePath(root, myFile));
byte[] result = h.run();
return new String(result, h.getCharset());</BUG>
}
| byte[] result = GitFileUtils.getFileContent(myProject, root, myRevision.getRev(), GitUtil.relativePath(root, myFile));
return result == null ? null : new String(result, myCharset);
|
8,845 | package git4idea.commands;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vcs.FilePath;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vfs.VirtualFile;
<BUG>import git4idea.GitUtil;
import java.util.ArrayList;</BUG>
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
| import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
|
8,846 | System.out.println(change);
}
}
};
@Override
<BUG>protected Callback<VChild, Void> copyChildCallback()
</BUG>
{
return (child) ->
{
| protected Callback<VChild, Void> copyIntoCallback()
|
8,847 | package jfxtras.labs.icalendarfx.components;
import jfxtras.labs.icalendarfx.properties.component.descriptive.Comment;
<BUG>import jfxtras.labs.icalendarfx.properties.component.misc.IANAProperty;
import jfxtras.labs.icalendarfx.properties.component.misc.UnknownProperty;</BUG>
import jfxtras.labs.icalendarfx.properties.component.recurrence.RecurrenceDates;
import jfxtras.labs.icalendarfx.properties.component.recurrence.RecurrenceRule;
| import jfxtras.labs.icalendarfx.properties.component.misc.NonStandardProperty;
|
8,848 | VEVENT ("VEVENT",
Arrays.asList(PropertyType.ATTACHMENT, PropertyType.ATTENDEE, PropertyType.CATEGORIES,
PropertyType.CLASSIFICATION, PropertyType.COMMENT, PropertyType.CONTACT, PropertyType.DATE_TIME_CREATED,
PropertyType.DATE_TIME_END, PropertyType.DATE_TIME_STAMP, PropertyType.DATE_TIME_START,
PropertyType.DESCRIPTION, PropertyType.DURATION, PropertyType.EXCEPTION_DATE_TIMES,
<BUG>PropertyType.GEOGRAPHIC_POSITION, PropertyType.IANA_PROPERTY, PropertyType.LAST_MODIFIED,
PropertyType.LOCATION, PropertyType.NON_STANDARD, PropertyType.ORGANIZER, PropertyType.PRIORITY,</BUG>
PropertyType.RECURRENCE_DATE_TIMES, PropertyType.RECURRENCE_IDENTIFIER, PropertyType.RELATED_TO,
PropertyType.RECURRENCE_RULE, PropertyType.REQUEST_STATUS, PropertyType.RESOURCES, PropertyType.SEQUENCE,
PropertyType.STATUS, PropertyType.SUMMARY, PropertyType.TIME_TRANSPARENCY, PropertyType.UNIQUE_IDENTIFIER,
| PropertyType.GEOGRAPHIC_POSITION, PropertyType.LAST_MODIFIED,
PropertyType.LOCATION, PropertyType.NON_STANDARD, PropertyType.ORGANIZER, PropertyType.PRIORITY,
|
8,849 | VTODO ("VTODO",
Arrays.asList(PropertyType.ATTACHMENT, PropertyType.ATTENDEE, PropertyType.CATEGORIES,
PropertyType.CLASSIFICATION, PropertyType.COMMENT, PropertyType.CONTACT, PropertyType.DATE_TIME_COMPLETED,
PropertyType.DATE_TIME_CREATED, PropertyType.DATE_TIME_DUE, PropertyType.DATE_TIME_STAMP,
PropertyType.DATE_TIME_START, PropertyType.DESCRIPTION, PropertyType.DURATION,
<BUG>PropertyType.EXCEPTION_DATE_TIMES, PropertyType.GEOGRAPHIC_POSITION, PropertyType.IANA_PROPERTY,
PropertyType.LAST_MODIFIED, PropertyType.LOCATION, PropertyType.NON_STANDARD, PropertyType.ORGANIZER,</BUG>
PropertyType.PERCENT_COMPLETE, PropertyType.PRIORITY, PropertyType.RECURRENCE_DATE_TIMES,
PropertyType.RECURRENCE_IDENTIFIER, PropertyType.RELATED_TO, PropertyType.RECURRENCE_RULE,
PropertyType.REQUEST_STATUS, PropertyType.RESOURCES, PropertyType.SEQUENCE, PropertyType.STATUS,
| PropertyType.EXCEPTION_DATE_TIMES, PropertyType.GEOGRAPHIC_POSITION,
PropertyType.LAST_MODIFIED, PropertyType.LOCATION, PropertyType.NON_STANDARD, PropertyType.ORGANIZER,
|
8,850 | throw new RuntimeException("not implemented");
}
},
DAYLIGHT_SAVING_TIME ("DAYLIGHT",
Arrays.asList(PropertyType.COMMENT, PropertyType.DATE_TIME_START,
<BUG>PropertyType.IANA_PROPERTY, PropertyType.NON_STANDARD, PropertyType.RECURRENCE_DATE_TIMES,
PropertyType.RECURRENCE_RULE, PropertyType.TIME_ZONE_NAME, PropertyType.TIME_ZONE_OFFSET_FROM,</BUG>
PropertyType.TIME_ZONE_OFFSET_TO),
DaylightSavingTime.class)
{
| PropertyType.RECURRENCE_RULE, PropertyType.TIME_ZONE_NAME, PropertyType.TIME_ZONE_OFFSET_FROM,
|
8,851 | throw new RuntimeException("not implemented");
}
},
VALARM ("VALARM",
Arrays.asList(PropertyType.ACTION, PropertyType.ATTACHMENT, PropertyType.ATTENDEE, PropertyType.DESCRIPTION,
<BUG>PropertyType.DURATION, PropertyType.IANA_PROPERTY, PropertyType.NON_STANDARD, PropertyType.REPEAT_COUNT,
PropertyType.SUMMARY, PropertyType.TRIGGER),</BUG>
VAlarm.class)
{
@Override
| DAYLIGHT_SAVING_TIME ("DAYLIGHT",
Arrays.asList(PropertyType.COMMENT, PropertyType.DATE_TIME_START,
PropertyType.NON_STANDARD, PropertyType.RECURRENCE_DATE_TIMES,
PropertyType.RECURRENCE_RULE, PropertyType.TIME_ZONE_NAME, PropertyType.TIME_ZONE_OFFSET_FROM,
PropertyType.TIME_ZONE_OFFSET_TO),
DaylightSavingTime.class)
|
8,852 | private ContentLineStrategy contentLineGenerator;
protected void setContentLineGenerator(ContentLineStrategy contentLineGenerator)
{
this.contentLineGenerator = contentLineGenerator;
}
<BUG>protected Callback<VChild, Void> copyChildCallback()
</BUG>
{
throw new RuntimeException("Can't copy children. copyChildCallback isn't overridden in subclass." + this.getClass());
};
| protected Callback<VChild, Void> copyIntoCallback()
|
8,853 | import jfxtras.labs.icalendarfx.properties.calendar.Version;
import jfxtras.labs.icalendarfx.properties.component.misc.NonStandardProperty;
public enum CalendarProperty
{
CALENDAR_SCALE ("CALSCALE",
<BUG>Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD, ParameterType.IANA_PARAMETER),
CalendarScale.class)</BUG>
{
@Override
public VChild parse(VCalendar vCalendar, String contentLine)
| Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD),
CalendarScale.class)
|
8,854 | CalendarScale calendarScale = (CalendarScale) child;
destination.setCalendarScale(calendarScale);
}
},
METHOD ("METHOD",
<BUG>Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD, ParameterType.IANA_PARAMETER),
Method.class)</BUG>
{
@Override
public VChild parse(VCalendar vCalendar, String contentLine)
| Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD),
Method.class)
|
8,855 | }
list.add(new NonStandardProperty((NonStandardProperty) child));
}
},
PRODUCT_IDENTIFIER ("PRODID",
<BUG>Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD, ParameterType.IANA_PARAMETER),
ProductIdentifier.class)</BUG>
{
@Override
public VChild parse(VCalendar vCalendar, String contentLine)
| public void copyChild(VChild child, VCalendar destination)
CalendarScale calendarScale = (CalendarScale) child;
destination.setCalendarScale(calendarScale);
METHOD ("METHOD",
Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD),
Method.class)
|
8,856 | ProductIdentifier productIdentifier = (ProductIdentifier) child;
destination.setProductIdentifier(productIdentifier);
}
},
VERSION ("VERSION",
<BUG>Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD, ParameterType.IANA_PARAMETER),
Version.class)</BUG>
{
@Override
public VChild parse(VCalendar vCalendar, String contentLine)
| Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD),
Version.class)
|
8,857 | package jfxtras.labs.icalendarfx.components;
import jfxtras.labs.icalendarfx.properties.component.descriptive.Comment;
<BUG>import jfxtras.labs.icalendarfx.properties.component.misc.IANAProperty;
import jfxtras.labs.icalendarfx.properties.component.misc.UnknownProperty;</BUG>
import jfxtras.labs.icalendarfx.properties.component.recurrence.RecurrenceDates;
import jfxtras.labs.icalendarfx.properties.component.recurrence.RecurrenceRule;
| import jfxtras.labs.icalendarfx.properties.component.misc.NonStandardProperty;
|
8,858 | public List<WebElement> resultsContainingString(final String searchTerm) {
return getDriver().findElements(By.xpath("//*[contains(@class,'search-text') and contains(text(),'" + searchTerm + "')]"));
}
public WebElement originalQuery() { return findElement(By.className("original-query")); }
public String correctedQuery() { return findElement(By.className("corrected-query")).getText(); }
<BUG>public boolean hasAutoCorrected() { return !findElements(By.className("original-query")).isEmpty(); }
public void ensureTermNotAutoCorrected() {</BUG>
if(hasAutoCorrected()) {
originalQuery().click();
}
| public boolean hasAutoCorrected() {
final List<WebElement> originalQuery = findElements(By.className("original-query"));
return !originalQuery.isEmpty() && originalQuery.get(0).isDisplayed(); }
public void ensureTermNotAutoCorrected() {
|
8,859 | filter.findElement(By.cssSelector(".filters-remove-icon")).click();
}
public void scrollToBottom() {
findElement(By.className("results-number")).click();
DriverUtil.scrollToBottom(getDriver());
<BUG>waitForResultsToLoad();
}</BUG>
protected WebElement mainContainer() {
return Container.currentTabContents(getDriver());
}
| public boolean resultsMessagePresent() {
return !findElements(By.className("result-message")).isEmpty();
|
8,860 | public String getSummary(){ return getField("Summary");}
public String getDate(){ return getField("Date");}
public String getAuthor() { return getField("Authors");}
private String getField(final String name) {
try {
<BUG>return findElement(By.xpath(".//td[contains(text(), '" + name + "')]/following::td")).getText();
</BUG>
} catch (final NoSuchElementException e) {
return null;
}
| return findElement(By.xpath(".//th[contains(text(), '" + name + "')]/following::td")).getText();
|
8,861 | final List<String> nonLatinQueries = Arrays.asList("人", "אדום", "ทำ", "Россия", "بيض", "中国");
final String weightOfHighlightedTerm = "900";
boolean foundResults = false;
for (String query : nonLatinQueries) {
if(!foundResults) {
<BUG>search(query);
if (findPage.totalResultsNum() > 0) {</BUG>
foundResults = true;
final WebElement incidenceOfTerm = findPage.resultsContainingString(query).get(0);
assertThat("Term \"" + query + "\" is highlighted (bold).",
| findPage.ensureTermNotAutoCorrected();
findPage.waitForParametricValuesToLoad();
if (findPage.totalResultsNum() > 0) {
|
8,862 | package com.autonomy.abc.find;
import com.autonomy.abc.base.FindTestBase;
import com.autonomy.abc.selenium.element.DocumentViewer;
import com.autonomy.abc.selenium.find.FindPage;
import com.autonomy.abc.selenium.find.FindService;
<BUG>import com.autonomy.abc.selenium.find.IdolFindPage;
import com.autonomy.abc.selenium.find.preview.DetailedPreviewPage;</BUG>
import com.autonomy.abc.selenium.find.preview.InlinePreview;
import com.autonomy.abc.selenium.find.results.FindResult;
import com.autonomy.abc.selenium.find.results.ResultsView;
| import com.autonomy.abc.selenium.find.application.FindElementFactory;
import com.autonomy.abc.selenium.find.preview.DetailedPreviewPage;
|
8,863 | verifyThat("no backend error", frame.content().findElements(errorHeader), empty());
verifyThat("no view server error", frame.content().findElements(errorBody), empty());
frame.deactivate();
}
@Test
<BUG>public void testBetween30And60Results(){
ResultsView results = findService.search(new Query("connectors"));
findPage.filterBy(new IndexFilter("Site Search"));
findPage.scrollToBottom();
verifyThat(results.resultsDiv(), containsText("No more results found"));</BUG>
}
| [DELETED] |
8,864 | conceptsPanel.removableConceptForHeader(secondConcept).removeAndWait();
final List<String> moreConcepts = conceptsPanel.selectedConceptHeaders();
verifyThat(moreConcepts, hasSize(1));
verifyThat(moreConcepts, not(hasItem(equalToIgnoringCase('"' + secondConcept + '"'))));
verifyThat(moreConcepts, hasItem(equalToIgnoringCase('"' + firstConcept + '"')));
<BUG>verifyThat(navBar.getSearchBoxTerm(), is("jungle"));
</BUG>
}
@Test
@ResolvedBug({"CCUK-3566", "FIND-109"})
| verifyThat(navBar.getSearchBoxTerm(), is(queryTerm));
|
8,865 | @ResolvedBug("CCUK-3641")
@RelatedTo("FIND-487")
@ActiveBug("FIND-499")
public void testAuthor(){
final String author = "FIFA.COM";
<BUG>ResultsView results = findService.search(new Query("football")
.withFilter(new IndexFilter("fifa"))
.withFilter(new ParametricFilter("Author", author)));
</BUG>
assertThat(results.resultsDiv(), not(containsText(Errors.Find.GENERAL)));
| ResultsView results = findService.search(new Query("football"));
filters().indexesTreeContainer().expand();
findPage.filterBy(new IndexFilter("fifa"));
findPage.filterBy(new ParametricFilter("Author", author));
|
8,866 | package com.liferay.portlet.layoutsadmin.action;
import com.liferay.portal.ImageTypeException;
import com.liferay.portal.NoSuchLayoutException;
import com.liferay.portal.kernel.json.JSONFactoryUtil;
<BUG>import com.liferay.portal.kernel.json.JSONObject;
import com.liferay.portal.kernel.servlet.SessionErrors;
import com.liferay.portal.kernel.upload.UploadException;</BUG>
import com.liferay.portal.kernel.util.Constants;
import com.liferay.portal.kernel.util.ParamUtil;
| import com.liferay.portal.kernel.repository.model.FileEntry;
import com.liferay.portal.kernel.servlet.SessionMessages;
import com.liferay.portal.kernel.upload.UploadException;
|
8,867 | import com.liferay.portal.ImageTypeException;
import com.liferay.portal.NoSuchUserException;
import com.liferay.portal.UserPortraitSizeException;
import com.liferay.portal.UserPortraitTypeException;
import com.liferay.portal.kernel.json.JSONFactoryUtil;
<BUG>import com.liferay.portal.kernel.json.JSONObject;
import com.liferay.portal.kernel.servlet.SessionErrors;
import com.liferay.portal.kernel.upload.UploadException;</BUG>
import com.liferay.portal.kernel.util.Constants;
import com.liferay.portal.kernel.util.ParamUtil;
| import com.liferay.portal.kernel.repository.model.FileEntry;
import com.liferay.portal.kernel.servlet.SessionMessages;
import com.liferay.portal.kernel.upload.UploadException;
|
8,868 | String cmd = ParamUtil.getString(actionRequest, Constants.CMD);
if (cmd.equals(Constants.ADD_TEMP)) {
addTempImageFile(actionRequest);
}
else {
<BUG>saveTempImageFile(actionRequest);
sendRedirect(actionRequest, actionResponse);</BUG>
}
}
| FileEntry fileEntry = saveTempImageFile(actionRequest);
SessionMessages.add(actionRequest, "imageUploaded", fileEntry);
sendRedirect(actionRequest, actionResponse);
|
8,869 | String cmd = ParamUtil.getString(actionRequest, Constants.CMD);
if (cmd.equals(Constants.ADD_TEMP)) {
addTempImageFile(actionRequest);
}
else {
<BUG>saveTempImageFile(actionRequest);
sendRedirect(actionRequest, actionResponse);</BUG>
}
}
| FileEntry fileEntry = saveTempImageFile(actionRequest);
SessionMessages.add(actionRequest, "imageUploaded", fileEntry);
sendRedirect(actionRequest, actionResponse);
|
8,870 | import com.liferay.portal.util.PortalUtil;
import com.liferay.portal.util.WebKeys;
import com.liferay.portlet.documentlibrary.FileSizeException;
import com.liferay.portlet.documentlibrary.NoSuchFileEntryException;
import com.liferay.portlet.documentlibrary.NoSuchFileException;
<BUG>import java.awt.image.RenderedImage;
import java.io.InputStream;</BUG>
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.MimeResponse;
| import java.io.File;
import java.io.InputStream;
|
8,871 | String cmd = ParamUtil.getString(actionRequest, Constants.CMD);
if (cmd.equals(Constants.ADD_TEMP)) {
addTempImageFile(actionRequest);
}
else {
<BUG>saveTempImageFile(actionRequest);
sendRedirect(actionRequest, actionResponse);</BUG>
}
}
| FileEntry fileEntry = saveTempImageFile(actionRequest);
SessionMessages.add(actionRequest, "imageUploaded", fileEntry);
sendRedirect(actionRequest, actionResponse);
|
8,872 | PortletRequest portletRequest);
protected String getTempImageFolderName() {
Class<?> clazz = getClass();
return clazz.getName();
}
<BUG>protected void saveTempImageFile(ActionRequest actionRequest)
</BUG>
throws Exception {
FileEntry tempFileEntry = null;
InputStream tempImageStream = null;
| protected FileEntry saveTempImageFile(ActionRequest actionRequest)
|
8,873 | timeWarp = new OwnLabel(getFormattedTimeWrap(), skin, "warp");
timeWarp.setName("time warp");
Container wrapWrapper = new Container(timeWarp);
wrapWrapper.width(60f * GlobalConf.SCALE_FACTOR);
wrapWrapper.align(Align.center);
<BUG>VerticalGroup timeGroup = new VerticalGroup().align(Align.left).space(3 * GlobalConf.SCALE_FACTOR).padTop(3 * GlobalConf.SCALE_FACTOR);
</BUG>
HorizontalGroup dateGroup = new HorizontalGroup();
dateGroup.space(4 * GlobalConf.SCALE_FACTOR);
dateGroup.addActor(date);
| VerticalGroup timeGroup = new VerticalGroup().align(Align.left).columnAlign(Align.left).space(3 * GlobalConf.SCALE_FACTOR).padTop(3 * GlobalConf.SCALE_FACTOR);
|
8,874 | focusListScrollPane.setFadeScrollBars(false);
focusListScrollPane.setScrollingDisabled(true, false);
focusListScrollPane.setHeight(tree ? 200 * GlobalConf.SCALE_FACTOR : 100 * GlobalConf.SCALE_FACTOR);
focusListScrollPane.setWidth(160);
}
<BUG>VerticalGroup objectsGroup = new VerticalGroup().align(Align.left).space(3 * GlobalConf.SCALE_FACTOR);
</BUG>
objectsGroup.addActor(searchBox);
if (focusListScrollPane != null) {
objectsGroup.addActor(focusListScrollPane);
| VerticalGroup objectsGroup = new VerticalGroup().align(Align.left).columnAlign(Align.left).space(3 * GlobalConf.SCALE_FACTOR);
|
8,875 | headerGroup.addActor(expandIcon);
headerGroup.addActor(detachIcon);
addActor(headerGroup);
expandIcon.setChecked(expanded);
}
<BUG>public void expand() {
</BUG>
if (!expandIcon.isChecked()) {
expandIcon.setChecked(true);
}
| public void expandPane() {
|
8,876 | </BUG>
if (!expandIcon.isChecked()) {
expandIcon.setChecked(true);
}
}
<BUG>public void collapse() {
</BUG>
if (expandIcon.isChecked()) {
expandIcon.setChecked(false);
}
| headerGroup.addActor(expandIcon);
headerGroup.addActor(detachIcon);
addActor(headerGroup);
expandIcon.setChecked(expanded);
public void expandPane() {
public void collapsePane() {
|
8,877 | });
playstop.addListener(new TextTooltip(txt("gui.tooltip.playstop"), skin));
TimeComponent timeComponent = new TimeComponent(skin, ui);
timeComponent.initialize();
CollapsiblePane time = new CollapsiblePane(ui, txt("gui.time"), timeComponent.getActor(), skin, true, playstop);
<BUG>time.align(Align.left);
mainActors.add(time);</BUG>
panes.put(timeComponent.getClass().getSimpleName(), time);
if (Constants.desktop) {
recCamera = new OwnImageButton(skin, "rec");
| time.align(Align.left).columnAlign(Align.left);
mainActors.add(time);
|
8,878 | panes.put(visualEffectsComponent.getClass().getSimpleName(), visualEffects);
ObjectsComponent objectsComponent = new ObjectsComponent(skin, ui);
objectsComponent.setSceneGraph(sg);
objectsComponent.initialize();
CollapsiblePane objects = new CollapsiblePane(ui, txt("gui.objects"), objectsComponent.getActor(), skin, false);
<BUG>objects.align(Align.left);
mainActors.add(objects);</BUG>
panes.put(objectsComponent.getClass().getSimpleName(), objects);
GaiaComponent gaiaComponent = new GaiaComponent(skin, ui);
gaiaComponent.initialize();
| objects.align(Align.left).columnAlign(Align.left);
mainActors.add(objects);
|
8,879 | if (Constants.desktop) {
MusicComponent musicComponent = new MusicComponent(skin, ui);
musicComponent.initialize();
Actor[] musicActors = MusicActorsManager.getMusicActors() != null ? MusicActorsManager.getMusicActors().getActors(skin) : null;
CollapsiblePane music = new CollapsiblePane(ui, txt("gui.music"), musicComponent.getActor(), skin, true, musicActors);
<BUG>music.align(Align.left);
mainActors.add(music);</BUG>
panes.put(musicComponent.getClass().getSimpleName(), music);
}
Button switchWebgl = new OwnTextButton(txt("gui.webgl.back"), skin, "link");
| music.align(Align.left).columnAlign(Align.left);
mainActors.add(music);
|
8,880 | 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;
|
8,881 | 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;
|
8,882 | 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"),
|
8,883 | 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] |
8,884 | 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) {
|
8,885 | 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;
|
8,886 | package com.projecttango.examples.java.augmentedreality;
import com.google.atap.tangoservice.Tango;
import com.google.atap.tangoservice.Tango.OnTangoUpdateListener;
import com.google.atap.tangoservice.TangoCameraIntrinsics;
import com.google.atap.tangoservice.TangoConfig;
<BUG>import com.google.atap.tangoservice.TangoCoordinateFramePair;
import com.google.atap.tangoservice.TangoEvent;</BUG>
import com.google.atap.tangoservice.TangoOutOfDateException;
import com.google.atap.tangoservice.TangoPoseData;
import com.google.atap.tangoservice.TangoXyzIjData;
| import com.google.atap.tangoservice.TangoErrorException;
import com.google.atap.tangoservice.TangoEvent;
|
8,887 | super.onResume();
if (!mIsConnected) {
mTango = new Tango(AugmentedRealityActivity.this, new Runnable() {
@Override
public void run() {
<BUG>try {
connectTango();</BUG>
setupRenderer();
mIsConnected = true;
} catch (TangoOutOfDateException e) {
| TangoSupport.initialize();
connectTango();
|
8,888 | if (lastFramePose.statusCode == TangoPoseData.POSE_VALID) {
mRenderer.updateRenderCameraPose(lastFramePose, mExtrinsics);
mCameraPoseTimestamp = lastFramePose.timestamp;</BUG>
} else {
<BUG>Log.w(TAG, "Can't get device pose at time: " + mRgbTimestampGlThread);
}</BUG>
}
}
}
@Override
| mRenderer.updateRenderCameraPose(lastFramePose);
mCameraPoseTimestamp = lastFramePose.timestamp;
Log.w(TAG, "Can't get device pose at time: " +
|
8,889 | import org.rajawali3d.materials.Material;
import org.rajawali3d.materials.methods.DiffuseMethod;
import org.rajawali3d.materials.textures.ATexture;
import org.rajawali3d.materials.textures.StreamingTexture;
import org.rajawali3d.materials.textures.Texture;
<BUG>import org.rajawali3d.math.Matrix4;
import org.rajawali3d.math.vector.Vector3;</BUG>
import org.rajawali3d.primitives.ScreenQuad;
import org.rajawali3d.primitives.Sphere;
import org.rajawali3d.renderer.RajawaliRenderer;
| import org.rajawali3d.math.Quaternion;
import org.rajawali3d.math.vector.Vector3;
|
8,890 | translationMoon.setRepeatMode(Animation.RepeatMode.INFINITE);
translationMoon.setTransformable3D(moon);
getCurrentScene().registerAnimation(translationMoon);
translationMoon.play();
}
<BUG>public void updateRenderCameraPose(TangoPoseData devicePose, DeviceExtrinsics extrinsics) {
Pose cameraPose = ScenePoseCalculator.toOpenGlCameraPose(devicePose, extrinsics);
getCurrentCamera().setRotation(cameraPose.getOrientation());
getCurrentCamera().setPosition(cameraPose.getPosition());
}</BUG>
public int getTextureId() {
| public void updateRenderCameraPose(TangoPoseData cameraPose) {
float[] rotation = cameraPose.getRotationAsFloats();
float[] translation = cameraPose.getTranslationAsFloats();
Quaternion quaternion = new Quaternion(rotation[3], rotation[0], rotation[1], rotation[2]);
getCurrentCamera().setRotation(quaternion.conjugate());
getCurrentCamera().setPosition(translation[0], translation[1], translation[2]);
|
8,891 | package com.projecttango.examples.java.helloareadescription;
import com.google.atap.tangoservice.Tango;
<BUG>import com.google.atap.tangoservice.Tango.OnTangoUpdateListener;
import com.google.atap.tangoservice.TangoConfig;</BUG>
import com.google.atap.tangoservice.TangoCoordinateFramePair;
import com.google.atap.tangoservice.TangoErrorException;
import com.google.atap.tangoservice.TangoEvent;
| import com.google.atap.tangoservice.TangoAreaDescriptionMetaData;
import com.google.atap.tangoservice.TangoConfig;
|
8,892 | e.printStackTrace();
}
filePlayback=null;
}
@Override
<BUG>public void stop() { if ( filePlayback!=null ) filePlayback.stop(); }
void initFiles() throws FileNotFoundException {</BUG>
if ((dataDir.length() != 0) && !dataDir.endsWith("/")) { dataDir = dataDir + "/"; } // guard path if needed
String samples_str = dataDir + "samples";
String events_str = dataDir + "events";
| @Override public boolean isrunning(){ if ( filePlayback!=null ) return filePlayback.isrunning(); return false; }
void initFiles() throws FileNotFoundException {
|
8,893 | public class BufferMonitor extends Thread implements FieldtripBufferMonitor {
public static final String TAG = BufferMonitor.class.toString();
private final Context context;
private final SparseArray<BufferConnectionInfo> clients = new SparseArray<BufferConnectionInfo>();
private final BufferInfo info;
<BUG>private final BroadcastReceiver mMessageReceiver = new BroadcastReceiver() {
@Override
public void onReceive(final Context context, final Intent intent) {
if (intent.getIntExtra(C.MESSAGE_TYPE, -1) == C.UPDATE_REQUEST) {
Log.i(TAG, "Received update request.");
sendAllInfo();
}
}
};</BUG>
private boolean run = true;
| [DELETED] |
8,894 | public static final String CLIENT_INFO_TIME = "c_time";
public static final String CLIENT_INFO_WAITTIMEOUT = "c_waitTimeout";
public static final String CLIENT_INFO_CONNECTED = "c_connected";
public static final String CLIENT_INFO_CHANGED = "c_changed";
public static final String CLIENT_INFO_DIFF = "c_diff";
<BUG>public static final int UPDATE_REQUEST = 0;
</BUG>
public static final int UPDATE = 1;
public static final int REQUEST_PUT_HEADER = 2;
public static final int REQUEST_FLUSH_HEADER = 3;
| public static final int THREAD_INFO_TYPE = 0;
|
8,895 | package nl.dcc.buffer_bci.bufferclientsservice;
import android.os.Parcel;
import android.os.Parcelable;
<BUG>import nl.dcc.buffer_bci.bufferservicecontroller.C;
public class ThreadInfo implements Parcelable {</BUG>
public static final Creator<ThreadInfo> CREATOR = new Creator<ThreadInfo>() {
@Override
public ThreadInfo createFromParcel(final Parcel in) {
| import nl.dcc.buffer_bci.C;
public class ThreadInfo implements Parcelable {
|
8,896 | return size()+offset;
}
public PlaLineInt[] to_array()
{
return a_list.toArray(new PlaLineInt[size()]);
<BUG>}
@Override</BUG>
public Iterator<PlaLineInt> iterator()
{
return a_list.iterator();
| public ArrayList<PlaLineInt>to_alist()
return a_list;
@Override
|
8,897 | while (Math.abs(prev_dist) < c_epsilon)
{
++corners_skipped_before;
int curr_no = p_start_no - corners_skipped_before;
if (curr_no < 0) return null;
<BUG>prev_corner = p_line_arr[curr_no].intersection_approx(p_line_arr[curr_no + 1]);
</BUG>
prev_dist = translate_line.distance_signed(prev_corner);
}
double next_dist = translate_line.distance_signed(next_corner);
| prev_corner = p_line_arr.get(curr_no).intersection_approx(p_line_arr.get(curr_no + 1));
|
8,898 | </BUG>
{
return null;
}
<BUG>next_corner = p_line_arr[curr_no].intersection_approx(p_line_arr[curr_no + 1]);
</BUG>
next_dist = translate_line.distance_signed(next_corner);
}
if (Signum.of(prev_dist) != Signum.of(next_dist))
{
| double next_dist = translate_line.distance_signed(next_corner);
while (Math.abs(next_dist) < c_epsilon)
++corners_skipped_after;
int curr_no = p_start_no + 3 + corners_skipped_after;
if (curr_no >= p_line_arr.size() - 2)
next_corner = p_line_arr.get(curr_no).intersection_approx(p_line_arr.get(curr_no + 1));
|
8,899 | check_ok = r_board.check_trace(shape_to_check, curr_layer, curr_net_no_arr, curr_cl_type, contact_pins);
}
delta_dist /= 2;
if (check_ok)
{
<BUG>result = curr_lines[p_start_no + 2];
</BUG>
if (translate_dist == max_translate_dist) break;
translate_dist += delta_dist;
}
| result = curr_lines.get(p_start_no + 2);
|
8,900 | translate_dist -= shorten_value;
delta_dist -= shorten_value;
}
}
if (result == null) return null;
<BUG>PlaPointFloat new_prev_corner = curr_lines[p_start_no].intersection_approx(curr_lines[p_start_no + 1]);
PlaPointFloat new_next_corner = curr_lines[p_start_no + 3].intersection_approx(curr_lines[p_start_no + 4]);
</BUG>
r_board.changed_area.join(new_prev_corner, curr_layer);
| PlaPointFloat new_prev_corner = curr_lines.get(p_start_no).intersection_approx(curr_lines.get(p_start_no + 1));
PlaPointFloat new_next_corner = curr_lines.get(p_start_no + 3).intersection_approx(curr_lines.get(p_start_no + 4));
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.