id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
41,101 | "SELECT * FROM " + DATASET_SECURITY_TABLE + " WHERE dataset_urn = :dataset_urn";
public static final String GET_DATASET_OWNER_BY_DATASET_ID =
"SELECT * FROM " + DATASET_OWNER_TABLE + " WHERE dataset_id = :dataset_id ORDER BY sort_id";
public static final String GET_DATASET_OWNER_BY_URN =
"SELECT * FROM " + DATASET_OWNER_TABLE + " WHERE dataset_urn = :dataset_urn ORDER BY sort_id";
<BUG>public static final String DELETE_DATASET_OWNER_BY_URN =
"DELETE FROM " + DATASET_OWNER_TABLE + " WHERE dataset_urn=?";
</BUG>
public static final String GET_USER_BY_USER_ID = "SELECT * FROM " + EXTERNAL_USER_TABLE + " WHERE user_id = :user_id";
| public static final String DELETE_DATASET_OWNER_BY_DATASET_ID =
"DELETE FROM " + DATASET_OWNER_TABLE + " WHERE dataset_id=?";
|
41,102 | "SELECT app_id FROM " + EXTERNAL_GROUP_TABLE + " WHERE group_id = :group_id GROUP BY group_id";
public static final String GET_DATASET_CONSTRAINT_BY_DATASET_ID =
"SELECT * FROM " + DATASET_CONSTRAINT_TABLE + " WHERE dataset_id = :dataset_id";
public static final String GET_DATASET_CONSTRAINT_BY_URN =
"SELECT * FROM " + DATASET_CONSTRAINT_TABLE + " WHERE dataset_urn = :dataset_urn";
<BUG>public static final String DELETE_DATASET_CONSTRAINT_BY_URN =
"DELETE FROM " + DATASET_CONSTRAINT_TABLE + " WHERE dataset_urn=?";
</BUG>
public static final String GET_DATASET_INDEX_BY_DATASET_ID =
| public static final String DELETE_DATASET_CONSTRAINT_BY_DATASET_ID =
"DELETE FROM " + DATASET_CONSTRAINT_TABLE + " WHERE dataset_id=?";
|
41,103 | </BUG>
public static final String GET_DATASET_INDEX_BY_DATASET_ID =
"SELECT * FROM " + DATASET_INDEX_TABLE + " WHERE dataset_id = :dataset_id";
public static final String GET_DATASET_INDEX_BY_URN =
"SELECT * FROM " + DATASET_INDEX_TABLE + " WHERE dataset_urn = :dataset_urn";
<BUG>public static final String DELETE_DATASET_INDEX_BY_URN =
"DELETE FROM " + DATASET_INDEX_TABLE + " WHERE dataset_urn=?";
</BUG>
public static final String GET_DATASET_SCHEMA_BY_DATASET_ID =
| "SELECT app_id FROM " + EXTERNAL_GROUP_TABLE + " WHERE group_id = :group_id GROUP BY group_id";
public static final String GET_DATASET_CONSTRAINT_BY_DATASET_ID =
"SELECT * FROM " + DATASET_CONSTRAINT_TABLE + " WHERE dataset_id = :dataset_id";
public static final String GET_DATASET_CONSTRAINT_BY_URN =
"SELECT * FROM " + DATASET_CONSTRAINT_TABLE + " WHERE dataset_urn = :dataset_urn";
public static final String DELETE_DATASET_CONSTRAINT_BY_DATASET_ID =
"DELETE FROM " + DATASET_CONSTRAINT_TABLE + " WHERE dataset_id=?";
public static final String DELETE_DATASET_INDEX_BY_DATASET_ID =
"DELETE FROM " + DATASET_INDEX_TABLE + " WHERE dataset_id=?";
|
41,104 | DatasetSecurityRecord record = om.convertValue(security, DatasetSecurityRecord.class);
record.setDatasetId(datasetId);
record.setDatasetUrn(urn);
record.setModifiedTime(System.currentTimeMillis() / 1000);
try {
<BUG>Map<String, Object> result = getDatasetSecurityByDatasetId(datasetId);
</BUG>
String[] columns = record.getDbColumnNames();
Object[] columnValues = record.getAllValuesToString();
String[] conditions = {"dataset_id"};
| DatasetSecurityRecord result = getDatasetSecurityByDatasetId(datasetId);
|
41,105 | "confidential_flags", "is_recursive", "partitioned", "indexed", "namespace", "default_comment_id", "comment_ids"};
}
@Override
public List<Object> fillAllFields() {
return null;
<BUG>}
public String[] getFieldDetailColumns() {</BUG>
return new String[]{"dataset_id", "sort_id", "parent_sort_id", "parent_path", "field_name", "fields_layout_id",
"field_label", "data_type", "data_size", "data_precision", "data_fraction", "is_nullable", "is_indexed",
"is_partitioned", "is_recursive", "confidential_flags", "default_value", "namespace", "default_comment_id",
| @JsonIgnore
public String[] getFieldDetailColumns() {
|
41,106 | partitioned != null && partitioned ? "Y" : "N", isRecursive != null && isRecursive ? "Y" : "N",
confidentialFlags, defaultValue, namespace, defaultCommentId, commentIds};
}
public DatasetFieldSchemaRecord() {
}
<BUG>@Override
public String toString() {
try {
return new ObjectMapper().writeValueAsString(this.getFieldValueMap());
} catch (Exception ex) {
return null;
}
}</BUG>
public Integer getDatasetId() {
| [DELETED] |
41,107 | String fieldPath;
String descend;
Integer prefixLength;
String filter;
public DatasetFieldIndexRecord() {
<BUG>}
@Override
public String toString() {
try {
return new ObjectMapper().writeValueAsString(this);
} catch (JsonProcessingException ex) {
return null;
}</BUG>
}
| [DELETED] |
41,108 | String actorUrn;
String type;
Long time;
String note;
public DatasetChangeAuditStamp() {
<BUG>}
@Override
public String toString() {
try {
return new ObjectMapper().writeValueAsString(this);
} catch (JsonProcessingException ex) {
return null;
}</BUG>
}
| [DELETED] |
41,109 | package wherehows.common.schemas;
<BUG>import com.fasterxml.jackson.annotation.JsonIgnore;
import java.lang.reflect.Field;
import java.util.HashMap;</BUG>
import java.util.List;
import java.util.Map;
| import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
import java.util.Date;
import java.util.Collection;
import java.util.HashMap;
|
41,110 | import java.io.InputStream;
import java.net.URL;
import static org.assertj.core.api.Assertions.assertThat;
public class TomcatWebServerTest {
@Test
<BUG>public void shouldBootWebServer() throws Exception {
try(WeldContainer weldContainer = new Weld().disableDiscovery()</BUG>
.extensions(new ConfigurationExtension())
.beanClasses(TomcatWebServer.class, DefaultServlet.class, MessageProvider.class,
WebServerConfiguration.class, DefaultConfigPropertyProducer.class)
| SSLBypass.disableSSLChecks();
try(WeldContainer weldContainer = new Weld().disableDiscovery()
|
41,111 | tomcat.start();
try(InputStream stream = new URL("http://localhost:8080/").openStream()) {
String data = IOUtils.toString(stream).trim();
assertThat(data).isEqualTo(MessageProvider.DATA);
}
<BUG>try(InputStream stream = new URL("http://localhost:8080/rest").openStream()) {
</BUG>
String data = IOUtils.toString(stream).trim();
assertThat(data).isEqualTo("Hello, world!");
}
| try(InputStream stream = new URL("https://localhost:8443/rest").openStream()) {
|
41,112 | import java.io.InputStream;
import java.net.URL;
import static org.assertj.core.api.Assertions.assertThat;
public class JettyBootTest {
@Test
<BUG>public void shouldBootWebServer() throws Exception {
try(WeldContainer weldContainer = new Weld().disableDiscovery()</BUG>
.extensions(new ConfigurationExtension())
.beanClasses(JettyWebServer.class, DefaultServlet.class, MessageProvider.class,
WebServerConfiguration.class, DefaultConfigPropertyProducer.class)
| SSLBypass.disableSSLChecks();
try(WeldContainer weldContainer = new Weld().disableDiscovery()
|
41,113 | webServer.start();
try(InputStream stream = new URL("http://localhost:8080/").openStream()) {
String data = IOUtils.toString(stream).trim();
assertThat(data).isEqualTo(MessageProvider.DATA);
}
<BUG>try(InputStream stream = new URL("http://localhost:8080/").openStream()) {
</BUG>
String data = IOUtils.toString(stream).trim();
assertThat(data).isEqualTo(MessageProvider.DATA);
}
| try(InputStream stream = new URL("https://localhost:8443/").openStream()) {
|
41,114 | }
public String getAddress() {
return address;
}
public boolean isSecuredConfigured(){
<BUG>return securedPort != 0 && keystorePath != null && truststorePassword != null;
}</BUG>
public int getSecuredPort(){
return securedPort;
}
| public int getPort() {
return port;
return securedPort != 0;
|
41,115 | package net.blacklab.lmr;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
<BUG>import java.util.ArrayList;
import java.util.List;</BUG>
import java.util.Random;
import net.blacklab.lib.config.ConfigList;
import net.blacklab.lib.vevent.VEventBus;
| import java.util.Iterator;
import java.util.List;
|
41,116 | import net.minecraft.entity.EnumCreatureType;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
<BUG>import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.MinecraftForge;</BUG>
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.Mod.Instance;
| import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.common.MinecraftForge;
|
41,117 | import java.util.TreeMap;
import java.util.TreeSet;
import java.util.regex.Pattern;
import edu.umd.cs.findbugs.ba.AnalysisContext;
import edu.umd.cs.findbugs.charsets.UTF8;
<BUG>import edu.umd.cs.findbugs.internalAnnotations.DottedClassName;
public class ProjectPackagePrefixes {</BUG>
public static class PrefixFilter {
final String[] parts;
PrefixFilter(String prefixes) {
| import edu.umd.cs.findbugs.io.IO;
import edu.umd.cs.findbugs.util.Util;
public class ProjectPackagePrefixes {
|
41,118 | System.out.printf("%5d %s%n", e.getValue(), e.getKey());
}
}
public ProjectPackagePrefixes() {
URL u = DetectorFactoryCollection.getCoreResource("projectPaths.properties");
<BUG>if (u != null) {
try {
BufferedReader in = UTF8.bufferedReader(u.openStream());
while (true) {</BUG>
String s = in.readLine();
| BufferedReader in = null;
while (true) {
|
41,119 | package edu.umd.cs.findbugs.ba;
import org.apache.bcel.generic.InstructionHandle;
public class Target {
private InstructionHandle targetInstruction;
<BUG>private int edgeType;
public Target(InstructionHandle targetInstruction, int edgeType) {
</BUG>
this.targetInstruction = targetInstruction;
| private @Edge.Type int edgeType;
public Target(InstructionHandle targetInstruction, @Edge.Type int edgeType) {
|
41,120 | private final ExportFile _exportFile;
private final NFSv41DeviceManager _deviceManager;
private final NFSv4StateHandler _stateHandler;
private int _slotId;
private boolean _cacheThis;
<BUG>private final int _totalOperationsCount;
private int _currentOpPosition = -1;</BUG>
private stateid4 _currentStateid = null;
private stateid4 _savedStateid = null;
private final Principal _principal;
| [DELETED] |
41,121 | private stateid4 _savedStateid = null;
private final Principal _principal;
public CompoundContext(int minorversion, VirtualFileSystem fs,
NFSv4StateHandler stateHandler,
NFSv41DeviceManager deviceManager, RpcCall call,
<BUG>ExportFile exportFile, int opCount) {
_minorversion = minorversion;</BUG>
_fs = fs;
_deviceManager = deviceManager;
_callInfo = call;
| ExportFile exportFile) {
_minorversion = minorversion;
|
41,122 | int id;
for(id = getHighestSlot(); id >= 0 && _slots[id] == null; id--) {
}
return id;
}
<BUG>public List<nfs_resop4> checkCacheSlot(int slot, int sequence, boolean checkCache)
throws ChimeraNFSException {
return getSlot(slot).checkSlotSequence(sequence, checkCache);
}</BUG>
private SessionSlot getSlot(int slot) throws ChimeraNFSException {
| public List<nfs_resop4> checkCacheSlot(int slot, int sequence)
return getSlot(slot).checkSlotSequence(sequence);
|
41,123 | import org.dcache.nfs.status.MinorVersMismatchException;
import org.dcache.nfs.status.NfsIoException;
import org.dcache.nfs.status.NotOnlyOpException;
import org.dcache.nfs.status.OpIllegalException;
import org.dcache.nfs.status.OpNotInSessionException;
<BUG>import org.dcache.nfs.status.ResourceException;
import org.dcache.nfs.status.SequencePosException;</BUG>
import org.dcache.nfs.status.ServerFaultException;
import org.dcache.nfs.status.StaleClientidException;
import org.dcache.nfs.status.StaleStateidException;
| import org.dcache.nfs.status.RetryUncacheRepException;
import org.dcache.nfs.status.SequencePosException;
|
41,124 | if (position == 1) {
if (arg1.argarray.length > context.getSession().getMaxOps()) {
throw new TooManyOpsException(String.format("Too many ops [%d]", arg1.argarray.length));
}
List<nfs_resop4> cache = context.getCache();
<BUG>if (cache != null) {
res.resarray.addAll(cache.subList(position, cache.size()));</BUG>
res.status = statusOfLastOperation(cache);
retransmit = true;
break;
| if (cache.isEmpty()) {
throw new RetryUncacheRepException();
res.resarray.addAll(cache.subList(position, cache.size()));
|
41,125 | break;
}
}
return this;
}
<BUG>protected int disconnect(final boolean iForceDirty) {
if (record.isDirty() && !iForceDirty)
return 0;
if (pTree.cache.remove(record.getIdentity()) == null)</BUG>
OLogManager.instance().warn(this, "Can't find current node into the cache. Is the cache invalid?");
| protected int disconnect(final boolean iForceDirty, final int iLevel) {
if (record == null || this == tree.getRoot() || record.isDirty() && !iForceDirty)
for (OMVRBTreeEntryPersistent<K, V> entryPoint : pTree.entryPoints) {
if (entryPoint == this)
if (pTree.cache.remove(record.getIdentity()) == null)
|
41,126 | left = null;
}
}
if (right != null) {
right.parent = null;
<BUG>int disconnected = right.disconnect(iForceDirty);
</BUG>
if (disconnected > 0) {
totalDisconnected += disconnected;
right = null;
| int disconnected = right.disconnect(iForceDirty, iLevel + 1);
|
41,127 | return this;
right = (OMVRBTreeEntryPersistent<K, V>) iRight;
markDirty();</BUG>
rightRid = iRight == null ? ORecordId.EMPTY_RECORD_ID : right.record.getIdentity();
<BUG>if (iRight != null && iRight.getParent() != this)
iRight.setParent(this);
checkEntryStructure();
return right;</BUG>
}
| } catch (IOException e) {
throw new OSerializationException("Can't unmarshall RB+Tree node", e);
} finally {
buffer.close();
OProfiler.getInstance().stopChrono("OMVRBTreeEntryP.fromStream", timer);
|
41,128 | MVRBTREE_NODE_PAGE_SIZE("mvrbtree.nodePageSize",
"Page size of each single node. 1,024 means that 1,024 entries can be stored inside a node", Float.class, 1024),
MVRBTREE_LOAD_FACTOR("mvrbtree.loadFactor", "HashMap load factor", Float.class, 0.7f),
MVRBTREE_OPTIMIZE_THRESHOLD("mvrbtree.optimizeThreshold", "Auto optimize the TreeMap every X operations as get, put and remove",
Integer.class, 100000),
<BUG>MVRBTREE_ENTRYPOINTS("mvrbtree.entryPoints", "Number of entry points to start searching entries", Integer.class, 7),
</BUG>
MVRBTREE_OPTIMIZE_ENTRYPOINTS_FACTOR("mvrbtree.optimizeEntryPointsFactor",
"Multiplicand factor to apply to entry-points list (parameter mvrbtree.entrypoints) to determine if needs of optimization",
Float.class, 1.0f),
| MVRBTREE_ENTRYPOINTS("mvrbtree.entryPoints", "Number of entry points to start searching entries", Integer.class, 15),
|
41,129 | import java.util.Locale;
import java.util.Map;
import java.util.TreeMap;
public class DependencyConvergenceReport
extends AbstractProjectInfoReport
<BUG>{
private List reactorProjects;
private static final int PERCENTAGE = 100;</BUG>
public String getOutputName()
{
| private static final int PERCENTAGE = 100;
private static final List SUPPORTED_FONT_FAMILY_NAMES = Arrays.asList( GraphicsEnvironment
.getLocalGraphicsEnvironment().getAvailableFontFamilyNames() );
|
41,130 | sink.section1();
sink.sectionTitle1();
sink.text( getI18nString( locale, "title" ) );
sink.sectionTitle1_();
Map dependencyMap = getDependencyMap();
<BUG>generateLegend( locale, sink );
generateStats( locale, sink, dependencyMap );
generateConvergence( locale, sink, dependencyMap );
sink.section1_();</BUG>
sink.body_();
| sink.lineBreak();
sink.section1_();
|
41,131 | Iterator it = artifactMap.keySet().iterator();
while ( it.hasNext() )
{
String version = (String) it.next();
sink.tableRow();
<BUG>sink.tableCell();
sink.text( version );</BUG>
sink.tableCell_();
sink.tableCell();
generateVersionDetails( sink, artifactMap, version );
| sink.tableCell( String.valueOf( cellWidth ) + "px" );
sink.text( version );
|
41,132 | sink.tableCell();
sink.text( getI18nString( locale, "legend.shared" ) );
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableCell();
iconError( sink );</BUG>
sink.tableCell_();
sink.tableCell();
sink.text( getI18nString( locale, "legend.different" ) );
| sink.tableCell( "15px" ); // according /images/icon_error_sml.gif
iconError( sink );
|
41,133 | sink.tableCaption();
sink.text( getI18nString( locale, "stats.caption" ) );
sink.tableCaption_();</BUG>
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.subprojects" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
sink.text( String.valueOf( reactorProjects.size() ) );
sink.tableCell_();
| sink.bold();
sink.bold_();
sink.tableCaption_();
sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.subprojects" ) );
sink.tableHeaderCell_();
|
41,134 | sink.tableCell();
sink.text( String.valueOf( reactorProjects.size() ) );
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.dependencies" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
sink.text( String.valueOf( depCount ) );
| sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.dependencies" ) );
sink.tableHeaderCell_();
|
41,135 | sink.text( String.valueOf( convergence ) + "%" );
sink.bold_();
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.readyrelease" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
if ( convergence >= PERCENTAGE && snapshotCount <= 0 )
| sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.readyrelease" ) );
sink.tableHeaderCell_();
|
41,136 | {
ReverseDependencyLink p1 = (ReverseDependencyLink) o1;
ReverseDependencyLink p2 = (ReverseDependencyLink) o2;
return p1.getProject().getId().compareTo( p2.getProject().getId() );
}
<BUG>else
{</BUG>
return 0;
}
}
| iconError( sink );
|
41,137 | import org.springframework.web.bind.annotation.RequestMethod;
@Controller
@RequestMapping("/content")
public class MainContentController {
private final Logger logger = Logger.getLogger(getClass());
<BUG>@Autowired
private ContentCreationEventDao contentCreationEventDao;</BUG>
@RequestMapping(method = RequestMethod.GET)
public String handleRequest(
HttpServletRequest request,
| [DELETED] |
41,138 | @RequestMapping("/content/allophone/create")
public class AllophoneCreateController {
private final Logger logger = Logger.getLogger(getClass());
@Autowired
private AllophoneDao allophoneDao;
<BUG>@Autowired
private ContentCreationEventDao contentCreationEventDao;</BUG>
@Autowired
private MessageSource messageSource;
@RequestMapping(method = RequestMethod.GET)
| [DELETED] |
41,139 | @RequestMapping("/content/allophone/edit")
public class AllophoneEditController {
private final Logger logger = Logger.getLogger(getClass());
@Autowired
private AllophoneDao allophoneDao;
<BUG>@Autowired
private ContentCreationEventDao contentCreationEventDao;</BUG>
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public String handleRequest(Model model, @PathVariable Long id) {
logger.info("handleRequest");
| [DELETED] |
41,140 | package org.literacyapp.model.contributor;
import java.util.Calendar;
<BUG>import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;</BUG>
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
| import javax.persistence.MappedSuperclass;
import javax.persistence.Temporal;
|
41,141 | import javax.persistence.Temporal;</BUG>
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import org.literacyapp.model.BaseEntity;
import org.literacyapp.model.Contributor;
<BUG>@Entity
public class ContributorEvent extends BaseEntity {
</BUG>
@NotNull
@ManyToOne
| package org.literacyapp.model.contributor;
import java.util.Calendar;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;
import javax.persistence.Temporal;
@MappedSuperclass
public abstract class ContributorEvent extends BaseEntity {
|
41,142 | package co.cask.cdap.common.twill;
import co.cask.cdap.common.conf.CConfiguration;
import com.google.common.base.Preconditions;
import com.google.common.base.Throwables;
import com.google.common.collect.ImmutableMap;
<BUG>import com.google.common.collect.Lists;
import com.google.common.util.concurrent.Service;</BUG>
import com.google.common.util.concurrent.SettableFuture;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.security.UserGroupInformation;
| import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.Service;
|
41,143 | LOG.info("Starting runnable {}", name);
SettableFuture<String> completionFuture = SettableFuture.create();
for (Service service : services) {
service.addListener(createServiceListener(service.getClass().getName(), completionFuture),
Threads.SAME_THREAD_EXECUTOR);
<BUG>}
Services.chainStart(services.get(0), services.subList(1, services.size()).toArray(new Service[0]));
</BUG>
LOG.info("Runnable started {}", name);
try {
| Futures.getUnchecked(
Services.chainStart(services.get(0), services.subList(1, services.size()).toArray(new Service[0])));
|
41,144 | LOG.debug("Waiting on latch interrupted {}", name);
Thread.currentThread().interrupt();
} catch (ExecutionException e) {
throw Throwables.propagate(e.getCause());
}
<BUG>List<Service> reverse = Lists.reverse(services);
Services.chainStop(reverse.get(0), reverse.subList(1, reverse.size()).toArray(new Service[0]));
</BUG>
LOG.info("Runnable stopped {}", name);
}
| Futures.getUnchecked(
Services.chainStop(reverse.get(0), reverse.subList(1, reverse.size()).toArray(new Service[0])));
|
41,145 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
setOutlineProvider(ViewOutlineProvider.BOUNDS);
}
}
@Override
<BUG>public void draw(@NonNull Canvas canvas) {
if (cornerRadius > 0 && getWidth() > 0 && getHeight() > 0 && Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT_WATCH) {</BUG>
int saveCount = canvas.saveLayer(0, 0, getWidth(), getHeight(), null, Canvas.ALL_SAVE_FLAG);
super.draw(canvas);
paint.setXfermode(pdMode);
| drawCalled = true;
if (cornerRadius > 0 && getWidth() > 0 && getHeight() > 0 && Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT_WATCH) {
|
41,146 | import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.LocalFileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.permission.FsPermission;
import org.apache.hadoop.util.Progressable;
<BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*;
public class S3AFileSystem extends FileSystem {</BUG>
private URI uri;
private Path workingDir;
private AmazonS3Client s3;
| import static org.apache.hadoop.fs.s3a.Constants.*;
public class S3AFileSystem extends FileSystem {
|
41,147 | public void initialize(URI name, Configuration conf) throws IOException {
super.initialize(name, conf);
uri = URI.create(name.getScheme() + "://" + name.getAuthority());
workingDir = new Path("/user", System.getProperty("user.name")).makeQualified(this.uri,
this.getWorkingDirectory());
<BUG>String accessKey = conf.get(ACCESS_KEY, null);
String secretKey = conf.get(SECRET_KEY, null);
</BUG>
String userInfo = name.getUserInfo();
| String accessKey = conf.get(NEW_ACCESS_KEY, conf.get(OLD_ACCESS_KEY, null));
String secretKey = conf.get(NEW_SECRET_KEY, conf.get(OLD_SECRET_KEY, null));
|
41,148 | } else {
accessKey = userInfo;
}
}
AWSCredentialsProviderChain credentials = new AWSCredentialsProviderChain(
<BUG>new S3ABasicAWSCredentialsProvider(accessKey, secretKey),
new InstanceProfileCredentialsProvider(),
new S3AAnonymousAWSCredentialsProvider()
);</BUG>
bucket = name.getHost();
| new BasicAWSCredentialsProvider(accessKey, secretKey),
new AnonymousAWSCredentialsProvider()
|
41,149 |
awsConf.setSocketTimeout(conf.getInt(SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT));
</BUG>
s3 = new AmazonS3Client(credentials, awsConf);
<BUG>maxKeys = conf.getInt(MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS);
partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE);
partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
</BUG>
if (partSize < 5 * 1024 * 1024) {
| new InstanceProfileCredentialsProvider(),
new AnonymousAWSCredentialsProvider()
bucket = name.getHost();
ClientConfiguration awsConf = new ClientConfiguration();
awsConf.setMaxConnections(conf.getInt(NEW_MAXIMUM_CONNECTIONS, conf.getInt(OLD_MAXIMUM_CONNECTIONS, DEFAULT_MAXIMUM_CONNECTIONS)));
awsConf.setProtocol(conf.getBoolean(NEW_SECURE_CONNECTIONS, conf.getBoolean(OLD_SECURE_CONNECTIONS, DEFAULT_SECURE_CONNECTIONS)) ? Protocol.HTTPS : Protocol.HTTP);
awsConf.setMaxErrorRetry(conf.getInt(NEW_MAX_ERROR_RETRIES, conf.getInt(OLD_MAX_ERROR_RETRIES, DEFAULT_MAX_ERROR_RETRIES)));
awsConf.setSocketTimeout(conf.getInt(NEW_SOCKET_TIMEOUT, conf.getInt(OLD_SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT)));
maxKeys = conf.getInt(NEW_MAX_PAGING_KEYS, conf.getInt(OLD_MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS));
partSize = conf.getLong(NEW_MULTIPART_SIZE, conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE));
partSizeThreshold = conf.getInt(NEW_MIN_MULTIPART_THRESHOLD, conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD));
|
41,150 | cannedACL = null;
}
if (!s3.doesBucketExist(bucket)) {
throw new IOException("Bucket " + bucket + " does not exist");
}
<BUG>boolean purgeExistingMultipart = conf.getBoolean(PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART);
long purgeExistingMultipartAge = conf.getLong(PURGE_EXISTING_MULTIPART_AGE, DEFAULT_PURGE_EXISTING_MULTIPART_AGE);
</BUG>
if (purgeExistingMultipart) {
| boolean purgeExistingMultipart = conf.getBoolean(NEW_PURGE_EXISTING_MULTIPART, conf.getBoolean(OLD_PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART));
long purgeExistingMultipartAge = conf.getLong(NEW_PURGE_EXISTING_MULTIPART_AGE, conf.getLong(OLD_PURGE_EXISTING_MULTIPART_AGE, DEFAULT_PURGE_EXISTING_MULTIPART_AGE));
|
41,151 | import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
<BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*;
public class S3AOutputStream extends OutputStream {</BUG>
private OutputStream backupStream;
private File backupFile;
private boolean closed;
| import static org.apache.hadoop.fs.s3a.Constants.*;
public class S3AOutputStream extends OutputStream {
|
41,152 | this.client = client;
this.progress = progress;
this.fs = fs;
this.cannedACL = cannedACL;
this.statistics = statistics;
<BUG>partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE);
partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
</BUG>
if (conf.get(BUFFER_DIR, null) != null) {
| partSize = conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE);
partSizeThreshold = conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
|
41,153 | 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;
|
41,154 | 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;
|
41,155 | 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"),
|
41,156 | 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] |
41,157 | 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) {
|
41,158 | 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;
|
41,159 | 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() {
|
41,160 | import de.vanita5.twittnuker.receiver.NotificationReceiver;
import de.vanita5.twittnuker.service.LengthyOperationsService;
import de.vanita5.twittnuker.util.ActivityTracker;
import de.vanita5.twittnuker.util.AsyncTwitterWrapper;
import de.vanita5.twittnuker.util.DataStoreFunctionsKt;
<BUG>import de.vanita5.twittnuker.util.DataStoreUtils;
import de.vanita5.twittnuker.util.ImagePreloader;</BUG>
import de.vanita5.twittnuker.util.InternalTwitterContentUtils;
import de.vanita5.twittnuker.util.JsonSerializer;
import de.vanita5.twittnuker.util.NotificationManagerWrapper;
| import de.vanita5.twittnuker.util.DebugLog;
import de.vanita5.twittnuker.util.ImagePreloader;
|
41,161 | final List<InetAddress> addresses = mDns.lookup(host);
for (InetAddress address : addresses) {
c.addRow(new String[]{host, address.getHostAddress()});
}
} catch (final IOException ignore) {
<BUG>if (BuildConfig.DEBUG) {
Log.w(LOGTAG, ignore);
}</BUG>
}
| DebugLog.w(LOGTAG, null, ignore);
|
41,162 | @Override
public void afterExecute(Bus handler, SingleResponse<Relationship> result) {
if (result.hasData()) {
handler.post(new FriendshipUpdatedEvent(accountKey, userKey, result.getData()));
} else if (result.hasException()) {
<BUG>if (BuildConfig.DEBUG) {
Log.w(LOGTAG, "Unable to update friendship", result.getException());
}</BUG>
}
| public UserKey[] getAccountKeys() {
return DataStoreUtils.getActivatedAccountKeys(context);
|
41,163 | MicroBlog microBlog = MicroBlogAPIFactory.getInstance(context, accountId);
if (!Utils.isOfficialCredentials(context, accountId)) continue;
try {
microBlog.setActivitiesAboutMeUnread(cursor);
} catch (MicroBlogException e) {
<BUG>if (BuildConfig.DEBUG) {
Log.w(LOGTAG, e);
}</BUG>
}
| DebugLog.w(LOGTAG, null, e);
|
41,164 | FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
twitter.updateProfileBannerImage(fileBody);
} finally {
<BUG>Utils.closeSilently(fileBody);
if (deleteImage && "file".equals(imageUri.getScheme())) {
final File file = new File(imageUri.getPath());
if (!file.delete()) {
Log.w(LOGTAG, String.format("Unable to delete %s", file));
}</BUG>
}
| if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
41,165 | FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
twitter.updateProfileBackgroundImage(fileBody, tile);
} finally {
<BUG>Utils.closeSilently(fileBody);
if (deleteImage && "file".equals(imageUri.getScheme())) {
final File file = new File(imageUri.getPath());
if (!file.delete()) {
Log.w(LOGTAG, String.format("Unable to delete %s", file));
}</BUG>
}
| twitter.updateProfileBannerImage(fileBody);
if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
41,166 | FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
return twitter.updateProfileImage(fileBody);
} finally {
<BUG>Utils.closeSilently(fileBody);
if (deleteImage && "file".equals(imageUri.getScheme())) {
final File file = new File(imageUri.getPath());
if (!file.delete()) {
Log.w(LOGTAG, String.format("Unable to delete %s", file));
}</BUG>
}
| twitter.updateProfileBannerImage(fileBody);
if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
41,167 | import de.vanita5.twittnuker.annotation.CustomTabType;
import de.vanita5.twittnuker.library.MicroBlog;
import de.vanita5.twittnuker.library.MicroBlogException;
import de.vanita5.twittnuker.library.twitter.model.RateLimitStatus;
import de.vanita5.twittnuker.library.twitter.model.Status;
<BUG>import de.vanita5.twittnuker.fragment.AbsStatusesFragment;
import org.mariotaku.sqliteqb.library.AllColumns;</BUG>
import org.mariotaku.sqliteqb.library.Columns;
import org.mariotaku.sqliteqb.library.Columns.Column;
import org.mariotaku.sqliteqb.library.Expression;
| import org.mariotaku.pickncrop.library.PNCUtils;
import org.mariotaku.sqliteqb.library.AllColumns;
|
41,168 | context.getApplicationContext().sendBroadcast(intent);
}
}
@Nullable
public static Location getCachedLocation(Context context) {
<BUG>if (BuildConfig.DEBUG) {
Log.v(LOGTAG, "Fetching cached location", new Exception());
}</BUG>
Location location = null;
| DebugLog.v(LOGTAG, "Fetching cached location", new Exception());
|
41,169 | import java.util.List;
import java.util.Map.Entry;
import javax.inject.Singleton;
import okhttp3.Dns;
@Singleton
<BUG>public class TwidereDns implements Constants, Dns {
</BUG>
private static final String RESOLVER_LOGTAG = "TwittnukerDns";
private final SharedPreferences mHostMapping;
private final SharedPreferencesWrapper mPreferences;
| public class TwidereDns implements Dns, Constants {
|
41,170 | for (Location location : twitter.getAvailableTrends()) {
map.put(location);
}
return map.pack();
} catch (final MicroBlogException e) {
<BUG>if (BuildConfig.DEBUG) {
Log.w(LOGTAG, e);
}</BUG>
}
| DebugLog.w(LOGTAG, null, e);
|
41,171 | writer.print(cArgTypeName);
writer.print(") ( JNI_TRUE == " + isNIOArgName(i) + " ? ");
writer.print(" (*env)->GetDirectBufferAddress(env, " + javaArgName + ") : ");
writer.print(" (*env)->GetPrimitiveArrayCritical(env, " + javaArgName + ", NULL) );");
} else {
<BUG>if (!isBaseTypeConst(cArgType) &&
</BUG>
!javaArgType.isArrayOfCompoundTypeWrappers()) {
throw new GlueGenException(
"Cannot copy data for ptr-to-ptr arg type \"" + cArgType.getDebugString() +
| if (!cArgType.isBaseTypeConst() &&
|
41,172 | </BUG>
writer.print(" (*env)->ReleasePrimitiveArrayCritical(env, " + javaArgName + ", " + convName + ", "+modeFlag+");");
} else {
writer.println(" if ( NULL != " + javaArgName + " ) {");
<BUG>if (!isBaseTypeConst(cArgType)) {
</BUG>
if (javaArgType.isArrayOfCompoundTypeWrappers()) {
writer.println(" _tmpArrayLen = (*env)->GetArrayLength(env, " + javaArgName + ");");
writer.println(" for (_copyIndex = 0; _copyIndex < _tmpArrayLen; ++_copyIndex) {");
writer.println(" _tmpObj = (*env)->GetObjectArrayElement(env, " + javaArgName + ", _copyIndex);");
| final boolean needsDataCopy = javaArgTypeNeedsDataCopy(javaArgType);
final String convName = pointerConversionArgumentName(javaArgName);
if (!needsDataCopy) {
writer.println(" if ( JNI_FALSE == " + isNIOArgName(i) + " && NULL != " + javaArgName + " ) {");
final String modeFlag = cArgType.isBaseTypeConst() ? "JNI_ABORT" : "0" ;
if (!cArgType.isBaseTypeConst()) {
|
41,173 | mode = 88;
} else {
final String wmsg = "Assumed return size of equivalent C return type";
writer.println("sizeof(" + cReturnType.getCName() + ") ); // WARNING: "+wmsg);
mode = 99;
<BUG>LOG.warning(
"No capacity specified for java.nio.Buffer return " +</BUG>
"value for function \"" + binding.getName() + "\". " + wmsg + " (sizeof(" + cReturnType.getCName() + ")): " + binding);
}
}
| LOG.warning(binding.getCSymbol().getASTLocusTag(),
"No capacity specified for java.nio.Buffer return " +
|
41,174 | String cElementTypeName = "char *";
final PointerType cPtrType = cType.asPointer();
if (cPtrType != null) {
cElementTypeName = cPtrType.getTargetType().asPointer().getCName();
}
<BUG>if (isBaseTypeConst(cType)) {
</BUG>
writer.print("const ");
}
writer.print(cElementTypeName+" *");
| if (cType.isBaseTypeConst()) {
|
41,175 | </BUG>
writer.print("const ");
}
writer.print(cElementTypeName+" *");
} else {
<BUG>if (isBaseTypeConst(cType)) {
</BUG>
writer.print("const ");
}
writer.print(ptrTypeString);
| String cElementTypeName = "char *";
final PointerType cPtrType = cType.asPointer();
if (cPtrType != null) {
cElementTypeName = cPtrType.getTargetType().asPointer().getCName();
if (cType.isBaseTypeConst()) {
if (cType.isBaseTypeConst()) {
|
41,176 | final Set<String> aliases = symbol.getAliasedNames();
if ( extendedIntfSymbolsIgnore.contains( name ) ||
oneInSet(extendedIntfSymbolsIgnore, aliases)
)
{
<BUG>LOG.log(INFO, "Ignore Intf ignore (one): {0}", symbol.getAliasedString());
</BUG>
return true;
}
if ( !extendedIntfSymbolsOnly.isEmpty() &&
| LOG.log(INFO, getASTLocusTag(symbol), "Ignore Intf ignore (one): {0}", symbol.getAliasedString());
|
41,177 | return true;
}
if ( !extendedIntfSymbolsOnly.isEmpty() &&
!extendedIntfSymbolsOnly.contains( name ) &&
!oneInSet(extendedIntfSymbolsOnly, aliases) ) {
<BUG>LOG.log(INFO, "Ignore Intf !extended (all): {0}", symbol.getAliasedString());
</BUG>
return true;
}
return shouldIgnoreInImpl_Int(symbol);
| LOG.log(INFO, getASTLocusTag(symbol), "Ignore Intf !extended (all): {0}", symbol.getAliasedString());
|
41,178 | final Set<String> aliases = symbol.getAliasedNames();
if ( extendedImplSymbolsIgnore.contains( name ) ||
oneInSet(extendedImplSymbolsIgnore, aliases)
)
{
<BUG>LOG.log(INFO, "Ignore Impl ignore (one): {0}", symbol.getAliasedString());
</BUG>
return true;
}
if ( !extendedImplSymbolsOnly.isEmpty() &&
| LOG.log(INFO, getASTLocusTag(symbol), "Ignore Impl ignore (one): {0}", symbol.getAliasedString());
|
41,179 | return true;
}
if ( !extendedImplSymbolsOnly.isEmpty() &&
!extendedImplSymbolsOnly.contains( name ) &&
!oneInSet(extendedImplSymbolsOnly, aliases) ) {
<BUG>LOG.log(INFO, "Ignore Impl !extended (all): {0}", symbol.getAliasedString());
</BUG>
return true;
}
for (final Pattern ignoreRegexp : ignores) {
| LOG.log(INFO, getASTLocusTag(symbol), "Ignore Impl !extended (all): {0}", symbol.getAliasedString());
|
41,180 | if (ignoreNots.size() > 0) {
for (final Pattern ignoreNotRegexp : ignoreNots) {
final Matcher matcher = ignoreNotRegexp.matcher(name);
if ( !matcher.matches() && !onePatternMatch(ignoreNotRegexp, aliases) ) {
if(unignores.isEmpty()) {
<BUG>LOG.log(INFO, "Ignore Impl unignores==0: {0} -> {1}", symbol.getAliasedString(), name);
</BUG>
return true;
}
boolean unignoreFound = false;
| LOG.log(INFO, getASTLocusTag(symbol), "Ignore Impl unignores==0: {0} -> {1}", symbol.getAliasedString(), name);
|
41,181 | @Override
public void onCreate() {
super.onCreate();
try {
init();
<BUG>String workingPatchApkChecksum = sharedPref.getString(WORKING_PATCH_APK_CHECKSUM, "");
Log.e(TAG, "working checksum: " + workingPatchApkChecksum);
</BUG>
if (PatchChecker.checkUpgrade(this)) {
Log.d(TAG, "Host app has upgrade");
| String workingChecksum = PatchInfoUtil.getWorkingChecksum(this);
Log.e(TAG, "#onCreate working checksum: " + workingChecksum);
|
41,182 | Log.e(TAG, String.format("layoutId-->%d, themeId-->%d", layoutId, themeId));
releaseDex(checksum, layoutId, themeId);
Log.e(TAG, "release apk once");
}
private static final int SLEEP_DURATION = 200;
<BUG>private boolean isDexOptDone(String checksum) {
return getSharedPreferences(SP_NAME, Context.MODE_MULTI_PROCESS)
.getBoolean(checksum, false);</BUG>
}
private void waitDexOptDone(String checksum, int layoutId, int themeId) {
| return PatchInfoUtil.isDexFileOptimized(this, checksum);
|
41,183 | waitDexOptDone(checksum, layoutId, themeId);
}
}
}
private boolean isPatchApkFirstRun(String checksum) {
<BUG>return !sharedPref.getString(WORKING_PATCH_APK_CHECKSUM, "").equals(checksum);
}</BUG>
private boolean isOptedDexExists(String checksum) {
return amigoDirs.dexOptDir(checksum).listFiles() != null
&& amigoDirs.dexOptDir(checksum).listFiles().length > 0;
| return !PatchInfoUtil.getWorkingChecksum(this).equals(checksum);
|
41,184 | Object callback = readField(handler, "mCallback", true);
if (callback != null) {
Field[] fields = callback.getClass().getDeclaredFields();
for (Field field : fields) {
Object obj = readField(field, callback, true);
<BUG>if (!obj.getClass().getName().equals(AmigoCallback.class.getName())) {
</BUG>
continue;
}
writeField(field, callback, null, true);
| if (obj == null || !obj.getClass().getName().equals(AmigoCallback.class.getName())) {
|
41,185 | }
return false;
}
private static boolean checkAndSetAmigoClassLoader(Context context) {
try {
<BUG>String clName = context.getClassLoader().getClass().getName();
if (clName.equals(AmigoClassLoader.class.getName())) {
</BUG>
return false;
| public static boolean rollAmigoBack(Context context) {
return checkAndSetAmigoCallback(context) || checkAndSetAmigoClassLoader(context);
|
41,186 | package me.ele.amigo;
import android.content.Context;
<BUG>import android.content.pm.ApplicationInfo;
import java.io.File;
import java.util.HashMap;</BUG>
import java.util.Map;
import me.ele.amigo.utils.CommonUtils;
| import android.util.Log;
import java.util.Arrays;
import java.util.HashMap;
|
41,187 | import java.util.Map;
import me.ele.amigo.utils.CommonUtils;
import me.ele.amigo.utils.FileUtils;
public final class AmigoDirs {
private static final String TAG = AmigoDirs.class.getSimpleName();
<BUG>private static final String CODE_CACHE_NAME = "code_cache";
private static final String CODE_CACHE_AMIGO_DEX_FOLDER_NAME = "amigo-dexes";</BUG>
private static final String AMIGO_FOLDER_NAME = "amigo";
private static final String AMIGO_DEX_FOLDER_NAME = "dexes";
| private static final String CODE_CACHE_NAME = "code_cache/amigo_odex";
|
41,188 | }
return sInstance;
}
private Context context;
private File amigoDir;
<BUG>private File cacheDir;
</BUG>
private Map<String, File> optDirs = new HashMap<>();
private Map<String, File> dexDirs = new HashMap<>();
private Map<String, File> libDirs = new HashMap<>();
| private File odexDir;
|
41,189 | public File libDir(String checksum) {
ensurePatchDirs(checksum);
return libDirs.get(checksum);
}
private void ensureAmigoDir() throws RuntimeException {
<BUG>if (amigoDir != null && amigoDir.exists() && cacheDir != null && cacheDir.exists()) return;
</BUG>
try {
ApplicationInfo applicationInfo = CommonUtils.getApplicationInfo(context);
if (applicationInfo == null) {
| if (amigoDir != null && amigoDir.exists() && odexDir != null && odexDir.exists()) return;
|
41,190 | ApplicationInfo applicationInfo = CommonUtils.getApplicationInfo(context);
if (applicationInfo == null) {
return;
}
amigoDir = new File(context.getFilesDir().getCanonicalPath(), AMIGO_FOLDER_NAME);
<BUG>FileUtils.mkdirChecked(amigoDir);
cacheDir = new File(new File(applicationInfo.dataDir).getCanonicalPath(), CODE_CACHE_NAME);
FileUtils.mkdirChecked(cacheDir);
} catch (Exception e) {</BUG>
throw new RuntimeException("Initiate amigo files failed (" + e.getMessage() + ").");
| amigoDir.mkdirs();
odexDir = new File(new File(applicationInfo.dataDir).getCanonicalPath(),
odexDir.mkdirs();
} catch (Exception e) {
|
41,191 | import android.app.IntentService;
import android.app.Service;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
<BUG>import android.content.ServiceConnection;
import android.os.Handler;</BUG>
import android.os.IBinder;
import android.os.Message;
import android.os.Messenger;
| import android.os.Binder;
import android.os.Handler;
|
41,192 | private static final String TAG = AmigoService.class.getSimpleName();
private static final String ACTION_RELEASE_DEX = "release_dex";
private static final String ACTION_RESTART_MANI_PROCESS = "restart_main_process";
private static final String EXTRA_APK_CHECKSUM = "apk_checksum";
private Handler handler = null;
<BUG>private int retryCount = 0;
private Messenger messenger; // don't support multiple client
private int outMsg;</BUG>
private IAmigoService iAmigoService = new IAmigoService.Stub() {
@Override
| private SparseArray<IBinder> clients = new SparseArray<>();
|
41,193 | Log.d(TAG, "onUnbind: " + intent);
return super.onUnbind(intent);
}
@Override
public void onDestroy() {
<BUG>Log.d(TAG, "onDestroy: ");
super.onDestroy();</BUG>
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
| clients.clear();
super.onDestroy();
|
41,194 | public abstract class MUDObject {
public static MUDServer parent;
private int dbref = 0; // database reference number
protected String name = ""; // object name
protected String desc = ""; // object description
<BUG>protected TypeFlag type = TypeFlag.NONE; // object type
</BUG>
protected EnumSet<ObjectFlag> flags = EnumSet.noneOf(ObjectFlag.class); // object flags
protected Object locks = ""; // object locks
protected int location = 0; // object location
| protected TypeFlag type = TypeFlag.OBJECT; // object type
|
41,195 | effect = this.effects.get(e);
if (effect.getName().equals(tEffect)) {
this.effects.remove(effect);
}
}
<BUG>}
public void removeEffects()</BUG>
{
this.effects.clear();
}
| public void removeEffect(Effect effect) {
public void removeEffects()
|
41,196 | for (int i = 0; i < dimX; i++)
{
for (int j = 0; j < dimY; j++)
{
int id = 0;
<BUG>Room room = new Room(id, instance_name + " Room (" + i + ", " + j + ")", EnumSet.of(ObjectFlag.ROOM, ObjectFlag.DARK), "You see nothing.", 0);
roomIds[counter] = room.getDBRef();</BUG>
counter = counter + 1;
dRooms[i][j] = room;
}
| Room room = new Room(id, instance_name + " Room (" + i + ", " + j + ")", EnumSet.of(ObjectFlag.DARK), "You see nothing.", 0);
roomIds[counter] = room.getDBRef();
|
41,197 | for (int i = 0; i < dimX; i++)
{
for (int j = 0; j < dimY; j++)
{
int id = 0;
<BUG>Room room = new Room(id, instance_name + " Room (" + i + ", " + j + ")", EnumSet.of(ObjectFlag.ROOM, ObjectFlag.DARK), "You see nothing.", 0);
roomIds[counter] = room.getDBRef();</BUG>
counter = counter + 1;
dRooms[i][j] = room;
}
| Room room = new Room(id, instance_name + " Room (" + i + ", " + j + ")", EnumSet.of(ObjectFlag.DARK), "You see nothing.", 0);
roomIds[counter] = room.getDBRef();
|
41,198 | Assert.assertEquals(msg, result2);
}
@Test
public void testAsciiConverter() {
HttpResponse response = createOkResponse();
<BUG>byte[] payload = parser.marshalToBytes(response);
</BUG>
ConvertAscii converter = new ConvertAscii();
String readableForm = converter.convertToReadableForm(payload);
Assert.assertEquals(
| byte[] payload = unwrap(parser.marshalToByteBuffer(response));
|
41,199 | Assert.assertEquals(response, httpMessage);
}
@Test
public void test2AndHalfHttpMessages() {
HttpResponse response = createOkResponse();
<BUG>byte[] payload = parser.marshalToBytes(response);
</BUG>
byte[] first = new byte[2*payload.length + 20];
byte[] second = new byte[payload.length - 20];
System.arraycopy(payload, 0, first, 0, payload.length);
| byte[] payload = unwrap(parser.marshalToByteBuffer(response));
|
41,200 | DataWrapper payload1 = dataGen.wrapByteArray("0123456789".getBytes());
HttpChunk chunk = new HttpChunk();
chunk.addExtension(new HttpChunkExtension("asdf", "value"));
chunk.addExtension(new HttpChunkExtension("something"));
chunk.setBody(payload1);
<BUG>byte[] payload = parser.marshalToBytes(chunk);
</BUG>
String str = new String(payload);
Assert.assertEquals("a;asdf=value;something\r\n0123456789\r\n", str);
HttpLastChunk lastChunk = new HttpLastChunk();
| byte[] payload = unwrap(parser.marshalToByteBuffer(chunk));
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.