id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
12,501
package org.jgroups.protocols; import org.jgroups.Event; import org.jgroups.Message; <BUG>import org.jgroups.annotations.Property; import org.jgroups.stack.Protocol; import java.util.*; public class SHUFFLE extends Protocol implements Runnable {</BUG> @Property
import org.jgroups.annotations.Unsupported; @Unsupported public class SHUFFLE extends Protocol implements Runnable {
12,502
package org.jgroups.protocols; import org.jgroups.Event; import org.jgroups.Message; <BUG>import org.jgroups.View; import org.jgroups.stack.Protocol;</BUG> import java.io.Serializable; import java.util.Vector; class ExampleHeader implements Serializable {
import org.jgroups.annotations.Unsupported; import org.jgroups.stack.Protocol;
12,503
ExampleHeader() { } public String toString() { return "[EXAMPLE: <variables> ]"; } <BUG>} public class EXAMPLE extends Protocol {</BUG> final Vector members=new Vector(); public String getName() { return "EXAMPLE";
@Unsupported public class EXAMPLE extends Protocol {
12,504
package org.jgroups.protocols; import org.jgroups.Event; import org.jgroups.Message; <BUG>import org.jgroups.Header; import org.jgroups.stack.Protocol; import java.util.Map; public class HDRS extends Protocol {</BUG> public String getName() {return "HDRS";}
import org.jgroups.annotations.Unsupported; @Unsupported public class HDRS extends Protocol {
12,505
return getJaversManagedType(state.getClassByTypeName(typeName), expectedType); } public <T extends ManagedType> T getJaversManagedType(DuckType duckType, Class<T> expectedType) { return getJaversManagedType(state.getClassByDuckType(duckType), expectedType); } <BUG>public ManagedType getJaversManagedType(Class javaClass) { return getJaversManagedType(javaClass, ManagedType.class); } public ShallowReferenceType getShallowReferenceType(Class javaClass) { JaversType mType = getJaversType(javaClass, true); checkExpectedType(javaClass, ShallowReferenceType.class, mType); return (ShallowReferenceType) mType;</BUG> }
public ManagedType getJaversManagedType(Class javaType) { return getJaversManagedType(javaType, ManagedType.class);
12,506
checkExpectedType(javaClass, ShallowReferenceType.class, mType); return (ShallowReferenceType) mType;</BUG> } public <T extends ManagedType> T getJaversManagedType(Class javaClass, Class<T> expectedType) { JaversType mType = getJaversType(javaClass); <BUG>checkExpectedType(javaClass, expectedType, mType); return (T) mType; } private <T> void checkExpectedType(Class javaClass, Class<T> expectedType, JaversType mType) { if (!expectedType.isAssignableFrom(mType.getClass())) {</BUG> throw new JaversException(JaversExceptionCode.MANAGED_CLASS_MAPPING_ERROR,
return getJaversManagedType(state.getClassByTypeName(typeName), expectedType); public <T extends ManagedType> T getJaversManagedType(DuckType duckType, Class<T> expectedType) { return getJaversManagedType(state.getClassByDuckType(duckType), expectedType); public ManagedType getJaversManagedType(Class javaType) { return getJaversManagedType(javaType, ManagedType.class); if (expectedType.isAssignableFrom(mType.getClass())) { } else {
12,507
return create(new IgnoredTypeDefinition(javaClass)); } ClientsClassDefinitionBuilder builder; if (scan.hasIdProperty() || scan.hasEntityAnn()) { builder = EntityDefinitionBuilder.entityDefinition(javaClass); <BUG>if (scan.hasShallowReferenceAnn() || asShallowReference) { ((EntityDefinitionBuilder) builder).withShallowReference();</BUG> } } else { builder = ValueObjectDefinitionBuilder.valueObjectDefinition(javaClass);
if (scan.hasShallowReferenceAnn()) { ((EntityDefinitionBuilder) builder).withShallowReference();
12,508
if (javaType == Object.class) { return OBJECT_TYPE; } <BUG>if (asShallowReference) { synchronized (javaType) { return infer(javaType, true); } } else {</BUG> JaversType jType = getFromMap(javaType); if (jType != null) {
[DELETED]
12,509
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;
12,510
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;
12,511
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"),
12,512
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]
12,513
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) {
12,514
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;
12,515
@Inject protected BundleContext bundleContext; @Test public void testProducerConsumerAndIdempotent() throws Exception { getInstalledBundle("CamelBlueprintKratiTestBundle").start(); <BUG>BlueprintContainer ctn = getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintKratiTestBundle)", 10000); CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintKratiTestBundle)", 10000); </BUG> MockEndpoint mock = (MockEndpoint) ctx.getEndpoint("mock:results");
BlueprintContainer ctn = getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintKratiTestBundle)", 20000); CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintKratiTestBundle)", 20000);
12,516
} @Configuration public static Option[] configure() throws Exception { Option[] options = combine( Helper.getDefaultOptions( <BUG>Helper.setLogLevel("INFO")), </BUG> new Customizer() { @Override public InputStream customizeTestProbe(InputStream testProbe) {
Helper.setLogLevel("WARN")),
12,517
import org.junit.Test; import org.junit.runner.RunWith; import org.ops4j.pax.exam.Option; import org.ops4j.pax.exam.junit.Configuration; import org.ops4j.pax.exam.junit.JUnit4TestRunner; <BUG>import org.osgi.framework.Constants; import static org.ops4j.pax.exam.OptionUtils.combine; import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.scanFeatures; import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.newBundle;</BUG> @RunWith(JUnit4TestRunner.class)
import static org.ops4j.pax.exam.CoreOptions.equinox; import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.vmOption; import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.newBundle;
12,518
import org.ops4j.pax.exam.Option; import org.ops4j.pax.exam.junit.Configuration; import org.ops4j.pax.exam.junit.JUnit4TestRunner; import org.osgi.framework.Constants; import org.osgi.service.blueprint.container.BlueprintContainer; <BUG>import static org.ops4j.pax.exam.CoreOptions.equinox; import static org.ops4j.pax.exam.CoreOptions.felix;</BUG> import static org.ops4j.pax.exam.OptionUtils.combine; import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.scanFeatures; import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.modifyBundle;
[DELETED]
12,519
@RunWith(JUnit4TestRunner.class) public class JpaBlueprintRouteTest extends OSGiBlueprintTestSupport { @Test public void testBlueprintRouteJpa() throws Exception { getInstalledBundle("CamelBlueprintJpaTestBundle").start(); <BUG>BlueprintContainer ctn = getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintJpaTestBundle)", 20000); </BUG> CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintJpaTestBundle)", 20000); MockEndpoint mock = (MockEndpoint) ctx.getEndpoint("mock:result"); mock.expectedMessageCount(1);
BlueprintContainer ctn = getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintJpaTestBundle)", 30000);
12,520
server.stop(); } } protected void doPostSetup() throws Exception { getInstalledBundle("CxfBlueprintRouterTest").start(); <BUG>getOsgiService(CamelContext.class, "(camel.context.symbolicname=CxfBlueprintRouterTest)", 10000); </BUG> } protected static ReportIncidentEndpoint createCXFClient() { JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
getOsgiService(CamelContext.class, "(camel.context.symbolicname=CxfBlueprintRouterTest)", 20000);
12,521
server.stop(); } } protected void doPostSetup() throws Exception { getInstalledBundle("CxfRsBlueprintRouterTest").start(); <BUG>getOsgiService(CamelContext.class, "(camel.context.symbolicname=CxfRsBlueprintRouterTest)", 10000); </BUG> } @Test public void testGetCustomer() throws Exception {
getOsgiService(CamelContext.class, "(camel.context.symbolicname=CxfRsBlueprintRouterTest)", 30000);
12,522
Helper.getDefaultConfigOptions( Helper.getDefaultSystemOptions(), getResource("/org/apache/camel/itest/karaf/config.properties"), Helper.setLogLevel("WARN")), Helper.getDefaultProvisioningOptions()), <BUG>scanFeatures(getKarafFeatureUrl(), "spring", "spring-dm", "jetty"), scanFeatures(getCamelKarafFeatureUrl(), "xml-specs-api", "camel-core", "camel-spring", "camel-test"), workingDirectory("target/paxrunner/"));</BUG> return options;
scanFeatures(getCamelKarafFeatureUrl(), "cxf-jaxb"), workingDirectory("target/paxrunner/"));
12,523
} else { updateMemo(); callback.updateMemo(); } dismiss(); <BUG>}else{ </BUG> Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show(); } }
[DELETED]
12,524
} @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);
12,525
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);
12,526
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(
12,527
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 {
12,528
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;
12,529
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) {
12,530
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;
12,531
import mods.battlegear2.api.quiver.QuiverArrowRegistry; import mods.battlegear2.api.shield.IShield; import mods.battlegear2.client.BattlegearClientTickHandeler; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; <BUG>import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.RenderHelper;</BUG> import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.RenderHelper;
12,532
drawTexturedModalRect(x + 31, y, 151, 0, 31, SLOT_H); if (mc.thePlayer!=null){ if(((IBattlePlayer) mc.thePlayer).isBattlemode()) this.drawTexturedModalRect(x + (mc.thePlayer.inventory.currentItem - InventoryPlayerBattle.OFFSET) * 20-1, y - 1, 0, 22, 24, SLOT_H); <BUG>GL11.glEnable(GL12.GL_RESCALE_NORMAL); RenderHelper.enableGUIStandardItemLighting();</BUG> for (int i = 0; i < InventoryPlayerBattle.WEAPON_SETS; ++i) { int varx = x + i * 20 + 3; this.renderInventorySlot(i + InventoryPlayerBattle.OFFSET+(isMainHand?0:InventoryPlayerBattle.WEAPON_SETS),
GlStateManager.enableRescaleNormal(); RenderHelper.enableGUIStandardItemLighting();
12,533
} GL11.glDisable(GL11.GL_BLEND); }</BUG> public void renderQuiverBar(ItemStack quiver, float frame, int xOffset, int yOffset) { <BUG>GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.renderEngine.bindTexture(resourceLocation);</BUG> int maxSlots = ((IArrowContainer2)quiver.getItem()).getSlotCount(quiver)*10;
RenderHelper.disableStandardItemLighting(); GlStateManager.disableRescaleNormal(); GlStateManager.disableBlend(); GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); this.mc.renderEngine.bindTexture(resourceLocation);
12,534
int maxSlots = ((IArrowContainer2)quiver.getItem()).getSlotCount(quiver)*10; drawTexturedModalRect(xOffset -(1 + maxSlots), yOffset, 0, 0, 1+maxSlots, SLOT_H); drawTexturedModalRect(xOffset , yOffset, 182-(1+maxSlots), 0, 1+maxSlots, SLOT_H); int selectedSlot = ((IArrowContainer2)quiver.getItem()).getSelectedSlot(quiver); drawTexturedModalRect(xOffset -(2 + maxSlots) + 20*selectedSlot, yOffset-1, 0, 22, 24, SLOT_H); <BUG>GL11.glEnable(GL12.GL_RESCALE_NORMAL); RenderHelper.enableGUIStandardItemLighting();</BUG> for (int i = 0; i < maxSlots/10; ++i) { int x = xOffset -(1+maxSlots) + i * 20 + 3; renderStackAt(x, yOffset+3, ((IArrowContainer2)quiver.getItem()).getStackInSlot(quiver, i), frame);
GlStateManager.enableRescaleNormal(); RenderHelper.enableGUIStandardItemLighting();
12,535
import mods.battlegear2.packet.PickBlockPacket; import mods.battlegear2.utils.BattlegearConfig; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelBiped; <BUG>import net.minecraft.client.model.ModelPlayer; import net.minecraft.client.renderer.InventoryEffectRenderer;</BUG> import net.minecraft.client.renderer.entity.RenderPlayer; import net.minecraft.client.renderer.entity.RenderSkeleton; import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.InventoryEffectRenderer;
12,536
import mods.battlegear2.client.utils.*; import mods.battlegear2.packet.BattlegearChangeHeraldryPacket; import mods.battlegear2.utils.FileExtension; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; <BUG>import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.renderer.Tessellator;</BUG> import net.minecraft.client.renderer.texture.DynamicTexture; import net.minecraft.client.renderer.texture.TextureUtil; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator;
12,537
import mods.battlegear2.gui.ContainerHeraldry; import mods.battlegear2.packet.BattlegearGUIPacket; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.GuiButton; <BUG>import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.Tessellator;</BUG> import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator;
12,538
elementList.markDirty(i); scrollListPattern.markAllDirty(); crestDirty = true; } private void drawCrest(){ <BUG>GL11.glColor4f(1, 1, 1, 1); Minecraft.getMinecraft().renderEngine.bindTexture(HeraldryCrestItemRenderer.map_overlay);</BUG> drawTexturedModalRect((width-400)/2, 50, 128, 128, 0, 0, 1, 1); if(crestDirty){ currentCrest.refreshWith(currentData, true);
GlStateManager.color(1, 1, 1, 1); Minecraft.getMinecraft().renderEngine.bindTexture(HeraldryCrestItemRenderer.map_overlay);
12,539
drawTexturedModalRect((width-400)/2, 50, 128, 128, 0, 0, 1, 1); if(crestDirty){ currentCrest.refreshWith(currentData, true); crestDirty = false; } <BUG>GL11.glColor3f(1F, 1F, 1F); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glDisable(GL11.GL_ALPHA_TEST); currentCrest.updateDynamicTexture();</BUG> ResourceLocation rl = Minecraft.getMinecraft().getTextureManager().getDynamicTextureLocation("gui_crest", currentCrest);
GlStateManager.color(1F, 1F, 1F); GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.disableAlpha(); currentCrest.updateDynamicTexture();
12,540
} else { updateMemo(); callback.updateMemo(); } dismiss(); <BUG>}else{ </BUG> Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show(); } }
[DELETED]
12,541
} @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);
12,542
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);
12,543
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(
12,544
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 {
12,545
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;
12,546
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) {
12,547
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;
12,548
TaskContext taskContext = TaskContext.inmem(); TaskContext.Value<Long> value = taskContext.evaluate(fib92); value.consume(f92 -> System.out.println("fib(92) = " + f92)); } static Task<Long> create(long n) { <BUG>TaskBuilder<Long> fib = Task.ofType(Long.class).named("Fib", n); </BUG> if (n < 2) { return fib .process(() -> n);
TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
12,549
public String getName() { return _name; } @Override <BUG>public List<ResourceToken> findResources(ResourceMetadata filter) { return _resources.findResources(filter); </BUG> }
[DELETED]
12,550
{ return _resources.findResources(filter); </BUG> } @Override <BUG>public <T extends MuseResource> List<ResourceToken<T>> findResources(ResourceMetadata filter, Class<T> interface_class) { filter.setType(getResourceTypes().forImplementationInterface(interface_class)); List<ResourceToken<T>> typed_tokens = new ArrayList<>(); List<ResourceToken> tokens = _resources.findResources(filter); for (ResourceToken token : tokens) typed_tokens.add((ResourceToken<T>)token); return typed_tokens;</BUG> }
_resources = new InMemoryResourceStore(); public void open()
12,551
public List<TestConfiguration> generateTestList(MuseProject project) { List<TestConfiguration> tests = new ArrayList<>(_test_ids.size()); for (String id : _test_ids) { <BUG>MuseTest test = project.getResource(project.findResource(id, MuseTest.class)); if (test == null)</BUG> { LOG.error("Test with id {} was not found in the project", id); tests.add(new TestConfiguration(new MissingTest(id)));
MuseTest test = project.getResource(id, MuseTest.class); if (test == null)
12,552
} @Override public MuseResource resolveValue(MuseExecutionContext context) throws ValueSourceResolutionError { String id = getValue(_id_source, context, false, String.class); <BUG>MuseResource resource = _project.getResource(_project.findResource(id, MuseResource.class)); if (resource == null)</BUG> throw new ValueSourceResolutionError(String.format("Unable to resolve the project resource (id=%s). Search returned null.", id)); return resource; }
MuseResource resource = _project.getResource(id); if (resource == null)
12,553
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.getResource(_project.findResource(id_obj.toString(), ContainsStep.class)); if (resource == null)</BUG> throw new StepExecutionError("unable to locate id " + id_obj.toString()); StepConfiguration step = resource.getStep(); List<StepConfiguration> steps;
ContainsStep resource = _project.getResource(id_obj.toString(), ContainsStep.class); if (resource == null)
12,554
public class ParameterListTestSuite implements MuseTestSuite { @Override public List<TestConfiguration> generateTestList(MuseProject project) { <BUG>MuseTest test = project.getResource(project.findResource(_testid, MuseTest.class)); if (test == null)</BUG> test = new MissingTest(_testid); List<TestConfiguration> tests = new ArrayList<>(); for (Map<String, Object> param_set : _parameters)
MuseTest test = project.getResource(_testid, MuseTest.class); if (test == null)
12,555
@Override public MuseStep createStep(StepConfiguration configuration, MuseProject project) throws MuseInstantiationException { if (project == null) return null; <BUG>JavascriptStepResource builder = project.getResource(project.findResource(configuration.getType(), JavascriptStepResource.class)); if (builder == null)</BUG> return null; return builder.createStep(configuration); }
JavascriptStepResource builder = project.getResource(configuration.getType(), JavascriptStepResource.class); if (builder == null)
12,556
} catch (Exception e) { } } <BUG>} public ResourceType forImplementationInterface(Class implementation) { for (ResourceType type : _types.values()) if (type.getInterfaceClass().equals(implementation)) return type; return null;</BUG> }
@SuppressWarnings("unchecked") public ResourceType forObject(Object obj) if (type.getInterfaceClass().isAssignableFrom(obj.getClass()))
12,557
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<ResourceToken> tokens = _project.findResources(new ResourceMetadata(ResourceTypes.jsStep)); List<MuseResource> scripted_steps = _project.getUntypedResources(tokens); for (MuseResource step : scripted_steps)</BUG> {
List<ResourceToken> tokens = _project.findResources(new ResourceAttributes(ResourceTypes.jsStep)); List<MuseResource> scripted_steps = _project.getResources(tokens); for (MuseResource step : scripted_steps)
12,558
public class VariableListsInitializer implements ContextInitializer { @Override public void initialize(MuseProject project, MuseExecutionContext context) throws MuseExecutionError { <BUG>List<ResourceToken<VariableList>> tokens = project.findResources(new ResourceMetadata(new VariableList.VariableListType()), VariableList.class); List<VariableList> lists = project.getResources(tokens); </BUG> lists = filterLists(lists, project, context);
List<ResourceToken> tokens = project.findResources(new ResourceAttributes(new VariableList.VariableListType())); List<VariableList> lists = project.getResources(tokens, VariableList.class);
12,559
} } } private List<VariableList> filterLists(List<VariableList> lists, MuseProject project, MuseExecutionContext context) throws MuseInstantiationException, ValueSourceResolutionError { <BUG>List<ResourceToken<ContextInitializerConfigurations>> tokens = project.findResources(new ResourceMetadata(new ContextInitializerConfigurations.ContextInitializersConfigurationType()), ContextInitializerConfigurations.class); List<ContextInitializerConfigurations> list_of_configs = project.getResources(tokens); </BUG> if (list_of_configs.size() == 0)
List<ResourceToken> tokens = project.findResources(new ResourceAttributes(new ContextInitializerConfigurations.ContextInitializersConfigurationType())); List<ContextInitializerConfigurations> list_of_configs = project.getResources(tokens, ContextInitializerConfigurations.class);
12,560
final int res = value.size(); return result(exp == res, Util.info("% items (% found)", exp, res)); } protected boolean assertEq(final String expect) { final XdmValue value = result.value; <BUG>if(value == null) return fail(Util.info("Equal to: '%'", expect)); final XQuery query = new XQuery(expect, ctx); try { final XdmItem exp = query.next();</BUG> final XdmItem res = value instanceof XdmItem ? (XdmItem) value : null;
final XdmItem exp = new XQuery(expect, ctx).next();
12,561
for(final String s : res.toArray(new String[exp.size()])) { if(!exp.contains(s)) return fail(Util.info("% (missing in expected result)", s)); } return true; <BUG>} finally { query.close(); }</BUG> } protected boolean assertSerialization(final String expect, final boolean ignorePref) {
[DELETED]
12,562
import org.basex.query.*; import org.basex.query.iter.*; import org.basex.query.util.format.*; import org.basex.query.value.item.*; import org.basex.tests.bxapi.xdm.*; <BUG>import org.basex.util.*; import org.basex.util.list.*;</BUG> public final class XQuery implements Iterable<XdmItem> { private final QueryProcessor qp; private Iter ir;
import org.basex.util.hash.*; import org.basex.util.list.*;
12,563
Util.debug(ex); throw new XQueryException(ex); } } public XQuery decimalFormat(final QName name, final HashMap<String, String> map) { <BUG>try { qp.ctx.sc.decFormats.add(new QNm(name).id(), new DecFormatter(null, map)); </BUG> return this; } catch(final QueryException ex) {
public XQuery bind(final String key, final Object value) { qp.bind(key, value instanceof XdmValue ? ((XdmValue) value).internal() : value);
12,564
public XdmValue value() { try { return XdmValue.get(qp.value()); } catch(final QueryException ex) { Util.debug(ex); <BUG>throw new XQueryException(ex); }</BUG> } public SerializerProp serializer() { return qp.ctx.serParams(false);
} finally { qp.close();
12,565
Util.notexpected(); } }; } public static String string(final String query, final XdmValue val, final Context ctx) { <BUG>final XQuery qp = new XQuery(query, ctx).context(val); try { final XdmItem it = qp.next(); return it == null ? "" : it.getString(); } finally { qp.close(); }</BUG> }
final XdmValue xv = new XQuery(query, ctx).context(val).value(); return xv.size() == 0 ? "" : xv.getString();
12,566
import org.basex.query.value.node.*; import org.basex.tests.bxapi.*; import org.basex.util.*; public abstract class XdmItem extends XdmValue { public static XdmItem get(final Item val) { <BUG>return val == null ? null : val instanceof ANode ? new XdmNode((ANode) val) : new XdmAtomic(val); </BUG> } @Override
return val instanceof ANode ? new XdmNode((ANode) val) : new XdmAtomic(val);
12,567
package com.cronutils.model.time.generator; import java.util.Collections; <BUG>import java.util.List; import org.apache.commons.lang3.Validate;</BUG> import com.cronutils.model.field.CronField; import com.cronutils.model.field.expression.FieldExpression; public abstract class FieldValueGenerator {
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;
12,568
import java.util.ResourceBundle; import java.util.function.Function;</BUG> class DescriptionStrategyFactory { private DescriptionStrategyFactory() {} public static DescriptionStrategy daysOfWeekInstance(final ResourceBundle bundle, final FieldExpression expression) { <BUG>final Function<Integer, String> nominal = integer -> new DateTime().withDayOfWeek(integer).dayOfWeek().getAsText(bundle.getLocale()); </BUG> NominalDescriptionStrategy dow = new NominalDescriptionStrategy(bundle, nominal, expression); dow.addDescription(fieldExpression -> { if (fieldExpression instanceof On) {
import java.util.function.Function; import com.cronutils.model.field.expression.FieldExpression; import com.cronutils.model.field.expression.On; final Function<Integer, String> nominal = integer -> DayOfWeek.of(integer).getDisplayName(TextStyle.FULL, bundle.getLocale());
12,569
return dom; } public static DescriptionStrategy monthsInstance(final ResourceBundle bundle, final FieldExpression expression) { return new NominalDescriptionStrategy( bundle, <BUG>integer -> new DateTime().withMonthOfYear(integer).monthOfYear().getAsText(bundle.getLocale()), expression</BUG> ); } public static DescriptionStrategy plainInstance(ResourceBundle bundle, final FieldExpression expression) {
integer -> Month.of(integer).getDisplayName(TextStyle.FULL, bundle.getLocale()), expression
12,570
<BUG>package com.cronutils.model.time.generator; import com.cronutils.mapper.WeekDay;</BUG> import com.cronutils.model.field.CronField; import com.cronutils.model.field.CronFieldName; import com.cronutils.model.field.constraint.FieldConstraintsBuilder;
import java.time.LocalDate; import java.util.Collections; import java.util.List; import java.util.Set; import org.apache.commons.lang3.Validate; import com.cronutils.mapper.WeekDay;
12,571
import com.cronutils.model.field.expression.Between; import com.cronutils.model.field.expression.FieldExpression; import com.cronutils.parser.CronParserField; import com.google.common.collect.Lists; import com.google.common.collect.Sets; <BUG>import org.apache.commons.lang3.Validate; import org.joda.time.DateTime; import java.util.Collections; import java.util.List; import java.util.Set;</BUG> class BetweenDayOfWeekValueGenerator extends FieldValueGenerator {
[DELETED]
12,572
<BUG>package com.cronutils.model.time.generator; import com.cronutils.model.field.CronField;</BUG> import com.cronutils.model.field.CronFieldName; import com.cronutils.model.field.expression.FieldExpression; import com.cronutils.model.field.expression.On;
import java.time.DayOfWeek; import java.time.LocalDate; import java.util.List; import org.apache.commons.lang3.Validate; import com.cronutils.model.field.CronField;
12,573
import com.cronutils.model.field.CronField;</BUG> import com.cronutils.model.field.CronFieldName; import com.cronutils.model.field.expression.FieldExpression; import com.cronutils.model.field.expression.On; import com.google.common.collect.Lists; <BUG>import org.apache.commons.lang3.Validate; import org.joda.time.DateTime; import java.util.List;</BUG> class OnDayOfMonthValueGenerator extends FieldValueGenerator { private int year;
package com.cronutils.model.time.generator; import java.time.DayOfWeek; import java.time.LocalDate; import java.util.List; import com.cronutils.model.field.CronField;
12,574
class OnDayOfMonthValueGenerator extends FieldValueGenerator { private int year; private int month; public OnDayOfMonthValueGenerator(CronField cronField, int year, int month) { super(cronField); <BUG>Validate.isTrue(CronFieldName.DAY_OF_MONTH.equals(cronField.getField()), "CronField does not belong to day of month"); this.year = year;</BUG> this.month = month; }
Validate.isTrue(CronFieldName.DAY_OF_MONTH.equals(cronField.getField()), "CronField does not belong to day of" + " month"); this.year = year;
12,575
package com.cronutils.mapper; public class ConstantsMapper { private ConstantsMapper() {} public static final WeekDay QUARTZ_WEEK_DAY = new WeekDay(2, false); <BUG>public static final WeekDay JODATIME_WEEK_DAY = new WeekDay(1, false); </BUG> public static final WeekDay CRONTAB_WEEK_DAY = new WeekDay(1, true); public static int weekDayMapping(WeekDay source, WeekDay target, int weekday){ return source.mapTo(weekday, target);
public static final WeekDay JAVA8 = new WeekDay(1, false);
12,576
return nextMatch; } catch (NoSuchValueException e) { throw new IllegalArgumentException(e); } } <BUG>DateTime nextClosestMatch(DateTime date) throws NoSuchValueException { </BUG> List<Integer> year = yearsValueGenerator.generateCandidates(date.getYear(), date.getYear()); TimeNode days = null; int lowestMonth = months.getValues().get(0);
ZonedDateTime nextClosestMatch(ZonedDateTime date) throws NoSuchValueException {
12,577
boolean questionMarkSupported = cronDefinition.getFieldDefinition(DAY_OF_WEEK).getConstraints().getSpecialChars().contains(QUESTION_MARK); if(questionMarkSupported){ return new TimeNode( generateDayCandidatesQuestionMarkSupported( <BUG>date.getYear(), date.getMonthOfYear(), </BUG> ((DayOfWeekFieldDefinition) cronDefinition.getFieldDefinition(DAY_OF_WEEK) ).getMondayDoWValue()
date.getYear(), date.getMonthValue(),
12,578
) ); }else{ return new TimeNode( generateDayCandidatesQuestionMarkNotSupported( <BUG>date.getYear(), date.getMonthOfYear(), </BUG> ((DayOfWeekFieldDefinition) cronDefinition.getFieldDefinition(DAY_OF_WEEK) ).getMondayDoWValue()
date.getYear(), date.getMonthValue(),
12,579
} public DateTime lastExecution(DateTime date){ </BUG> Validate.notNull(date); try { <BUG>DateTime previousMatch = previousClosestMatch(date); </BUG> if(previousMatch.equals(date)){ previousMatch = previousClosestMatch(date.minusSeconds(1)); }
public java.time.Duration timeToNextExecution(ZonedDateTime date){ return java.time.Duration.between(date, nextExecution(date)); public ZonedDateTime lastExecution(ZonedDateTime date){ ZonedDateTime previousMatch = previousClosestMatch(date);
12,580
return previousMatch; } catch (NoSuchValueException e) { throw new IllegalArgumentException(e); } } <BUG>public Duration timeFromLastExecution(DateTime date){ return new Interval(lastExecution(date), date).toDuration(); } public boolean isMatch(DateTime date){ </BUG> return nextExecution(lastExecution(date)).equals(date);
[DELETED]
12,581
<BUG>package com.cronutils.model.time.generator; import com.cronutils.model.field.CronField;</BUG> import com.cronutils.model.field.expression.Every; import com.cronutils.model.field.expression.FieldExpression; import com.google.common.annotations.VisibleForTesting;
import java.time.ZonedDateTime; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.cronutils.model.field.CronField;
12,582
import com.cronutils.model.field.CronField;</BUG> import com.cronutils.model.field.expression.Every; import com.cronutils.model.field.expression.FieldExpression; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.Lists; <BUG>import org.joda.time.DateTime; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.List;</BUG> class EveryFieldValueGenerator extends FieldValueGenerator {
package com.cronutils.model.time.generator; import java.time.ZonedDateTime; import java.util.List; import com.cronutils.model.field.CronField;
12,583
private static final Logger log = LoggerFactory.getLogger(EveryFieldValueGenerator.class); public EveryFieldValueGenerator(CronField cronField) { super(cronField); log.trace(String.format( "processing \"%s\" at %s", <BUG>cronField.getExpression().asString(), DateTime.now() </BUG> )); } @Override
cronField.getExpression().asString(), ZonedDateTime.now()
12,584
public void tearDown() throws Exception { EasyMock.verify(m_resourceDao, m_sampleRepository); } @Test public void canRetrieveAttributeWhenFallbackAttributeIsSet() throws Exception { <BUG>List<Source> sources = Lists.newArrayList( createMockResource("icmplocalhost", "icmp", "127.0.0.1") );</BUG> replay();
createMockResource("icmplocalhost", "icmp", "127.0.0.1");
12,585
sourceToBeFetched.setResourceId("nodeSource[NODES:1505998205].responseTime[127.0.0.1]"); sourceToBeFetched.setAttribute("icmp"); sourceToBeFetched.setFallbackAttribute("willNotBeFound"); sourceToBeFetched.setAggregation("AVERAGE"); sourceToBeFetched.setLabel("icmp"); <BUG>FetchResults fetchResults = m_newtsFetchStrategy.fetch(1431047069000L - (60 * 60 * 1000), 1431047069000L, 300 * 1000, 0, Lists.newArrayList(sourceToBeFetched)); </BUG> assertEquals(1, fetchResults.getColumns().keySet().size()); assertTrue(fetchResults.getColumns().containsKey("icmplocalhost")); assertEquals(1, fetchResults.getTimestamps().length);
FetchResults fetchResults = m_newtsFetchStrategy.fetch(1431047069000L - (60 * 60 * 1000), 1431047069000L, 300 * 1000, 0, null, null, Lists.newArrayList(sourceToBeFetched));
12,586
assertTrue(fetchResults.getColumns().containsKey("icmplocalhost")); assertEquals(1, fetchResults.getTimestamps().length); } @Test public void canRetrieveFallbackAttributeWhenAttributeNotFound() throws Exception { <BUG>List<Source> sources = Lists.newArrayList( createMockResource("icmplocalhost", "icmp", "127.0.0.1") );</BUG> replay();
createMockResource("icmplocalhost", "icmp", "127.0.0.1");
12,587
sourceToBeFetched.setResourceId("nodeSource[NODES:1505998205].responseTime[127.0.0.1]"); sourceToBeFetched.setAttribute("willNotBeFound"); sourceToBeFetched.setFallbackAttribute("icmp"); sourceToBeFetched.setAggregation("AVERAGE"); sourceToBeFetched.setLabel("icmp"); <BUG>FetchResults fetchResults = m_newtsFetchStrategy.fetch(1431047069000L - (60 * 60 * 1000), 1431047069000L, 300 * 1000, 0, Lists.newArrayList(sourceToBeFetched)); </BUG> assertEquals(1, fetchResults.getColumns().keySet().size()); assertTrue(fetchResults.getColumns().containsKey("icmplocalhost")); assertEquals(1, fetchResults.getTimestamps().length);
FetchResults fetchResults = m_newtsFetchStrategy.fetch(1431047069000L - (60 * 60 * 1000), 1431047069000L, 300 * 1000, 0, null, null, Lists.newArrayList(sourceToBeFetched));
12,588
assertTrue(fetchResults.getColumns().containsKey("icmplocalhost")); assertEquals(1, fetchResults.getTimestamps().length); } @Test public void cannotRetrieveUnknownAttributeAndUnknownFallbackAttribute() { <BUG>List<Source> sources = Lists.newArrayList( createMockResource("icmplocalhost", "shouldNotBeFound", "127.0.0.1", false) );</BUG> replay();
createMockResource("icmplocalhost", "shouldNotBeFound", "127.0.0.1", false);
12,589
sourceToBeFetched.setResourceId("nodeSource[NODES:1505998205].responseTime[127.0.0.1]"); sourceToBeFetched.setAttribute("willNotBeFound"); sourceToBeFetched.setFallbackAttribute("willNotBeFoundToo"); sourceToBeFetched.setAggregation("AVERAGE"); sourceToBeFetched.setLabel("icmp"); <BUG>FetchResults fetchResults = m_newtsFetchStrategy.fetch(1431047069000L - (60 * 60 * 1000), 1431047069000L, 300 * 1000, 0, Lists.newArrayList(sourceToBeFetched)); </BUG> assertNull(fetchResults); } @Test
FetchResults fetchResults = m_newtsFetchStrategy.fetch(1431047069000L - (60 * 60 * 1000), 1431047069000L, 300 * 1000, 0, null, null, Lists.newArrayList(sourceToBeFetched));
12,590
createMockResource("icmplocalhost", "icmp", "127.0.0.1"), createMockResource("snmplocalhost", "snmp", "127.0.0.1"), createMockResource("snmp192", "snmp", "192.168.0.1") ); replay(); <BUG>FetchResults fetchResults = m_newtsFetchStrategy.fetch(1431047069000L - (60 * 60 * 1000), 1431047069000L, 300 * 1000, 0, sources); </BUG> assertEquals(3, fetchResults.getColumns().keySet().size()); assertTrue(fetchResults.getColumns().containsKey("icmplocalhost")); assertTrue(fetchResults.getColumns().containsKey("snmplocalhost"));
FetchResults fetchResults = m_newtsFetchStrategy.fetch(1431047069000L - (60 * 60 * 1000), 1431047069000L, 300 * 1000, 0, null, null, sources);
12,591
private static final Logger LOG = LoggerFactory.getLogger(AbstractRrdBasedFetchStrategy.class); @Autowired private ResourceDao m_resourceDao; @Override public FetchResults fetch(long start, long end, long step, int maxrows, <BUG>List<Source> sources) throws Exception { final Map<String, Object> constants = Maps.newHashMap();</BUG> final Map<Source, String> rrdsBySource = Maps.newHashMap(); for (final Source source : sources) { final OnmsResource resource = m_resourceDao.getResourceById(source
Long interval, Long heartbeat, List<Source> sources) throws Exception { final Map<String, Object> constants = Maps.newHashMap();
12,592
try { results = fetchStrategy.fetch( request.getStart(), request.getEnd(), request.getStep(), <BUG>request.getMaxRows(), request.getSources());</BUG> } catch (Exception e) { throw new FetchException(e, "Fetch failed: {}", e.getMessage()); }
request.getHeartbeat(), request.getInterval(), request.getSources());
12,593
final AtomicReference<long[]> timestamps = new AtomicReference<>(); final Map<String, double[]> columns = Maps.newConcurrentMap(); sourcesByNewtsResourceId.entrySet().parallelStream().forEach(entry -> { final String newtsResourceId = entry.getKey(); final List<Source> listOfSources = entry.getValue(); <BUG>ResultDescriptor resultDescriptor = new ResultDescriptor(intervalInMs); </BUG> for (Source source : listOfSources) { final String metricName = source.getAttribute(); final String name = source.getLabel();
ResultDescriptor resultDescriptor = new ResultDescriptor(effectiveInterval);
12,594
@XmlAccessorType(XmlAccessType.NONE) public class QueryRequest { private long start; private long end; private long step; <BUG>private int maxrows = 0; private List<Source> sources = Lists.newArrayListWithCapacity(0);</BUG> private List<Expression> expressions = Lists.newArrayListWithCapacity(0); private List<FilterDef> filters = Lists.newArrayListWithCapacity(0); @XmlAttribute(name = "start")
private Long interval; private Long heartbeat; private List<Source> sources = Lists.newArrayListWithCapacity(0);
12,595
&& com.google.common.base.Objects.equal(this.expressions, other.expressions) && com.google.common.base.Objects.equal(this.filters, other.filters); } @Override public int hashCode() { <BUG>return com.google.common.base.Objects.hashCode( this.step, this.start, this.end, this.sources, this.expressions, this.filters); </BUG> } @Override
this.step, this.start, this.end, this.maxrows, this.interval, this.heartbeat ,this.sources, this.expressions, this.filters);
12,596
extends AbstractMavenReport { private static final String RESOURCE_DIR = ClassUtils.getPackageName( JavadocReport.class ).replace( '.', '/' ); private static final String DEFAULT_CSS_NAME = "stylesheet.css"; private static final String RESOURCE_CSS_DIR = RESOURCE_DIR + "/css"; <BUG>private static final String PATH_SEPARATOR = System.getProperty( "path.separator" ); private File outputDirectory;</BUG> private SiteRenderer siteRenderer; private MavenProject project; private String additionalparam;
private boolean isOffline; private File outputDirectory;
12,597
minX = src.getMinX(); maxX = src.getMaxX(); minY = src.getMinY(); maxY = src.getMaxY(); } else { <BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC); minX = src.getMinX() + 1; // Left padding maxX = src.getMaxX() - 2; // Right padding minY = src.getMinY() + 1; // Top padding maxY = src.getMaxY() - 2; // Bottom padding </BUG> }
iterSource = getRandomIterator(src, null); minX = src.getMinX() + leftPad; // Left padding maxX = src.getMaxX() - rightPad; // Right padding minY = src.getMinY() + topPad; // Top padding maxY = src.getMaxY() - bottomPad; // Bottom padding
12,598
final int lineStride = dst.getScanlineStride(); final int pixelStride = dst.getPixelStride(); final int[] bandOffsets = dst.getBandOffsets(); final byte[][] data = dst.getByteDataArrays(); final float[] warpData = new float[2 * dstWidth]; <BUG>int lineOffset = 0; if (ctable == null) { // source does not have IndexColorModel if (caseA) { for (int h = 0; h < dstHeight; h++) {</BUG> int pixelOffset = lineOffset;
if(hasROI && !roiContainsTile && roiIter == null){ throw new IllegalArgumentException("Error on creating the ROI iterator"); } if (caseA || (caseB && roiContainsTile)) { for (int h = 0; h < dstHeight; h++) {
12,599
pixelOffset += pixelStride; } // COLS LOOP } // ROWS LOOP } } else {// source has IndexColorModel <BUG>if (caseA) { for (int h = 0; h < dstHeight; h++) {</BUG> int pixelOffset = lineOffset; lineOffset += lineStride; warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
} else if (caseB) { for (int h = 0; h < dstHeight; h++) {
12,600
minX = src.getMinX(); maxX = src.getMaxX(); minY = src.getMinY(); maxY = src.getMaxY(); } else { <BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC); minX = src.getMinX() + 1; // Left padding maxX = src.getMaxX() - 2; // Right padding minY = src.getMinY() + 1; // Top padding maxY = src.getMaxY() - 2; // Bottom padding </BUG> }
iterSource = getRandomIterator(src, null); minX = src.getMinX() + leftPad; // Left padding maxX = src.getMaxX() - rightPad; // Right padding minY = src.getMinY() + topPad; // Top padding maxY = src.getMaxY() - bottomPad; // Bottom padding