id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
24,201
if (maxMessagesPerPoll > 0 && total > maxMessagesPerPoll) { LOG.debug("Limiting to maximum messages to poll " + maxMessagesPerPoll + " as there was " + total + " messages in this poll."); total = maxMessagesPerPoll; } for (int index = 0; index < total && isRunAllowed(); index++) { <BUG>MailExchange exchange = (MailExch...
Exchange exchange = (Exchange)exchanges.poll(); exchange.setProperty(Exchange.BATCH_INDEX, index);
24,202
LOG.debug("Fetching " + count + " messages. Total " + messages.length + " messages."); } for (int i = 0; i < count; i++) { Message message = messages[i]; if (!message.getFlags().contains(Flags.Flag.DELETED)) { <BUG>MailExchange exchange = endpoint.createExchange(message); answer.add(exchange);</BUG> } else { if (LOG.is...
answer.add(exchange);
24,203
import javax.mail.Address; import javax.mail.Message; import javax.mail.Session; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; <BUG>import org.apache.camel.Endpoint; import org.apache.camel.test.junit4.CamelTestSupport;</BUG> import org.apache.camel.util.ObjectHelper; import org.ju...
import org.apache.camel.Exchange; import org.apache.camel.test.junit4.CamelTestSupport;
24,204
private MailEndpoint endpoint; private String body = "Hello World!"; @Test public void testMailMessageHandlesMultipleHeaders() throws Exception { mimeMessage.setRecipients(Message.RecipientType.TO, new Address[] {new InternetAddress("foo@localhost"), new InternetAddress("bar@localhost")}); <BUG>MailExchange exchange = ...
MailMessage in = (MailMessage)exchange.getIn(); assertNotNull(in); assertEquals("mail body", body, in.getBody());
24,205
} } @Test public void testMailMessageHandlesSingleHeader() throws Exception { mimeMessage.setRecipients(Message.RecipientType.TO, new Address[] {new InternetAddress("frank@localhost")}); <BUG>MailExchange exchange = endpoint.createExchange(mimeMessage); MailMessage in = exchange.getIn(); Object header = in.getHeader("...
i++; MailMessage in = (MailMessage)exchange.getIn(); assertNotNull(in); Object header = in.getHeader("TO");
24,206
import javax.mail.Message; import org.apache.camel.Consumer; import org.apache.camel.Exchange; import org.apache.camel.ExchangePattern; import org.apache.camel.Processor; <BUG>import org.apache.camel.Producer; import org.apache.camel.impl.DefaultHeaderFilterStrategy;</BUG> import org.apache.camel.impl.ScheduledPollEndp...
import org.apache.camel.impl.DefaultExchange; import org.apache.camel.impl.DefaultHeaderFilterStrategy;
24,207
import java.util.Map; import javax.activation.DataHandler; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.Multipart; <BUG>import javax.mail.Part; import org.apache.camel.RuntimeCamelException;</BUG> import org.apache.camel.impl.DefaultMessage; import org.apache.camel.util.CollectionH...
import org.apache.camel.Exchange; import org.apache.camel.RuntimeCamelException;
24,208
if (mailMessage != null) { return "MailMessage: " + MailUtils.dumpMessage(mailMessage); } else { return "MailMessage: " + getBody(); } <BUG>} @Override public MailExchange getExchange() { return (MailExchange)super.getExchange();</BUG> }
[DELETED]
24,209
return new MailMessage(); } @Override protected Object createBody() { if (mailMessage != null) { <BUG>return getExchange().getBinding().extractBodyFromMail(getExchange(), mailMessage); }</BUG> return null; } @Override
MailBinding binding = (MailBinding) getExchange().getProperty(Exchange.BINDING); return binding != null ? binding.extractBodyFromMail(getExchange(), mailMessage) : null;
24,210
Debug.checkNull("mysql_connection", this.mysql_connection); return this.mysql_connection; } @Override public String toString () { <BUG>return "MySQLConnection[" + this.dataSource.getUrl() + " : " + this.dataSource.getURL() + "]"; }</BUG> @Override protected void finalize () throws Throwable { super.finalize();
return "MySQLConnection[" + this.mySQL.getUrl() + "]";
24,211
package com.jfixby.cmns.adopted.gdx.log; import com.badlogic.gdx.Application; import com.badlogic.gdx.Gdx; import com.jfixby.cmns.api.collections.EditableCollection; <BUG>import com.jfixby.cmns.api.collections.Map; import com.jfixby.cmns.api.log.LoggerComponent;</BUG> import com.jfixby.cmns.api.util.JUtils; public clas...
import com.jfixby.cmns.api.err.Err; import com.jfixby.cmns.api.log.LoggerComponent;
24,212
package com.jfixby.red.collections; <BUG>import com.jfixby.cmns.api.java.IntValue; import com.jfixby.cmns.api.math.FloatMath;</BUG> public class RedHistogrammValue { private RedHistogramm master; public RedHistogrammValue (RedHistogramm redHistogramm) {
import com.jfixby.cmns.api.java.Int; import com.jfixby.cmns.api.math.FloatMath;
24,213
public static final String PackageName = "app.version.package_name"; } public static final String VERSION_FILE_NAME = "version.json"; private static final long serialVersionUID = 6662721574596241247L; public String packageName; <BUG>public int major = -1; public int minor = -1; public VERSION_STAGE stage = null; publ...
public String major = ""; public String minor = ""; public String build = "";
24,214
<BUG>package com.jfixby.cmns.db.mysql; import com.jfixby.cmns.api.debug.Debug;</BUG> import com.jfixby.cmns.api.log.L; import com.jfixby.cmns.db.api.DBComponent; import com.mysql.jdbc.jdbc2.optional.MysqlDataSource;
import java.sql.Connection; import java.sql.SQLException; import com.jfixby.cmns.api.debug.Debug;
24,215
} public MySQLTable getTable (final String name) { return new MySQLTable(this, name); } public MySQLConnection obtainConnection () { <BUG>final MySQLConnection connection = new MySQLConnection(this.dataSource); connection.open();</BUG> return connection; } public void releaseConnection (final MySQLConnection connection...
public String getDBName () { return this.dbName; final MySQLConnection connection = new MySQLConnection(this); connection.open();
24,216
if (!inputBuffer.parseRequestLine(keptAlive)) { if (handleIncompleteRequestLineRead()) { break; } } <BUG>if (!endpoint.isPaused()) { request.setStartTime(System.currentTimeMillis());</BUG> keptAlive = true; if ( !inputBuffer.parseHeaders() ) { openSocket = true;
if (endpoint.isPaused()) { response.setStatus(503); adapter.log(request, response, 0); error = true; } else { request.setStartTime(System.currentTimeMillis());
24,217
if (!inputBuffer.parseRequestLine(keptAlive)) { if (handleIncompleteRequestLineRead()) { break; } } <BUG>if (!endpoint.isPaused()) { request.setStartTime(System.currentTimeMillis());</BUG> keptAlive = true; inputBuffer.parseHeaders(); if (!disableUploadTimeout) {
if (endpoint.isPaused()) { response.setStatus(503); adapter.log(request, response, 0); error = true; } else { request.setStartTime(System.currentTimeMillis());
24,218
} else { updateMemo(); callback.updateMemo(); } dismiss(); <BUG>}else{ </BUG> Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show(); } }
[DELETED]
24,219
} @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);
24,220
MemoEntry.COLUMN_REF_TOPIC__ID + " = ?" , new String[]{String.valueOf(topicId)}); } public Cursor selectMemo(long topicId) { Cursor c = db.query(MemoEntry.TABLE_NAME, null, MemoEntry.COLUMN_REF_TOPIC__ID + " = ?", new String[]{String.valueOf(topicId)}, null, null, <BUG>MemoEntry._ID + " DESC", null); </BUG> if (c != nu...
MemoEntry.COLUMN_ORDER + " ASC", null);
24,221
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(
24,222
import android.widget.RelativeLayout; import android.widget.TextView; import com.kiminonawa.mydiary.R; import com.kiminonawa.mydiary.db.DBManager; import com.kiminonawa.mydiary.shared.EditMode; <BUG>import com.kiminonawa.mydiary.shared.ThemeManager; import java.util.List; public class MemoAdapter extends RecyclerView.A...
import com.marshalchen.ultimaterecyclerview.dragsortadapter.DragSortAdapter; public class MemoAdapter extends DragSortAdapter<DragSortAdapter.ViewHolder> implements EditMode {
24,223
private DBManager dbManager; private boolean isEditMode = false; private EditMemoDialogFragment.MemoCallback callback; private static final int TYPE_HEADER = 0; private static final int TYPE_ITEM = 1; <BUG>public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMe...
public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback, RecyclerView recyclerView) { super(recyclerView); this.mActivity = activity;
24,224
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) {
24,225
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;
24,226
customTokens.put("%%mlFinalForestsPerHost%%", hubConfig.finalForestsPerHost.toString()); customTokens.put("%%mlTraceAppserverName%%", hubConfig.traceHttpName); customTokens.put("%%mlTracePort%%", hubConfig.tracePort.toString()); customTokens.put("%%mlTraceDbName%%", hubConfig.traceDbName); customTokens.put("%%mlTraceFo...
customTokens.put("%%mlTriggersDbName%%", hubConfig.triggersDbName); customTokens.put("%%mlSchemasDbName%%", hubConfig.schemasDbName); }
24,227
import java.util.concurrent.locks.ReentrantLock; public class TopicService implements ManagedService, RemoteService, EventPublishingService, ClientProtocolService { public static final String SERVICE_NAME = "hz:impl:topicService"; private final Lock[] orderingLocks = new Lock[1000]; private NodeEngine nodeEngine; <BUG>...
private final ConcurrentMap<String, TopicStatsContainer> topicContainers = new ConcurrentHashMap<String, TopicStatsContainer>(); private final ConcurrencyUtil.ConstructorFunction<String, TopicStatsContainer> topicConstructor = new ConcurrencyUtil.ConstructorFunction<String, TopicStatsContainer>() { public TopicStatsCon...
24,228
TopicEvent topicEvent = (TopicEvent) event; Message message = new Message(topicEvent.name, nodeEngine.toObject(topicEvent.data)); incrementReceivedMessages(topicEvent.name); ((MessageListener) listener).onMessage(message); } <BUG>public TopicContainer getAtomicLongContainer(String name) { </BUG> return ConcurrencyUtil....
public TopicStatsContainer getTopicStatsContainer(String name) {
24,229
final HazelcastInstance keyOwner = nodeFactory.newHazelcastInstance(config); final HazelcastInstance instance1 = nodeFactory.newHazelcastInstance(config); final HazelcastInstance instance2 = nodeFactory.newHazelcastInstance(config); int k = 0; final AtomicInteger atomicInteger = new AtomicInteger(0); <BUG>while (instan...
while (keyOwner.getCluster().getLocalMember().equals(instance1.getPartitionService().getPartition(k++).getOwner())) final int key = k;
24,230
final HazelcastInstance instance = nodeFactory.newHazelcastInstance(config); final AtomicInteger count = new AtomicInteger(0); final int size = 50; int k = 0; final HazelcastInstance keyOwner = nodeFactory.newHazelcastInstance(config); <BUG>while (instance.getPartitionService().getPartition(k++).equals(keyOwner.getClus...
while (keyOwner.getCluster().getLocalMember().equals(instance.getPartitionService().getPartition(k++).getOwner())) final ILock lock = instance.getLock(k);
24,231
import com.hazelcast.nio.serialization.Data; import com.hazelcast.spi.AbstractDistributedObject; import com.hazelcast.spi.EventRegistration; import com.hazelcast.spi.EventService; import com.hazelcast.spi.NodeEngine; <BUG>import com.hazelcast.topic.TopicContainer; </BUG> import com.hazelcast.topic.TopicEvent; import co...
import com.hazelcast.topic.TopicStatsContainer;
24,232
private final String name; private final EventService eventService; private final ConcurrentMap<MessageListener, String> registeredIds = new ConcurrentHashMap<MessageListener, String>(); TopicProxySupport(String name, NodeEngine nodeEngine, TopicService service) { super(nodeEngine, service); <BUG>service.getAtomicLongC...
service.getTopicStatsContainer(name);
24,233
package org.exist.numbering; import java.io.IOException; import org.exist.storage.io.VariableByteOutputStream; public interface NodeId extends Comparable { public final static NodeId DOCUMENT_NODE = new DLN(0); <BUG>public final static NodeId END_OF_DOCUMENT = new DLN(0); public final static int IS_CHILD = 1;</BUG> pub...
public final static NodeId ROOT_NODE = new DLN(1); public final static int IS_CHILD = 1;
24,234
os.clear(); os.writeInt(this.doc.getDocId()); os.writeByte(inUpdateMode ? ENTRIES_UNORDERED : ENTRIES_ORDERED); os.writeInt(gidsCount); int lenOffset = os.position(); <BUG>os.writeFixedInt(0); for (int j = 0; j < gidsCount; j++) {</BUG> NodeProxy storedNode = (NodeProxy) gids.get(j); if (doc.getDocId() != storedNode.ge...
NodeId previous = null; for (int j = 0; j < gidsCount; j++) {
24,235
if (doc.getDocId() != storedNode.getDocument().getDocId()) { throw new IllegalArgumentException("Document id ('" + doc.getDocId() + "') and proxy id ('" + storedNode.getDocument().getDocId() + "') differ !"); } try { <BUG>storedNode.getNodeId().write(os); </BUG> } catch (IOException e) { LOG.warn("IO error while writin...
previous = storedNode.getNodeId().write(previous, os);
24,236
long address = StorageAddress.read(is); storedNode.setInternalAddress(address); storedNode.setNodeType(nodeType); result.add(storedNode, gidsCount); } else { is.skip(3); sameDocSet = false; } } } <BUG>nodeId = broker.getBrokerPool().getNodeFactory().createFromStream(is); </BUG> result.setSorted(storedDocument, ordered ...
while (true) { int relation = nodeId.computeRelation(ancestorId); if (relation != -1) { if (((axis == Constants.CHILD_AXIS || axis == Constants.ATTRIBUTE_AXIS) && relation == NodeId.IS_CHILD) || (axis == Constants.DESCENDANT_AXIS && relation == NodeId.IS_DESCENDANT) || axis == Constants.DESCENDANT_SELF_AXIS || axis == ...
24,237
System.out.println("Data length: " + data.length); VariableByteArrayInput is = new VariableByteArrayInput(data); DLNFactory fact = new DLNFactory(); previous = null; for (int i = 0; i < ids.length; i++) { <BUG>previous = (DLN) fact.createFromStream(previous, is); System.out.println(previous.debug()); </BUG> } os = new ...
previous = fact.createFromStream(previous, is); System.out.println(previous.toString());
24,238
System.out.println(previous.debug()); </BUG> } os = new VariableByteOutputStream(); for (int i = 0; i < ids.length; i++) { <BUG>DLN id = ids[i]; System.out.println(id.debug()); </BUG> id.write(os);
System.out.println("Data length: " + data.length); VariableByteArrayInput is = new VariableByteArrayInput(data); DLNFactory fact = new DLNFactory(); previous = null; previous = fact.createFromStream(previous, is); System.out.println(previous.toString()); NodeId id = ids[i]; System.out.println(id.toString());
24,239
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() );
24,240
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_();
24,241
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 );
24,242
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 );
24,243
sink.tableCaption(); sink.text( getI18nString( locale, "stats.caption" ) ); sink.tableCaption_();</BUG> sink.tableRow(); <BUG>sink.tableHeaderCell(); sink.text( getI18nString( locale, "stats.subprojects" ) + ":" ); sink.tableHeaderCell_();</BUG> sink.tableCell(); sink.text( String.valueOf( reactorProjects.size() ) ); s...
sink.bold(); sink.bold_(); sink.tableCaption_(); sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.subprojects" ) ); sink.tableHeaderCell_();
24,244
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_();
24,245
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_();
24,246
{ ReverseDependencyLink p1 = (ReverseDependencyLink) o1; ReverseDependencyLink p2 = (ReverseDependencyLink) o2; return p1.getProject().getId().compareTo( p2.getProject().getId() ); } <BUG>else {</BUG> return 0; } }
iconError( sink );
24,247
import android.content.Context; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.ViewConfiguration; public class SwipeRefreshLayout extends android.support.v4.widget.SwipeRefreshLayout { <BUG>public interface ChildScrollDelegate { boolean canChildScrollUp(); }</BUG> private int mTo...
[DELETED]
24,248
public void setChildScrollDelegate(ChildScrollDelegate delegate) { mChildScrollDelegate = delegate; } @Override public boolean canChildScrollUp() { <BUG>if (mChildScrollDelegate != null) { return mChildScrollDelegate.canChildScrollUp(); } return super.canChildScrollUp(); }</BUG> @Override
return super.canChildScrollUp() || (mChildScrollDelegate != null && mChildScrollDelegate.canChildScrollUp());
24,249
getResources().getColor(R.color.accent), 0); } @Override public boolean canChildScrollUp() { BaseFragment content = getContentFragment(); <BUG>return content != null ? content.canChildScrollUp() : false; </BUG> } @Override protected void onPostCreate(Bundle savedInstanceState) {
return content != null && content.canChildScrollUp();
24,250
if (adapter == null) { return; } activity.supportInvalidateOptionsMenu(); adapter.attach(DeviceDetailFragment.this.getActivity()); <BUG>ScrollView scrollView = (ScrollView) getView().findViewById(R.id.deviceDetailView); if (scrollView != null) {</BUG> scrollView.removeAllViews(); scrollView.addView(adapter.createDetail...
ScrollView scrollView = findScrollView(); if (scrollView != null) {
24,251
scrollView.removeAllViews(); scrollView.addView(adapter.createDetailView(activity, device, lastUpdate)); } } } <BUG>})); }</BUG> @Override public CharSequence getTitle(Context context) { String name = getArguments().getString(BundleExtraKeys.DEVICE_DISPLAY_NAME);
private ScrollView findScrollView() { return (ScrollView) getView().findViewById(R.id.deviceDetailView);
24,252
private volatile IndexProvider localIndexProvider; private final int machineId; private volatile MasterServer masterServer; private final AtomicBoolean reevaluatingMyself = new AtomicBoolean(); private ScheduledExecutorService updatePuller; <BUG>private volatile Machine cachedMaster = Machine.NO_MACHINE; private volati...
[DELETED]
24,253
System.out.println( "looked up master " + master ); master = broker.getMasterReally(); <BUG>} boolean iAmCurrentlyMaster = masterServer != null; boolean restarted = false; if ( cachedMaster.getMachineId() != master.other().getMachineId() ) {</BUG> if ( master.other().getMachineId() == machineId ) { if ( this.localGraph...
[DELETED]
24,254
if ( this.localGraph == null || !iAmCurrentlyMaster ) { internalShutdown(); startAsMaster(); restarted = true; <BUG>} }</BUG> else { if ( this.localGraph == null || iAmCurrentlyMaster )
broker.rebindMaster();
24,255
startAsSlave(); tryToEnsureIAmNotABrokenMachine( master ); restarted = true; } } <BUG>} if ( masterServer != null ) { broker.rebindMaster(); }</BUG> if ( restarted )
[DELETED]
24,256
this.localGraph.registerKernelEventHandler( handler ); } this.localDataSourceManager = localGraph.getConfig().getTxModule().getXaDataSourceManager(); } <BUG>cachedMaster = master.other(); started = true;</BUG> } finally {
[DELETED]
24,257
connectedSlaveChannels.remove( channel ); } } public void shutdown() { <BUG>deadConnectionsPoller.shutdown(); channelGroup.close().awaitUninterruptibly();</BUG> } private boolean channelIsClosed( Channel channel ) {
System.out.println( "Master server shutdown, closing all channels" ); channelGroup.close().awaitUninterruptibly();
24,258
if(world.getBlockState(pos.up(height*2/3)).getMaterial().isLiquid()) //At least 1/3rd of the height should be above the liquid surface return null; float plateauSize = 0.2F + random.nextFloat()*(height/25F); BlockPos nodePos = generateRock(pos.up(height), height, plateauSize, world, random, provider); return nodePos; <...
[DELETED]
24,259
import java.util.Iterator; import java.util.Random; import net.minecraft.block.state.IBlockState; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; <BUG>import com.mraof.minestuck.world.biome.BiomeMinestuck; import com.mraof.minestuck.world.lands.gen.ChunkProviderLands; public class BlockBlobDe...
import net.minecraft.world.biome.Biome; public class BlockBlobDecorator extends BiomeSpecificDecorator //A version of WorldGenBlockBlob slightly adapted to this usage area
24,260
import com.mraof.minestuck.world.lands.gen.ChunkProviderLands; public class BlockBlobDecorator implements ILandDecorator //A version of WorldGenBlockBlob slightly adapted to this usage area </BUG> { private IBlockState block; <BUG>private int size; public BlockBlobDecorator(IBlockState block, int size) { this.block = ...
public class BlockBlobDecorator extends BiomeSpecificDecorator //A version of WorldGenBlockBlob slightly adapted to this usage area private int count; public BlockBlobDecorator(IBlockState block, int size, int count, Biome... biomes) super(biomes); this.count = count; this.size = size;
24,261
{ this.block = block; this.size = size;</BUG> } @Override <BUG>public BlockPos generate(World world, Random random, int chunkX, int chunkZ, ChunkProviderLands provider) { for(int i = 0; i < random.nextInt(4); i++) { BlockPos pos = world.getHeight(new BlockPos((chunkX << 4) + 8 + random.nextInt(16), 0, (chunkZ << 4) + ...
private IBlockState block; private int size; private int count; public BlockBlobDecorator(IBlockState block, int size, int count, Biome... biomes) super(biomes); this.count = count; this.size = size; public BlockPos generate(World world, Random random, BlockPos pos, ChunkProviderLands provider)
24,262
BlockPos blockpos1 = (BlockPos)iterator.next(); if (blockpos1.distanceSq(pos) <= (double)(f * f)) world.setBlockState(blockpos1, block, 2); } pos = pos.add(-(size + 1) + random.nextInt(2 + size * 2), 0 - random.nextInt(2), -(size + 1) + random.nextInt(2 + size * 2)); <BUG>} } return null; </BUG> }
[DELETED]
24,263
package com.mraof.minestuck.world.lands.decorator; import java.util.Random; import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; import net.minecraft.util.math.BlockPos; <BUG>import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenAbstractTree;</BUG> import net.minecr...
import net.minecraft.world.biome.Biome; import net.minecraft.world.gen.feature.WorldGenAbstractTree;
24,264
if (javaClass == null) { cacheNegativeValue(javaClassToKotlinFqName(qualifiedName)); return null; } if (KotlinBuiltIns.BUILT_INS_PACKAGE_FQ_NAME.equals(qualifiedName.parent())) { <BUG>if (javaClass.findAnnotation(JvmAnnotationNames.ASSERT_INVISIBLE_IN_RESOLVER.getFqName().asString()) != null) { if (ApplicationManager.g...
if (javaClass.findAnnotation(JvmAnnotationNames.ASSERT_INVISIBLE_IN_RESOLVER.getFqName()) != null) { if (ApplicationManager.getApplication().isInternal()) {
24,265
package org.jetbrains.jet.lang.resolve.java.structure; <BUG>import com.intellij.psi.*; import com.intellij.util.containers.ContainerUtil;</BUG> import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable;
import com.intellij.psi.JavaPsiFacade; import com.intellij.psi.PsiClass; import com.intellij.psi.PsiCompiledElement; import com.intellij.psi.PsiTypeParameter; import com.intellij.util.containers.ContainerUtil;
24,266
} public static boolean isCompiledKotlinPackageClass(@NotNull JavaClass javaClass) { if (javaClass.getOriginKind() == JavaClass.OriginKind.COMPILED) { FqName fqName = javaClass.getFqName(); if (fqName != null && PackageClassUtils.isPackageClassFqName(fqName)) { <BUG>return javaClass.findAnnotation(JvmAnnotationNames.KO...
return javaClass.findAnnotation(JvmAnnotationNames.KOTLIN_PACKAGE.getFqName()) != null;
24,267
import org.spongepowered.api.world.Locatable; import org.spongepowered.api.world.Location; import org.spongepowered.api.world.World; import javax.annotation.Nullable; import java.util.List; <BUG>import java.util.Optional; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG> public class CommandDel...
import java.util.stream.Stream; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
24,268
.append(Text.of(TextColors.GREEN, "Usage: ")) .append(getUsage(source)) .build()); return CommandResult.empty(); } else if (isIn(REGIONS_ALIASES, parse.args[0])) { <BUG>if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!")); IRegion region = FGManager.getInstance().getRegion(parse.args[1...
String regionName = parse.args[1]; IRegion region = FGManager.getInstance().getRegion(regionName).orElse(null);
24,269
</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 exis...
24,270
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[...
Optional<IHandler> handlerOpt = FGManager.getInstance().gethandler(parse.args[1]); if (!handlerOpt.isPresent()) IHandler handler = handlerOpt.get(); if (handler instanceof GlobalHandler)
24,271
.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...
return Stream.of("region", "handler") .filter(new StartsWithPredicate(parse.current.token))
24,272
.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...
return Stream.of("region", "handler") .filter(new StartsWithPredicate(parse.current.token))
24,273
@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 stat...
private static FoxGuardMain instanceField;
24,274
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; }
24,275
return configDirectory; } public boolean isLoaded() { return loaded; } <BUG>public static Cause getCause() { return instance().pluginCause; }</BUG> public EconomyService getEconomyService() { return economyService;
[DELETED]
24,276
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 Comm...
import java.util.stream.Stream; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
24,277
.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...
return Stream.of("region", "handler") .filter(new StartsWithPredicate(parse.current.token))
24,278
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 ...
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) -> {
24,279
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 { fg...
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(n...
24,280
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 { fgOb...
Path singleDir = serverDir.resolve(name.toLowerCase()); logger.info((shouldSave ? "S" : "Force s") + "aving world region " + logName + " in directory: " + singleDir);
24,281
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(...
Optional<IRegion> regionOpt = FGManager.getInstance().getRegion(entry.getKey()); if (regionOpt.isPresent()) { IRegion region = regionOpt.get(); logger.info("Loading links for region \"" + region.getName() + "\"");
24,282
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("l...
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() + "\"");
24,283
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
24,284
.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)) .co...
return Stream.of("region", "worldregion", "handler", "controller")
24,285
package weka.filters.pyscript; import static org.junit.Assert.assertTrue; <BUG>import java.io.File; import org.junit.Test;</BUG> import weka.classifiers.Classifier; import weka.classifiers.meta.FilteredClassifier; import weka.classifiers.pyscript.PyScriptClassifier;
import org.junit.Ignore; import org.junit.Test;
24,286
private static final long serialVersionUID = -6127927234772532696L; private transient PythonSession m_session = null; private final String DEFAULT_PYTHON_COMMAND = "python"; private final boolean DEFAULT_SAVE_SCRIPT = false; private final File DEFAULT_PYFILE = new File( System.getProperty("user.dir") ); <BUG>private fi...
private final boolean DEFAULT_IGNORE_CLASS = false; private String m_pythonCommand = DEFAULT_PYTHON_COMMAND;
24,287
attrValues.append("args['attr_values']['" + escape(key) + "'] = " + vector.toString() + "\n" ); } script.append(attrValues.toString()); if(df.classIndex() != -1) { String classAttr = escape(df.classAttribute().name()); <BUG>script.append( "args['class'] = '" + classAttr + "'\n"); }</BUG> StringBuilder attrTypes = new S...
script.append( "args['class_index'] = " + df.classIndex() + "\n");
24,288
stopServers(); super.doTearDown(); } private synchronized void storeEmail() throws Exception { <BUG>GreenMailUtilities.storeEmail(servers.getManagers().getUserManager(), EMAIL, USER, PASSWORD, (MimeMessage) getValidMessage()); assertEquals(1, servers.getReceivedMessages().length);</BUG> }
GreenMailUtilities.storeEmail(servers.getManagers().getUserManager(), EMAIL, USER, assertEquals(1, servers.getReceivedMessages().length);
24,289
this.port = port; this.configFile = configFile; this.email = email; this.user = user; this.message = message; <BUG>this.password = password; } protected String getConfigResources()</BUG> { return configFile;
this.charset = charset; @Override protected String getConfigResources()
24,290
protected void doSend() throws Exception { Object msg; if (isMimeMessage) { <BUG>msg = GreenMailUtilities.toMessage(message, email); </BUG> } else {
msg = GreenMailUtilities.toMessage(message, email, charset);
24,291
server.start(); if (protocol.startsWith(Pop3Connector.POP3) || protocol.startsWith(ImapConnector.IMAP)) { GreenMailUtilities.storeEmail(server.getManagers().getUserManager(), email, user, password, <BUG>GreenMailUtilities.toMessage(message, email)); </BUG> } logger.debug("server started for protocol " + protocol); }
GreenMailUtilities.toMessage(message, email, charset));
24,292
public interface CommandRegistry { static CommandRegistry get(Vertx vertx) { return CommandRegistryImpl.get(vertx); } List<CommandRegistration> registrations(); <BUG>void createProcess(String line, Handler<AsyncResult<Process>> handler); void createProcess(List<CliToken> line, Handler<AsyncResult<Process>> handler); vo...
Process createProcess(String line); Process createProcess(List<CliToken> line); void complete(Completion completion);
24,293
import io.vertx.core.AbstractVerticle; import io.vertx.core.AsyncResult; import io.vertx.core.Context; import io.vertx.core.Future; import io.vertx.core.Handler; <BUG>import io.vertx.core.Vertx; import io.vertx.ext.shell.session.Session;</BUG> import io.vertx.ext.shell.cli.CliToken; import io.vertx.ext.shell.cli.Comple...
import io.vertx.core.VertxException; import io.vertx.ext.shell.session.Session;
24,294
import rx.Observable; import java.util.List; import io.vertx.rxjava.ext.shell.command.Command; import io.vertx.rxjava.ext.shell.cli.Completion; import io.vertx.rxjava.core.Vertx; <BUG>import io.vertx.core.AsyncResult; import io.vertx.core.Handler; import io.vertx.rxjava.ext.shell.cli.CliToken;</BUG> import io.vertx.rxj...
import io.vertx.rxjava.ext.shell.cli.CliToken;
24,295
package io.vertx.ext.shell.system.impl; <BUG>import io.vertx.core.AsyncResult; import io.vertx.core.Future; import io.vertx.core.Handler; import io.vertx.ext.shell.cli.CliToken; import io.vertx.ext.shell.registry.CommandRegistry;</BUG> import io.vertx.ext.shell.session.Session;
import io.vertx.ext.shell.process.Process; import io.vertx.ext.shell.registry.CommandRegistry;
24,296
@Override public Session session() { return session; } @Override <BUG>public void createJob(List<CliToken> args, Handler<AsyncResult<Job>> handler) { StringBuilder line = new StringBuilder(); args.stream().map(CliToken::raw).forEach(line::append); registry.createProcess(args, ar -> { if (ar.succeeded()) {</BUG> int id ...
public Job createJob(List<CliToken> args) { Process process = registry.createProcess(args);
24,297
args.stream().map(CliToken::raw).forEach(line::append); registry.createProcess(args, ar -> { if (ar.succeeded()) {</BUG> int id = jobs.isEmpty() ? 1 : jobs.lastKey() + 1; <BUG>JobImpl job = new JobImpl(id, this, ar.result(), line.toString()); jobs.put(id, job); handler.handle(Future.succeededFuture(job)); } else { han...
Process process = registry.createProcess(args); JobImpl job = new JobImpl(id, this, process, line.toString()); return job;
24,298
int newTierAlias = newLocation.tierAlias(); StorageTier newTier = getTier(newTierAlias); StorageDir newDir = null; if (newLocation.equals(BlockStoreLocation.anyDirInTier(newTierAlias))) { for (StorageDir dir : newTier.getStorageDirs()) { <BUG>if (dir.getAvailableBytes() > block.getBlockSize()) { </BUG> newDir = dir; } ...
if (dir.getAvailableBytes() >= blockMeta.getBlockSize()) {
24,299
} } }); } } else { <BUG>if (n <= m) { for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) {</BUG> a[i][j] = operator.applyAsBoolean(a[i][j]); }
public boolean[] row(final int rowIndex) { N.checkArgument(rowIndex >= 0 && rowIndex < n, "Invalid row Index: %s", rowIndex); return a[rowIndex];
24,300
} } }); } } else { <BUG>if (n <= m) { for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) {</BUG> result[i][j] = zipFunction.apply(a[i][j], b[i][j]); }
public boolean get(final int i, final int j) { return a[i][j];