id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
5,801 | </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) {
|
5,802 | 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)
|
5,803 | .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))
|
5,804 | .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))
|
5,805 | @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;
|
5,806 | 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;
}
|
5,807 | return configDirectory;
}
public boolean isLoaded() {
return loaded;
}
<BUG>public static Cause getCause() {
return instance().pluginCause;
}</BUG>
public EconomyService getEconomyService() {
return economyService;
| [DELETED] |
5,808 | 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.*;
|
5,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 > 0) {
| return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
5,810 | 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) -> {
|
5,811 | 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);
|
5,812 | 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);
|
5,813 | 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() + "\"");
|
5,814 | 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() + "\"");
|
5,815 | 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
|
5,816 | .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")
|
5,817 | private static final Logger l4j = Logger.getLogger(CuaFilesystemDestination.class);
private static final String CLIP_NAME = "Storigen_File_Gateway";
private static final String ATTRIBUTE_TAG_NAME = "Storigen_File_Gateway_File_Attributes";
private static final String BLOB_TAG_NAME = "Storigen_File_Gateway_Blob";
private static final String PATH_ATTRIBUTE = "Storigen_File_Gateway_File_Path0";
<BUG>private static final String UID_ATTRIBUTE = "Storigen_File_Gateway_File_Owner";
private static final String GID_ATTRIBUTE = "Storigen_File_Gateway_File_Group";</BUG>
private static final String ITIME_ATTRIBUTE = "Storigen_File_Gateway_File_CTime"; // Windows ctime means create time
private static final String MTIME_ATTRIBUTE = "Storigen_File_Gateway_File_MTime";
private static final String ATIME_ATTRIBUTE = "Storigen_File_Gateway_File_ATime";
| [DELETED] |
5,818 | if (!(obj instanceof ClipSyncObject))
throw new UnsupportedOperationException("sync object was not a CAS clip");
final ClipSyncObject clipSync = (ClipSyncObject) obj;
try {
FPClip sourceClip = clipSync.getClip();
<BUG>if (!sourceClip.getName().equals(CLIP_NAME))
throw new RuntimeException(String.format("skipped clip %s (clip name did not match)", clipSync.getClipId()));
ClipTag blobTag = null;</BUG>
String filePath = null;
| if (!sourceClip.getName().equals(CLIP_NAME)) {
LogMF.debug(l4j, "skipped clip {0} (clip name did not match)", clipSync.getClipId());
} else {
ClipTag blobTag = null;
|
5,819 | package com.example.mapdemo;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
<BUG>import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Polygon;</BUG>
import com.google.android.gms.maps.model.PolygonOptions;
import android.graphics.Color;
| import com.google.android.gms.maps.model.Dash;
import com.google.android.gms.maps.model.Dot;
import com.google.android.gms.maps.model.Gap;
import com.google.android.gms.maps.model.JointType;
import com.google.android.gms.maps.model.PatternItem;
import com.google.android.gms.maps.model.Polygon;
|
5,820 | 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;
|
5,821 | 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;
|
5,822 | 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"),
|
5,823 | 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] |
5,824 | 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) {
|
5,825 | 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;
|
5,826 | import org.exoplatform.calendar.util.Constants;
import org.exoplatform.services.jcr.util.IdGenerator;
import org.exoplatform.services.organization.OrganizationService;
public class Calendar extends AbstractModel {
private static final long serialVersionUID = 2638692203625602436L;
<BUG>public enum Type implements CalendarType {
PERSONAL(0),</BUG>
SHARED(1),
GROUP(2),
UNDEFINED(-1);
| public enum Type {
PERSONAL(0),
|
5,827 | private boolean hasChildren = false;
public static final String CALENDAR_PREF = "calendar";
public Calendar() {
this(CALENDAR_PREF + IdGenerator.generate());
}
<BUG>public Calendar(String compositeId) {
this(compositeId, null);
}
public Calendar(String id, CalendarType type) {
super(id);</BUG>
timeZone = TimeZone.getDefault().getID();
| super(compositeId);
|
5,828 | }
public Calendar(String id, CalendarType type) {
super(id);</BUG>
timeZone = TimeZone.getDefault().getID();
locale = Locale.getDefault().getISO3Country();
<BUG>if (type != null) {
setCalendarType(type);
}</BUG>
}
public String getName() {
| public Calendar(String compositeId) {
super(compositeId);
|
5,829 | return hasChildren;
}
public void setHasChildren(boolean children) {
this.hasChildren = children;
}
<BUG>public void setCalendarType(CalendarType type) {
this.calendarType = type;
}
public CalendarType getCalendarType() {
return calendarType;
}</BUG>
public boolean canEdit(String username) {
| [DELETED] |
5,830 | package org.exoplatform.calendar.storage;
<BUG>import org.exoplatform.calendar.service.CalendarType;</BUG>
public interface Storage {
public String getId();
public CalendarDAO getCalendarDAO();
public EventDAO getEventDAO();
}
| [DELETED] |
5,831 | public Calendar remove(String id) {
Calendar calendar = getById(id);
if (calendar == null) {
return null;
}
<BUG>if (calendar.getCalendarType() == Calendar.Type.PERSONAL) {
</BUG>
try {
dataStorage.removeUserCalendar(calendar.getCalendarOwner(), id);
} catch (Exception ex) {
| if (calendar.getCalType() == Calendar.Type.PERSONAL.type()) {
|
5,832 | try {
dataStorage.removeUserCalendar(calendar.getCalendarOwner(), id);
} catch (Exception ex) {
LOG.error(ex);
}
<BUG>} else if (calendar.getCalendarType() == Calendar.Type.GROUP) {
</BUG>
try {
dataStorage.removeGroupCalendar(id);
} catch (Exception ex) {
| } else if (calendar.getCalType() == Calendar.Type.GROUP.type()) {
|
5,833 |
if (type == Calendar.Type.PERSONAL) {
</BUG>
dataStorage.removeUserEvent(cal.getCalendarOwner(), cal.getId(), id);
<BUG>} else if (type == Calendar.Type.GROUP) {
</BUG>
dataStorage.removePublicEvent(cal.getId(), id);
} else {
return null;
}
| Event event = this.getById(id);
if (event == null) {
Calendar cal = context.getCalendarDAO().getById(event.getCalendarId());
int type = cal.getCalType();
if (type == Calendar.Type.PERSONAL.type()) {
} else if (type == Calendar.Type.GROUP.type()) {
|
5,834 | @Test
public void testStepLoadedFromProjectClassesFolder() throws ClassNotFoundException
{
MuseProject project = ProjectFactory.create(new File("src/test/other_resources/projects/classpath"), Collections.emptyMap());
project.open();
<BUG>MuseTest test = project.findResource("TestUsesCustomJavaStep", MuseTest.class);
</BUG>
Assert.assertNotNull(test);
MuseTestResult result = TestRunnerFactory.runTest(project, test);
Assert.assertTrue(result.isPass());
| MuseTest test = project.getResource(project.findResource("TestUsesCustomJavaStep", MuseTest.class));
|
5,835 | @Test
public void testStepLoadedFromProjectJar() throws ClassNotFoundException
{
MuseProject project = ProjectFactory.create(new File("src/test/other_resources/projects/classpath"), Collections.emptyMap());
project.open();
<BUG>MuseTest test = project.findResource("TestUsesCustomJavaStepFromJar", MuseTest.class);
</BUG>
Assert.assertNotNull(test);
MuseTestResult result = TestRunnerFactory.runTest(project, test);
Assert.assertTrue(result.isPass());
| public void testStepLoadedFromProjectClassesFolder() throws ClassNotFoundException
MuseTest test = project.getResource(project.findResource("TestUsesCustomJavaStep", MuseTest.class));
|
5,836 | public List<TestConfiguration> generateTestList(MuseProject project)
{
List<TestConfiguration> tests = new ArrayList<>(_test_ids.size());
for (String id : _test_ids)
{
<BUG>MuseTest test = project.findResource(id, MuseTest.class);
</BUG>
if (test == null)
{
LOG.error("Test with id {} was not found in the project", id);
| MuseTest test = project.getResource(project.findResource(id, MuseTest.class));
|
5,837 | }
@Override
public MuseResource resolveValue(MuseExecutionContext context) throws ValueSourceResolutionError
{
String id = getValue(_id_source, context, false, String.class);
<BUG>MuseResource resource = _project.findResource(id, MuseResource.class);
</BUG>
if (resource == null)
throw new ValueSourceResolutionError(String.format("Unable to resolve the project resource (id=%s). Search returned null.", id));
return resource;
| MuseResource resource = _project.getResource(_project.findResource(id, MuseResource.class));
|
5,838 | Object id_obj = _id.resolveValue(context);
if (id_obj == null)
throw new StepExecutionError("id source resolved to null");
else if (!(id_obj instanceof String))
LOG.warn("id source did not resolve to a string. using toString() = " + id_obj.toString());
<BUG>ContainsStep resource = _project.findResource(id_obj.toString(), ContainsStep.class);
</BUG>
if (resource == null)
throw new StepExecutionError("unable to locate id " + id_obj.toString());
StepConfiguration step = resource.getStep();
| ContainsStep resource = _project.getResource(_project.findResource(id_obj.toString(), ContainsStep.class));
|
5,839 | public class ParameterListTestSuite implements MuseTestSuite
{
@Override
public List<TestConfiguration> generateTestList(MuseProject project)
{
<BUG>MuseTest test = project.findResource(_testid, MuseTest.class);
</BUG>
if (test == null)
test = new MissingTest(_testid);
List<TestConfiguration> tests = new ArrayList<>();
| MuseTest test = project.getResource(project.findResource(_testid, MuseTest.class));
|
5,840 | public String report_path;
@Override
public void run()
{
MuseProject project = openProject();
<BUG>MuseResource resource = project.findResource(resource_id, MuseResource.class);
</BUG>
String id = resource_id;
while (resource == null && id.contains("."))
{
| MuseResource resource = project.getResource(project.findResource(resource_id, MuseResource.class));
|
5,841 | </BUG>
String id = resource_id;
while (resource == null && id.contains("."))
{
id = id.substring(0, id.lastIndexOf("."));
<BUG>resource = project.findResource(id, MuseResource.class);
</BUG>
}
if (resource == null)
{
| public String report_path;
@Override
public void run()
MuseProject project = openProject();
MuseResource resource = project.getResource(project.findResource(resource_id, MuseResource.class));
resource = project.getResource(project.findResource(id, MuseResource.class));
|
5,842 | Object attribute = matcher.getAttribute(name);
if (attribute != null && !attribute.equals(resource.getMetadata().getAttribute(name)))
match = false;
}
if (match)
<BUG>resources.add(resource);
}</BUG>
return resources;
}
public void loadResource(ResourceOrigin origin)
| resources.add(new InMemoryResourceToken(resource));
|
5,843 | import org.musetest.core.util.*;
import java.util.*;
public interface ResourceStore
{
void addResource(MuseResource resource);
<BUG>List<MuseResource> findResources(ResourceMetadata matcher);
ClassLoader getContextClassloader();</BUG>
ClassLocator getClassLocator();
String saveResource(MuseResource resource);
| List<ResourceToken> findResources(ResourceMetadata matcher);
<T extends MuseResource> T getResource(ResourceToken<T> token);
<T extends MuseResource> List<T> getResources(List<ResourceToken<T>> tokens);
List<MuseResource> getUntypedResources(List<ResourceToken> tokens);
ClassLoader getContextClassloader();
|
5,844 | @Override
public MuseStep createStep(StepConfiguration configuration, MuseProject project) throws MuseInstantiationException
{
if (project == null)
return null;
<BUG>JavascriptStepResource builder = project.findResource(configuration.getType(), JavascriptStepResource.class);
</BUG>
if (builder == null)
return null;
return builder.createStep(configuration);
| JavascriptStepResource builder = project.getResource(project.findResource(configuration.getType(), JavascriptStepResource.class));
|
5,845 | import org.musetest.core.values.descriptor.*;
import java.util.*;
public interface MuseProject
{
void addResource(MuseResource resource);
<BUG>List<MuseResource> findResources(ResourceMetadata filter);
<T extends MuseResource> List<T> findResources(ResourceMetadata filter, Class T);
MuseResource findResource(ResourceMetadata filter);
<T> T findResource(String id, Class<T> interface_class);
String saveResource(MuseResource resource);</BUG>
void open();
| List<ResourceToken> findResources(ResourceMetadata filter);
<T extends MuseResource> List<ResourceToken<T>> findResources(ResourceMetadata filter, Class<T> interface_class);
ResourceToken findResource(ResourceMetadata filter);
<T extends MuseResource> ResourceToken<T> findResource(String id, Class<T> interface_class);
<T extends MuseResource> T getResource(ResourceToken<T> token);
<T extends MuseResource> List<T> getResources(List<ResourceToken<T>> token);
List<MuseResource> getUntypedResources(List<ResourceToken> tokens);
String saveResource(MuseResource resource);
|
5,846 | StepDescriptor descriptor = loadByClass(step_class);
_descriptors_by_class.put(step_class, descriptor);
_descriptors_by_type.put(descriptor.getType(), descriptor);
_all_descriptors.add(descriptor);
}
<BUG>List<MuseResource> scripted_steps = _project.findResources(new ResourceMetadata(ResourceTypes.jsStep));
for (MuseResource step : scripted_steps)</BUG>
{
JavascriptStepResource step_resource = (JavascriptStepResource) step;
| List<ResourceToken> tokens = _project.findResources(new ResourceMetadata(ResourceTypes.jsStep));
List<MuseResource> scripted_steps = _project.getUntypedResources(tokens);
for (MuseResource step : scripted_steps)
|
5,847 | public class VariableListsInitializer implements ContextInitializer
{
@Override
public void initialize(MuseProject project, MuseExecutionContext context) throws MuseExecutionError
{
<BUG>List<VariableList> lists = project.findResources(new ResourceMetadata(new VariableList.VariableListType()), VariableList.class);
lists = filterLists(lists, project, context);</BUG>
for (VariableList list : lists)
{
| List<ResourceToken<VariableList>> tokens = project.findResources(new ResourceMetadata(new VariableList.VariableListType()), VariableList.class);
List<VariableList> lists = project.getResources(tokens);
lists = filterLists(lists, project, context);
|
5,848 | }
}
}
private List<VariableList> filterLists(List<VariableList> lists, MuseProject project, MuseExecutionContext context) throws MuseInstantiationException, ValueSourceResolutionError
{
<BUG>List<ContextInitializerConfigurations> list_of_configs = project.findResources(new ResourceMetadata(new ContextInitializerConfigurations.ContextInitializersConfigurationType()), ContextInitializerConfigurations.class);
if (list_of_configs.size() == 0)</BUG>
return lists; // if there are no configurations, then apply all lists.
Set<String> ids_of_lists_to_keep = new HashSet<>();
| List<ResourceToken<ContextInitializerConfigurations>> tokens = project.findResources(new ResourceMetadata(new ContextInitializerConfigurations.ContextInitializersConfigurationType()), ContextInitializerConfigurations.class);
List<ContextInitializerConfigurations> list_of_configs = project.getResources(tokens);
if (list_of_configs.size() == 0)
|
5,849 | } else {
updateMemo();
callback.updateMemo();
}
dismiss();
<BUG>}else{
</BUG>
Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show();
}
}
| [DELETED] |
5,850 | }
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_memo);
<BUG>ChinaPhoneHelper.setStatusBar(this,true);
</BUG>
topicId = getIntent().getLongExtra("topicId", -1);
if (topicId == -1) {
finish();
| ChinaPhoneHelper.setStatusBar(this, true);
|
5,851 | MemoEntry.COLUMN_REF_TOPIC__ID + " = ?"
, new String[]{String.valueOf(topicId)});
}
public Cursor selectMemo(long topicId) {
Cursor c = db.query(MemoEntry.TABLE_NAME, null, MemoEntry.COLUMN_REF_TOPIC__ID + " = ?", new String[]{String.valueOf(topicId)}, null, null,
<BUG>MemoEntry._ID + " DESC", null);
</BUG>
if (c != null) {
c.moveToFirst();
}
| MemoEntry.COLUMN_ORDER + " ASC", null);
|
5,852 | MemoEntry._ID + " = ?",
new String[]{String.valueOf(memoId)});
}
public long updateMemoContent(long memoId, String memoContent) {
ContentValues values = new ContentValues();
<BUG>values.put(MemoEntry.COLUMN_CONTENT, memoContent);
return db.update(</BUG>
MemoEntry.TABLE_NAME,
values,
MemoEntry._ID + " = ?",
| return db.update(
|
5,853 | import android.widget.RelativeLayout;
import android.widget.TextView;
import com.kiminonawa.mydiary.R;
import com.kiminonawa.mydiary.db.DBManager;
import com.kiminonawa.mydiary.shared.EditMode;
<BUG>import com.kiminonawa.mydiary.shared.ThemeManager;
import java.util.List;
public class MemoAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements EditMode {
</BUG>
private List<MemoEntity> memoList;
| import com.marshalchen.ultimaterecyclerview.dragsortadapter.DragSortAdapter;
public class MemoAdapter extends DragSortAdapter<DragSortAdapter.ViewHolder> implements EditMode {
|
5,854 | private DBManager dbManager;
private boolean isEditMode = false;
private EditMemoDialogFragment.MemoCallback callback;
private static final int TYPE_HEADER = 0;
private static final int TYPE_ITEM = 1;
<BUG>public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback) {
this.mActivity = activity;</BUG>
this.topicId = topicId;
this.memoList = memoList;
| public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback, RecyclerView recyclerView) {
super(recyclerView);
this.mActivity = activity;
|
5,855 | this.memoList = memoList;
this.dbManager = dbManager;
this.callback = callback;
}
@Override
<BUG>public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
</BUG>
View view;
if (isEditMode) {
if (viewType == TYPE_HEADER) {
| public DragSortAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
5,856 | editMemoDialogFragment.show(mActivity.getSupportFragmentManager(), "editMemoDialogFragment");
}
});
}
}
<BUG>protected class MemoViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
private View rootView;
private TextView TV_memo_item_content;</BUG>
private ImageView IV_memo_item_delete;
| protected class MemoViewHolder extends DragSortAdapter.ViewHolder implements View.OnClickListener, View.OnLongClickListener {
private ImageView IV_memo_item_dot;
private TextView TV_memo_item_content;
|
5,857 | mutatedIndexedColumns.add(column);
}
}
if (mutatedIndexedColumns == null)
{
<BUG>applyCF(cfs, key, columnFamily, memtablesToFlush);
</BUG>
}
else
{
| applyCF(cfs, key, cf, memtablesToFlush);
|
5,858 | for (Map.Entry<byte[], IColumn> entry : oldIndexedColumns.getColumnsMap().entrySet())
{
byte[] columnName = entry.getKey();
IColumn column = entry.getValue();
DecoratedKey<LocalToken> valueKey = cfs.getIndexKeyFor(columnName, column.value());
<BUG>ColumnFamily cf = cfs.newIndexedColumnFamily(columnName);
cf.deleteColumn(mutation.key(), localDeletionTime, column.clock());
applyCF(cfs.getIndexedColumnFamilyStore(columnName), valueKey, cf, memtablesToFlush);
</BUG>
}
| ColumnFamily cfi = cfs.newIndexedColumnFamily(columnName);
cfi.deleteColumn(mutation.key(), localDeletionTime, column.clock());
applyCF(cfs.getIndexedColumnFamilyStore(columnName), valueKey, cfi, memtablesToFlush);
|
5,859 | import org.codehaus.plexus.util.xml.Xpp3Dom;
public class LinkedResource
{
private String name;
private String type;
<BUG>private String location;
public String getName()</BUG>
{
return name;
}
| private String locationURI;
public String getName()
|
5,860 | }
}
public int hashCode()
{
return name.hashCode() + ( type == null ? 0 : 13 * type.hashCode() )
<BUG>+ ( location == null ? 0 : 17 * location.hashCode() );
}</BUG>
}
| else if ( locationNode != null && locationURINode != null )
throw new IllegalArgumentException( "Both location and locationURI nodes are set." );
|
5,861 | <BUG>package org.apache.commons.jcs.access;
import org.apache.commons.jcs.JCS;</BUG>
import org.apache.commons.jcs.access.behavior.ICacheAccess;
import org.apache.commons.jcs.access.exception.CacheException;
import org.apache.commons.jcs.access.exception.ConfigurationException;
| import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.apache.commons.jcs.JCS;
|
5,862 | import org.apache.commons.jcs.engine.behavior.ICompositeCacheAttributes;
import org.apache.commons.jcs.engine.behavior.IElementAttributes;
import org.apache.commons.jcs.engine.stats.behavior.ICacheStats;
import org.apache.commons.jcs.utils.props.AbstractPropertyContainer;
import org.apache.commons.logging.Log;
<BUG>import org.apache.commons.logging.LogFactory;
import java.io.Serializable;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
public class PartitionedCacheAccess<K extends Serializable, V extends Serializable></BUG>
extends AbstractPropertyContainer
| public class PartitionedCacheAccess<K, V>
|
5,863 | <BUG>package org.apache.commons.jcs.auxiliary.lateral.socket.tcp;
import org.apache.commons.jcs.auxiliary.lateral.LateralElementDescriptor;</BUG>
import org.apache.commons.jcs.auxiliary.lateral.socket.tcp.behavior.ITCPLateralCacheAttributes;
import org.apache.commons.jcs.io.ObjectInputStreamClassLoaderAware;
import org.apache.commons.logging.Log;
| import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.InetSocketAddress;
import java.net.Socket;
import org.apache.commons.jcs.auxiliary.lateral.LateralElementDescriptor;
|
5,864 | import org.apache.commons.jcs.auxiliary.lateral.LateralElementDescriptor;</BUG>
import org.apache.commons.jcs.auxiliary.lateral.socket.tcp.behavior.ITCPLateralCacheAttributes;
import org.apache.commons.jcs.io.ObjectInputStreamClassLoaderAware;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
<BUG>import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.InetSocketAddress;
import java.net.Socket;</BUG>
public class LateralTCPSender
| package org.apache.commons.jcs.auxiliary.lateral.socket.tcp;
import java.net.Socket;
import org.apache.commons.jcs.auxiliary.lateral.LateralElementDescriptor;
|
5,865 | <BUG>package org.apache.commons.jcs.auxiliary.remote.http.server;
import org.apache.commons.jcs.engine.behavior.ICacheElement;</BUG>
import org.apache.commons.jcs.engine.behavior.ICacheServiceNonLocal;
import org.apache.commons.jcs.engine.behavior.ICompositeCacheManager;
import org.apache.commons.jcs.engine.control.CompositeCache;
| import java.io.IOException;
import java.io.Serializable;
import java.util.Map;
import java.util.Set;
import org.apache.commons.jcs.engine.behavior.ICacheElement;
|
5,866 | import org.apache.commons.jcs.engine.control.CompositeCache;
import org.apache.commons.jcs.engine.logging.CacheEvent;
import org.apache.commons.jcs.engine.logging.behavior.ICacheEvent;
import org.apache.commons.jcs.engine.logging.behavior.ICacheEventLogger;
import org.apache.commons.logging.Log;
<BUG>import org.apache.commons.logging.LogFactory;
import java.io.IOException;
import java.io.Serializable;
import java.util.Map;
import java.util.Set;
public abstract class AbstractRemoteCacheService<K extends Serializable, V extends Serializable></BUG>
implements ICacheServiceNonLocal<K, V>
| public abstract class AbstractRemoteCacheService<K, V>
|
5,867 | if ( cacheEventLogger != null )
{
cacheEventLogger.logApplicationEvent( source, eventName, optionalDetails );
}
}
<BUG>protected <T extends Serializable> void logICacheEvent( ICacheEvent<T> cacheEvent )
{</BUG>
if ( cacheEventLogger != null )
{
cacheEventLogger.logICacheEvent( cacheEvent );
| protected <T> void logICacheEvent( ICacheEvent<T> cacheEvent )
|
5,868 | package com.comicviewer.cedric.comicviewer.ComicListFiles;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Configuration;
<BUG>import android.graphics.Point;
import android.os.AsyncTask;</BUG>
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
| import android.net.Uri;
import android.os.AsyncTask;
|
5,869 | }
else if (Utilities.isZipArchive(file)) {
extractZipComic(comic, context);
} else {
extractRarComic(context, comic);
<BUG>}
setComicColor(context, comic);
}
catch (Exception e)
{
e.printStackTrace();
Log.e("ComicLoader", "Error loading comic: " + comic.getFileName());</BUG>
}
| [DELETED] |
5,870 | package com.comicviewer.cedric.comicviewer;
import android.content.Context;
import android.widget.Toast;
import com.comicviewer.cedric.comicviewer.Model.Comic;
import com.comicviewer.cedric.comicviewer.PreferenceFiles.StorageManager;
<BUG>import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;</BUG>
import java.io.File;
import java.util.ArrayList;
| [DELETED] |
5,871 | message.show();
}
}
else
{
<BUG>StorageManager.saveLastReadComic(context, comic.getFileName(), comic.getPageCount());
</BUG>
int pagesRead = StorageManager.getPagesReadForComic(context, comic.getFileName());
StorageManager.savePagesForComic(context, comic.getFileName(), comic.getPageCount());
if (pagesRead == 0) {
| StorageManager.saveComicPosition(context, comic.getFileName(), comic.getPageCount());
|
5,872 | private void addMarkUnreadClickListener(final ComicItemViewHolder vh) {
vh.mMarkReadButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
vh.mSwipeLayout.close(true);
<BUG>if (StorageManager.getReadComics(mListFragment.getActivity()).containsKey((vh.getComic().getFileName()))) {
</BUG>
ComicActions.markComicUnread(mListFragment.getActivity(), vh.getComic());
mHandler.postDelayed(new Runnable() {
@Override
| if (StorageManager.getComicPositionsMap(mListFragment.getActivity()).containsKey((vh.getComic().getFileName()))) {
|
5,873 | </BUG>
{
if (Build.VERSION.SDK_INT>15)
comicItemViewHolder.mLastReadIcon.setBackground(circle);
<BUG>if (StorageManager.getReadComics(mListFragment.getActivity()).get(comic.getFileName())+1>=comic.getPageCount())
</BUG>
{
comicItemViewHolder.mMarkReadButton.setImageResource(R.drawable.fab_close);
comicItemViewHolder.mMarkReadButton.setColorNormal(mListFragment.getResources().getColor(R.color.Blue));
comicItemViewHolder.mMarkReadButton.setColorPressed(mListFragment.getResources().getColor(R.color.BlueDark));
| ImageLoader.getInstance().displayImage(comic.getCoverImage(), comicItemViewHolder.mCoverPicture, mImageOptions);
}
Drawable circle = mListFragment.getActivity().getResources().getDrawable(R.drawable.dark_circle);
comicItemViewHolder.mFavoriteButton.setBackground(circle);
if (StorageManager.getComicPositionsMap(mListFragment.getActivity()).containsKey(comic.getFileName()))
if (StorageManager.getComicPositionsMap(mListFragment.getActivity()).get(comic.getFileName())+1>=comic.getPageCount())
|
5,874 | protected void handleArguments(Bundle args) {
}
@Override
void setSearchFilters() {
mFilters.clear();
<BUG>mFilters.add(new SearchFilter(StorageManager.getReadComics(mApplicationContext)) {
</BUG>
@Override
public boolean compare(Object object) {
if (object instanceof Comic) {
| mFilters.add(new SearchFilter(StorageManager.getComicPositionsMap(mApplicationContext)) {
|
5,875 | public ReportElement getBase() {
return base;
}
@Override
public float print(PDDocument document, PDPageContentStream stream, int pageNumber, float startX, float startY, float allowedWidth) throws IOException {
<BUG>PDPage currPage = (PDPage) document.getDocumentCatalog().getPages().get(pageNo);
PDPageContentStream pageStream = new PDPageContentStream(document, currPage, true, false);
</BUG>
base.print(document, pageStream, pageNo, x, y, width);
pageStream.close();
| PDPage currPage = document.getDocumentCatalog().getPages().get(pageNo);
PDPageContentStream pageStream = new PDPageContentStream(document, currPage, PDPageContentStream.AppendMode.APPEND, false);
|
5,876 | package org.apereo.cas.authentication;
import org.apereo.cas.configuration.model.core.authentication.PasswordEncoderProperties;
import org.apereo.cas.configuration.support.Beans;
<BUG>import org.junit.Test;
import org.pac4j.core.credentials.password.PasswordEncoder;
import org.pac4j.core.credentials.password.SpringSecurityPasswordEncoder;</BUG>
import org.springframework.security.crypto.password.StandardPasswordEncoder;
import static org.junit.Assert.*;
| import org.springframework.security.crypto.password.PasswordEncoder;
|
5,877 | @Test
public void verifyPasswordEncoderByCustomClassName() {
final PasswordEncoderProperties p = new PasswordEncoderProperties();
p.setType(StandardPasswordEncoder.class.getName());
p.setSecret("SECRET");
<BUG>final PasswordEncoder e = new SpringSecurityPasswordEncoder(Beans.newPasswordEncoder(p));
assertNotNull(e);</BUG>
}
@Test
public void verifyPasswordEncoderByMD5() {
| final PasswordEncoder e = Beans.newPasswordEncoder(p);
assertNotNull(e);
|
5,878 | public void verifyPasswordEncoderByMD5() {
final PasswordEncoderProperties p = new PasswordEncoderProperties();
p.setType(PasswordEncoderProperties.PasswordEncoderTypes.DEFAULT.name());
p.setEncodingAlgorithm("MD5");
p.setCharacterEncoding("UTF-8");
<BUG>final PasswordEncoder e = new SpringSecurityPasswordEncoder(Beans.newPasswordEncoder(p));
assertTrue(e.matches("asd123", "bfd59291e825b5f2bbf1eb76569f8fe7"));</BUG>
}
@Test
public void verifyPasswordEncoderBySHA1() {
| final PasswordEncoder e = Beans.newPasswordEncoder(p);
assertTrue(e.matches("asd123", "bfd59291e825b5f2bbf1eb76569f8fe7"));
|
5,879 | public void verifyPasswordEncoderBySHA1() {
final PasswordEncoderProperties p = new PasswordEncoderProperties();
p.setType(PasswordEncoderProperties.PasswordEncoderTypes.DEFAULT.name());
p.setEncodingAlgorithm("SHA-1");
p.setCharacterEncoding("UTF-8");
<BUG>final PasswordEncoder e = new SpringSecurityPasswordEncoder(Beans.newPasswordEncoder(p));
assertTrue(e.matches("asd123", "2891baceeef1652ee698294da0e71ba78a2a4064"));</BUG>
}
@Test
public void verifyPasswordEncoderBySHA256() {
| final PasswordEncoder e = Beans.newPasswordEncoder(p);
assertTrue(e.matches("asd123", "2891baceeef1652ee698294da0e71ba78a2a4064"));
|
5,880 | Bundle savedInstanceState) {
final View rootView = inflater.inflate(R.layout.tab_qibla, container, false);
final QiblaCompassView qiblaCompassView = (QiblaCompassView)rootView.findViewById(R.id.qibla_compass);
qiblaCompassView.setConstants(((TextView)rootView.findViewById(R.id.bearing_north)), getText(R.string.bearing_north),
((TextView)rootView.findViewById(R.id.bearing_qibla)), getText(R.string.bearing_qibla));
<BUG>sOrientationListener = new SensorListener() {
</BUG>
public void onSensorChanged(int s, float v[]) {
float northDirection = v[SensorManager.DATA_X];
qiblaCompassView.setDirections(northDirection, sQiblaDirection);
| sOrientationListener = new android.hardware.SensorListener() {
|
5,881 | @OnClick(R.id.item_feedback)
void item_feedback() {
SharePreUtil.saveBooleanData(this, Constants.SPFeedback, false);
setFeedbackState(false);
Map<String, String> customInfoMap = new HashMap<>();
<BUG>customInfoMap.put("themeColor","#54aee6");
customInfoMap.put("pageTitle","意见反馈");
</BUG>
FeedbackAPI.setUICustomInfo(customInfoMap);
| customInfoMap.put("themeColor", "#54aee6");
customInfoMap.put("pageTitle", "意见反馈");
|
5,882 | private int navigationCheckedItemId = R.id.nav_fuli;
private String navigationCheckedTitle = "福利";
private static final String savedInstanceStateItemId = "navigationCheckedItemId";
private static final String savedInstanceStateTitle = "navigationCheckedTitle";
private long exitTime = 0;
<BUG>private MaterialDialog mMaterialDialogFeedBack;
private MaterialDialog mMaterialDialogAppUpdate;
private MaterialDialog mMaterialDialogPush;</BUG>
private MainPresenterImpl mainPresenter;
private SkinBroadcastReceiver skinBroadcastReceiver;
| [DELETED] |
5,883 |
return;
}</BUG>
mView.showBasesProgressSuccess("清除完毕");
<BUG>initCache();
}</BUG>
});
}
}).start();
}
| Glide.get(MyApplication.getIntstance()).clearDiskCache();
MyApplication.getHandler().post(new Runnable() {
@Override
public void run() {
Glide.get(context).clearMemory();
if (mView != null) {
|
5,884 | public OrientationPublisher(SensorManager sensorManager) {
this.sensorManager = sensorManager;
}
@Override
public GraphName getDefaultNodeName() {
<BUG>return new GraphName("android/orientiation_sensor");
</BUG>
}
@Override
public void onStart(ConnectedNode connectedNode) {
| return GraphName.of("android/orientiation_sensor");
|
5,885 | public RosCameraPreviewView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
public GraphName getDefaultNodeName() {
<BUG>return new GraphName("ros_camera_preview_view");
</BUG>
}
@Override
public void onStart(ConnectedNode connectedNode) {
| return GraphName.of("ros_camera_preview_view");
|
5,886 | getHolder().setFormat(PixelFormat.TRANSLUCENT);
setRenderer(renderer);
}
@Override
public GraphName getDefaultNodeName() {
<BUG>return new GraphName("android_honeycomb_mr2/visualization_view");
</BUG>
}
@Override
public boolean onTouchEvent(MotionEvent event) {
| return GraphName.of("android_honeycomb_mr2/visualization_view");
|
5,887 | private static final int COLOR_UNKNOWN = 0xff000000;
private final TextureDrawable textureDrawable;
private boolean ready;
private GraphName frame;
public CompressedBitmapLayer(String topic) {
<BUG>this(new GraphName(topic));
</BUG>
}
public CompressedBitmapLayer(GraphName topic) {
super(topic, "compressed_visualization_transport_msgs/CompressedBitmap");
| this(GraphName.of(topic));
|
5,888 | Texture texture = comprssedBitmapMessageToTexture(message);
Bitmap bitmap =
Bitmap.createBitmap(texture.getPixels(), texture.getStride(), texture.getHeight(),
Bitmap.Config.ARGB_8888);
textureDrawable.update(message.getOrigin(), message.getResolutionX(), bitmap);
<BUG>frame = new GraphName(message.getHeader().getFrameId());
</BUG>
ready = true;
}
private Texture comprssedBitmapMessageToTexture(
| frame = GraphName.of(message.getHeader().getFrameId());
|
5,889 | public void setMessageToStringCallable(MessageCallable<String, T> callable) {
this.callable = callable;
}
@Override
public GraphName getDefaultNodeName() {
<BUG>return new GraphName("android_gingerbread/ros_text_view");
</BUG>
}
@Override
public void onStart(ConnectedNode connectedNode) {
| return GraphName.of("android_gingerbread/ros_text_view");
|
5,890 | public void setMessageToBitmapCallable(MessageCallable<Bitmap, T> callable) {
this.callable = callable;
}
@Override
public GraphName getDefaultNodeName() {
<BUG>return new GraphName("ros_image_view");
</BUG>
}
@Override
public void onStart(ConnectedNode connectedNode) {
| return GraphName.of("ros_image_view");
|
5,891 | private GraphName frame;
private Camera camera;
private boolean ready;
private nav_msgs.GridCells message;
public GridCellsLayer(String topicName, Color color) {
<BUG>this(new GraphName(topicName), color);
</BUG>
}
public GridCellsLayer(GraphName topicName, Color color) {
super(topicName, "nav_msgs/GridCells");
| this(GraphName.of(topicName), color);
|
5,892 | super.onStart(connectedNode, handler, frameTransformTree, camera);
this.camera = camera;
getSubscriber().addMessageListener(new MessageListener<nav_msgs.GridCells>() {
@Override
public void onNewMessage(nav_msgs.GridCells data) {
<BUG>frame = new GraphName(data.getHeader().getFrameId());
</BUG>
if (frameTransformTree.canTransform(frame, frame)) {
if (lock.tryLock()) {
message = data;
| frame = GraphName.of(data.getHeader().getFrameId());
|
5,893 | jointState.setPosition(new double[] { tilt });
publisher.publish(jointState);
}
@Override
public GraphName getDefaultNodeName() {
<BUG>return new GraphName("android_honeycomb_mr2/pan_tilt_view");
</BUG>
}
@Override
public void onStart(ConnectedNode connectedNode) {
| return GraphName.of("android_honeycomb_mr2/pan_tilt_view");
|
5,894 | import org.ros.rosjava_geometry.Quaternion;
import org.ros.rosjava_geometry.Transform;
import org.ros.rosjava_geometry.Vector3;
import javax.microedition.khronos.opengles.GL10;
public class Camera {
<BUG>private static final GraphName DEFAULT_FIXED_FRAME = new GraphName("/map");
</BUG>
private static final float MINIMUM_ZOOM = 10.0f;
private static final float MAXIMUM_ZOOM = 500.0f;
private Viewport viewport;
| private static final GraphName DEFAULT_FIXED_FRAME = GraphName.of("/map");
|
5,895 | public void setTopicName(String topicName) {
this.laserTopic = topicName;
}
@Override
public GraphName getDefaultNodeName() {
<BUG>return new GraphName("android_honeycomb_mr2/distance_view");
</BUG>
}
@Override
public void onStart(ConnectedNode connectedNode) {
| return GraphName.of("android_honeycomb_mr2/distance_view");
|
5,896 | private static final float POINT_SIZE = 5.0f;
private FloatBuffer vertexBuffer;
private boolean ready;
private GraphName frame;
public PathLayer(String topic) {
<BUG>this(new GraphName(topic));
</BUG>
}
public PathLayer(GraphName topic) {
super(topic, "nav_msgs/Path");
| this(GraphName.of(topic));
|
5,897 | ByteBuffer goalVertexByteBuffer =
ByteBuffer.allocateDirect(path.getPoses().size() * 3 * Float.SIZE / 8);
goalVertexByteBuffer.order(ByteOrder.nativeOrder());
vertexBuffer = goalVertexByteBuffer.asFloatBuffer();
if (path.getPoses().size() > 0) {
<BUG>frame = new GraphName(path.getPoses().get(0).getHeader().getFrameId());
</BUG>
int i = 0;
for (PoseStamped pose : path.getPoses()) {
if (i % 15 == 0) {
| frame = GraphName.of(path.getPoses().get(0).getHeader().getFrameId());
|
5,898 | </BUG>
}
public PoseSubscriberLayer(GraphName topic) {
super(topic, "geometry_msgs/PoseStamped");
<BUG>targetFrame = new GraphName("/map");
</BUG>
ready = false;
}
@Override
public void draw(GL10 gl) {
| TfLayer {
private final GraphName targetFrame;
private Shape shape;
private boolean ready;
public PoseSubscriberLayer(String topic) {
this(GraphName.of(topic));
targetFrame = GraphName.of("/map");
|
5,899 | super.onStart(connectedNode, handler, frameTransformTree, camera);
shape = new GoalShape();
getSubscriber().addMessageListener(new MessageListener<geometry_msgs.PoseStamped>() {
@Override
public void onNewMessage(geometry_msgs.PoseStamped pose) {
<BUG>GraphName frame = new GraphName(pose.getHeader().getFrameId());
</BUG>
if (frameTransformTree.canTransform(frame, targetFrame)) {
Transform poseTransform = Transform.newFromPoseMessage(pose.getPose());
FrameTransform targetFrameTransform =
| GraphName frame = GraphName.of(pose.getHeader().getFrameId());
|
5,900 | private final TextureDrawable textureDrawable;
private final Object mutex;
private boolean ready;
private GraphName frame;
public OccupancyGridLayer(String topic) {
<BUG>this(new GraphName(topic));
</BUG>
}
public OccupancyGridLayer(GraphName topic) {
super(topic, nav_msgs.OccupancyGrid._TYPE);
| this(GraphName.of(topic));
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.