id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
27,701
runAddressingTest(p3, "http://localhost:65535/java/lang/Runnable"); Map<String, Object> p4 = new HashMap<String, Object>(); p4.put("org.apache.cxf.ws.port", "8181"); runAddressingTest(p4, "http://localhost:8181/java/lang/Runnable"); } <BUG>private void runAddressingTest(Map<String, Object> properties, String expectedAd...
private void runAddressingTest(Map<String, Object> properties, String expectedAddress) throws Exception {
27,702
}; ServiceReference sref = EasyMock.createNiceMock(ServiceReference.class); EasyMock.replay(sref); Runnable myService = EasyMock.createMock(Runnable.class); EasyMock.replay(myService); <BUG>ExportResult result = handler.createServer(sref, null, null, properties, Runnable.class, myService); assertNull(result.getExceptio...
if (result.getException() != null) { throw result.getException(); } Map<String, Object> props = result.getEndpointProps();
27,703
assertEquals("Version of java. package is always 0", "0.0.0", props.get("endpoint.package.version.java.lang")); assertTrue(Arrays.equals(new String[] {"org.apache.cxf.ws"}, (String[]) props.get("service.imported.configs"))); assertTrue(Arrays.equals(new String[] {"java.lang.Runnable"}, (String[]) props.get("objectClass...
public void t2estCreateServerException() {
27,704
Arrays.asList((Object[]) props.get(RemoteConstants.SERVICE_IMPORTED_CONFIGS))); assertEquals(Arrays.asList("my_intent", "your_intent"), Arrays.asList((Object[]) props.get(RemoteConstants.SERVICE_INTENTS))); assertEquals("0.0.0", props.get("endpoint.package.version.java.lang")); } <BUG>public void testCreateJaxWsEndpoin...
public void t2estCreateJaxWsEndpointWithoutIntents() {
27,705
Assert.assertEquals(JaxWsEndpointImpl.class, ep.getClass()); Assert.assertEquals(new QName("http://jaxws.handlers.dsw.dosgi.cxf.apache.org/", "MyJaxWsEchoServiceServiceSoapBinding"), bindingName); } <BUG>public void testCreateSimpleEndpointWithoutIntents() { </BUG> IMocksControl c = EasyMock.createNiceControl(); Bundle...
public void t2estCreateSimpleEndpointWithoutIntents() {
27,706
import static org.ops4j.pax.exam.CoreOptions.frameworkStartLevel; import static org.ops4j.pax.exam.CoreOptions.mavenBundle; import static org.ops4j.pax.exam.CoreOptions.systemProperty; @RunWith(PaxExam.class) public class TestExportService extends AbstractDosgiTest { <BUG>@Inject BundleContext bundleContext;</BUG> @Con...
[DELETED]
27,707
mavenBundle().groupId("org.apache.cxf.dosgi.systests") .artifactId("cxf-dosgi-ri-systests2-common").versionAsInProject(), frameworkStartLevel(100), }; } @Test <BUG>public void testAccessEndpoint() throws Exception { waitPort(9090);</BUG> checkWsdl(new URL("http://localhost:9090/greeter?wsdl")); ClassLoader cl = Thread....
assertBundlesStarted(); waitPort(9090);
27,708
import java.util.Collections; import java.util.HashMap; import java.util.Hashtable; import java.util.Map; import org.apache.cxf.Bus; <BUG>import org.apache.cxf.bus.CXFBusFactory; import org.apache.cxf.dosgi.dsw.Constants; import org.apache.cxf.dosgi.dsw.util.OsgiUtils;</BUG> import org.apache.cxf.transport.http.Destina...
[DELETED]
27,709
import java.net.URL; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; <BUG>import javax.xml.namespace.QName; import org.apache.cxf.common.util.PackageUtils;</BUG> import org.apache.cxf.dosgi.dsw.Constants; import org.apache.cxf.dosgi.dsw.qos.IntentManager; import org.apache.c...
import org.apache.cxf.Bus; import org.apache.cxf.BusFactory; import org.apache.cxf.common.util.PackageUtils;
27,710
import org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory; import org.apache.cxf.frontend.ClientFactoryBean; import org.apache.cxf.frontend.ServerFactoryBean; import org.apache.cxf.helpers.CastUtils; import org.apache.cxf.interceptor.Interceptor; <BUG>import org.osgi.framework.BundleContext; import org.osgi.servi...
import org.osgi.framework.ServiceReference; import org.osgi.service.remoteserviceadmin.RemoteConstants;
27,711
URL wsdlURL = dswContext.getBundle().getResource(location); if (wsdlURL == null) { throw new RuntimeException("WSDL resource at " + location + " is unavailable"); } String address = getServerAddress(sd, iClass); <BUG>String contextRoot = httpServiceManager.getServletContextRoot(sd); if (address == null && contextRoot =...
String contextRoot = getServletContextRoot(sd); if (address == null && contextRoot == null) {
27,712
import javax.servlet.ServletConfig; import javax.servlet.ServletContext; import javax.servlet.ServletException; import junit.framework.Assert; import junit.framework.TestCase; <BUG>import org.apache.cxf.Bus; import org.easymock.Capture;</BUG> import org.easymock.EasyMock; import org.easymock.IMocksControl; import org.o...
import org.apache.cxf.BusFactory; import org.easymock.Capture;
27,713
HttpServiceManager h = new HttpServiceManager(dswContext, null, null, null) { @Override protected HttpService getHttpService() { return httpService; } <BUG>}; Bus bus = h.registerServletAndGetBus("/myService", dswContext, sr); Assert.assertNotNull(bus);</BUG> ServiceEvent event = new ServiceEvent(ServiceEvent.UNREGIST...
Bus bus = BusFactory.newInstance().createBus(); h.registerServlet(bus, "/myService", dswContext, sr);
27,714
@Override protected void writeBinaryStorageConfiguration( String repositoryName, OperationContext context, ModelNode model, EditableDocument binaries ) throws OperationFailedException { <BUG>binaries.set(FieldName.TYPE, FieldValue.BINARY_STORAGE_TYPE_CASSANDRA); </BUG> String host = ModelAttributes.MONGO_HOST.resolveMo...
binaries.set(FieldName.TYPE, FieldValue.BINARY_STORAGE_TYPE_MONGO);
27,715
} else { updateMemo(); callback.updateMemo(); } dismiss(); <BUG>}else{ </BUG> Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show(); } }
[DELETED]
27,716
} @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);
27,717
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);
27,718
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(
27,719
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 {
27,720
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;
27,721
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) {
27,722
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;
27,723
public Object getPropertyValue(String propertyId, Object defaultValue) { IssueUpdate update = getCurrentUpdate(); Property property = update.getProperty(propertyId); Object ret = property.getValue(); if (ret == null) { <BUG>ret = defaultValue; setPropertyValue(propertyId, ret); }</BUG> return ret; }
if (ret != null) {
27,724
while ( cause != null ) { for ( StackTraceElement e : cause.getStackTrace() ) { buff.append( " " ); <BUG>buff.append( ansi().bold().a( "at" ).reset().a( " " ) .a( e.getClassName() ).a( "." ).a( e.getMethodName() ) ); buff.append( ansi().a( " (" ).bold().a( getLocation( e ) ).reset().a( ")" ) ); </BUG> renderNewLine( b...
buff.append( ansi().a( "at " ).a( e.getClassName() ).a( "." ).a( e.getMethodName() ) ); buff.append( ansi().a( " (" ).a( getLocation( e ) ).a( ")" ).reset() );
27,725
buff.append( ansi().bold().a( "Caused by" ).reset().a( ": " ) .a( cause.getClass().getName() ) );</BUG> if ( cause.getMessage() != null ) { <BUG>buff.append( ": " ); buff.append( ansi().bold().fgRed().a( cause.getMessage() ).reset() ); </BUG> } renderNewLine( buff ); }
while ( cause != null ) for ( StackTraceElement e : cause.getStackTrace() ) buff.append( " " ); buff.append( ansi().a( "at " ).a( e.getClassName() ).a( "." ).a( e.getMethodName() ) ); buff.append( ansi().a( " (" ).a( getLocation( e ) ).a( ")" ).reset() );
27,726
extends AbstractExecutionListener { private final Logger logger; private static final int LINE_LENGTH = 72; private static final int MAX_PADDED_BUILD_TIME_DURATION_LENGTH = 9; <BUG>private static final int MAX_PROJECT_NAME_LENGTH = 52; public ExecutionEventLogger()</BUG> { logger = LoggerFactory.getLogger( ExecutionEve...
private static final int MAX_PROJECT_NAME_LENGTH = LINE_LENGTH - MAX_PADDED_BUILD_TIME_DURATION_LENGTH - 12; public ExecutionEventLogger()
27,727
@Override public void projectDiscoveryStarted( ExecutionEvent event ) { if ( logger.isInfoEnabled() ) { <BUG>logger.info( "Scanning for projects..." ); }</BUG> } @Override public void sessionStarted( ExecutionEvent event )
logger.info( ansi().fgBlue().a( "Scanning for projects..." ).reset().toString() );
27,728
infoLine( '-' ); infoMain( "Reactor Build Order:" ); logger.info( "" ); for ( MavenProject project : event.getSession().getProjects() ) { <BUG>logger.info( project.getName() ); }</BUG> } } @Override
logger.info( ansi().fgBlue().a( project.getName() ).reset().toString() );
27,729
} @Override public void mojoSkipped( ExecutionEvent event ) { if ( logger.isWarnEnabled() ) <BUG>{ logger.warn( "Goal " + event.getMojoExecution().getGoal() + " requires online mode for execution but Maven is currently offline, skipping" ); }</BUG> }
[DELETED]
27,730
package org.apache.maven.cli.logging; <BUG>import org.codehaus.plexus.logging.Logger; public class Slf4jLogger</BUG> implements Logger { private org.slf4j.Logger logger;
import static org.fusesource.jansi.Ansi.ansi; public class Slf4jLogger
27,731
} if ( cause != null ) { <BUG>buffer.a( ": " ).bold().fgRed().a( cause.getMessage() ).reset(); } return buffer.toString(); </BUG> } }
public LifecycleExecutionException( MojoExecution execution, MavenProject project, Throwable cause ) this( createMessage( execution, project, cause ), execution, project, cause );
27,732
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 ...
import java.text.DateFormat; import java.util.Date; import java.util.List;
27,733
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;
27,734
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"), MIS...
APPLIES_TO_VERSION("applies-to-version"), BUNDLES("bundles"),
27,735
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_VE...
[DELETED]
27,736
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, bytesToHex...
if (item.isDirectory()) { writer.writeAttribute(Attribute.DIRECTORY.name, "true"); if(type != ModificationType.REMOVE) {
27,737
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> impor...
import org.jboss.logging.annotations.Cause; import java.io.IOException;
27,738
final LayoutInflater inflater = LayoutInflater.from(mActivityTestRule.getActivity()); final TabLayout tabLayout = (TabLayout) inflater.inflate(R.layout.design_tabs, null); final TabLayout.Tab tab = tabLayout.newTab();</BUG> tab.setCustomView(R.layout.design_tab_item_custom); <BUG>tabLayout.addTab(tab); assertNotNull("T...
tabLayout.addOnTabSelectedListener(mockListener); final TabLayout.Tab tab = tabLayout.newTab(); verify(mockListener, times(1)).onTabSelected(eq(tab)); verify(mockListener, times(0)).onTabUnselected(any(TabLayout.Tab.class)); assertNotNull("Tab has custom view", tab.getCustomView());
27,739
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.*;
27,740
.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);
27,741
</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...
27,742
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)
27,743
.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))
27,744
.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))
27,745
@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;
27,746
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; }
27,747
return configDirectory; } public boolean isLoaded() { return loaded; } <BUG>public static Cause getCause() { return instance().pluginCause; }</BUG> public EconomyService getEconomyService() { return economyService;
[DELETED]
27,748
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.*;
27,749
.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))
27,750
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) -> {
27,751
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...
27,752
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);
27,753
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() + "\"");
27,754
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() + "\"");
27,755
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
27,756
.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")
27,757
} else { updateMemo(); callback.updateMemo(); } dismiss(); <BUG>}else{ </BUG> Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show(); } }
[DELETED]
27,758
} @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);
27,759
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);
27,760
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(
27,761
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 {
27,762
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;
27,763
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) {
27,764
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;
27,765
import org.apache.commons.lang3.math.NumberUtils; import org.json.JSONException; import org.mariotaku.microblog.library.MicroBlog; import org.mariotaku.microblog.library.MicroBlogException; import org.mariotaku.microblog.library.twitter.model.RateLimitStatus; <BUG>import org.mariotaku.microblog.library.twitter.model.St...
import org.mariotaku.pickncrop.library.PNCUtils; import org.mariotaku.sqliteqb.library.AllColumns;
27,766
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());
27,767
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.form...
if (deleteImage) { Utils.deleteMedia(context, imageUri);
27,768
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, S...
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);
27,769
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.for...
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);
27,770
import org.mariotaku.twidere.receiver.NotificationReceiver; import org.mariotaku.twidere.service.LengthyOperationsService; import org.mariotaku.twidere.util.ActivityTracker; import org.mariotaku.twidere.util.AsyncTwitterWrapper; import org.mariotaku.twidere.util.DataStoreFunctionsKt; <BUG>import org.mariotaku.twidere.u...
import org.mariotaku.twidere.util.DebugLog; import org.mariotaku.twidere.util.ImagePreloader;
27,771
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);
27,772
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);
27,773
import android.content.Context; import android.content.SharedPreferences; import android.location.Location; import android.os.AsyncTask; import android.support.annotation.NonNull; <BUG>import android.util.Log; import org.mariotaku.twidere.BuildConfig; import org.mariotaku.twidere.Constants; import org.mariotaku.twidere...
import org.mariotaku.twidere.util.DebugLog; import org.mariotaku.twidere.util.JsonSerializer;
27,774
} public static LatLng getCachedLatLng(@NonNull final Context context) { final Context appContext = context.getApplicationContext(); final SharedPreferences prefs = DependencyHolder.Companion.get(context).getPreferences(); if (!prefs.getBoolean(KEY_USAGE_STATISTICS, false)) return null; <BUG>if (BuildConfig.DEBUG) { Lo...
DebugLog.d(HotMobiLogger.LOGTAG, "getting cached location", null);
27,775
public int destroySavedSearchAsync(final UserKey accountKey, final long searchId) { final DestroySavedSearchTask task = new DestroySavedSearchTask(accountKey, searchId); return asyncTaskManager.add(task, true); } public int destroyStatusAsync(final UserKey accountKey, final String statusId) { <BUG>final DestroyStatusTa...
final DestroyStatusTask task = new DestroyStatusTask(context, accountKey, statusId);
27,776
@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.getExcepti...
public UserKey[] getAccountKeys() { return DataStoreUtils.getActivatedAccountKeys(context);
27,777
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);
27,778
registry.start(pipelineContext); processorService = new ProcessorService(); ProcessorDefinition processorDefinition = new ProcessorDefinition(); processorDefinition.setUri("oxf/processor/page-flow"); processorDefinition.addInput("controller", "oxf:/config/page-flow.xml"); <BUG>processorService.init(processorDefinition)...
processorService.init(processorDefinition, null);
27,779
} else { updateMemo(); callback.updateMemo(); } dismiss(); <BUG>}else{ </BUG> Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show(); } }
[DELETED]
27,780
} @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);
27,781
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);
27,782
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(
27,783
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 {
27,784
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;
27,785
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) {
27,786
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;
27,787
config.setThreshold(RelationshipType.PUSH_DOWN_FIELD, 0.3); config.setId("rm2-idf-default"); ResultComparator rc1 = new ResultComparator(); rc1.expect(oracle.all()); rc1.compareWith(config.getId(), ResultComparator.collectRmResult(new GitHistoryRefactoringMiner2(config), oracle.all())); <BUG>rc1.printSummary(System.out...
rc1.printSummary(System.out, EnumSet.allOf(RefactoringType.class)); rc1.printDetails(System.out, EnumSet.allOf(RefactoringType.class)); System.out.println(config.toString());
27,788
List<RefactoringDetectorConfigImpl> configurations = generateRmConfigurations(baseConfig, relType); double maxF1 = 0.0; RefactoringDetectorConfigImpl maxConfig = configurations.get(0); for (RefactoringDetectorConfigImpl config : configurations) { rc1.compareWith(config.getId(), ResultComparator.collectRmResult(new GitH...
CompareResult result = rc1.getCompareResult(config.getId(), refTypeSet); double f1 = result.getF1();
27,789
if (f1 >= maxF1) { maxF1 = f1; maxConfig = config; } } <BUG>rc1.printSummary(System.out, false, refTypeSet); rc1.printDetails(System.out, false, refTypeSet); return maxConfig;</BUG> } public static List<RefactoringDetectorConfigImpl> generateRmConfigurations(RefactoringDetectorConfigImpl baseConfig, RelationshipType re...
rc1.printSummary(System.out, refTypeSet); rc1.printDetails(System.out, refTypeSet); return maxConfig;
27,790
public <T> T getProperty(String key, Class<T> targetType) { return getProperty(key, targetType, null); } @Override public <T> T getProperty(String key, Class<T> targetType, T defaultValue) { <BUG>Object originalValue = configMap.get(key); if(originalValue != null && !targetType.isInstance(originalValue)) { if(!(origina...
if(originalValue != null) { if(targetType.isInstance(originalValue)) { return (T)originalValue; else { if(!(originalValue instanceof NavigableMap)) {
27,791
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 ...
import java.text.DateFormat; import java.util.Date; import java.util.List;
27,792
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;
27,793
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"), MIS...
APPLIES_TO_VERSION("applies-to-version"), BUNDLES("bundles"),
27,794
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_VE...
[DELETED]
27,795
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, bytesToHex...
if (item.isDirectory()) { writer.writeAttribute(Attribute.DIRECTORY.name, "true"); if(type != ModificationType.REMOVE) {
27,796
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> impor...
import org.jboss.logging.annotations.Cause; import java.io.IOException;
27,797
public static TextGenBuffer newUserObjectHolder(SNode node, boolean withDebugInfo, TextBuffer trueBuffer) { TextGenBuffer buffer = new TextGenBuffer(withDebugInfo, trueBuffer); populateTextGenCompatibilityObjects(buffer, node); return buffer; } <BUG>private static void populateTextGenCompatibilityObjects(TextGenBuffer ...
if (node.getModel() != null) { buffer.putUserObject(ROOT_NODE, node);
27,798
public static TextGenerationResult generateText(SNode node, boolean withDebugInfo, @Nullable StringBuilder[] buffers) { TextGenBuffer buffer = new TextGenBuffer(withDebugInfo, buffers); populateTextGenCompatibilityObjects(buffer, node); TextGenTransitionContext tgContext = new TextGenTransitionContext(node, buffer, buf...
if (withDebugInfo) { tic = new TraceInfoCollector();
27,799
_permissionPortalCache.removeAll(); _resourceBlockIdsBagCache.removeAll(); } public static void clearLocalCache() { if (_localCacheAvailable) { <BUG>Map<String, Object> localCache = _localCache.get(); </BUG> localCache.clear(); } }
Map<Serializable, Object> localCache = _localCache.get();
27,800
public static PermissionCheckerBag putBag( long userId, long groupId, PermissionCheckerBag bag) { if (bag == null) { return null; } <BUG>BagKey bagKey = new BagKey(userId, groupId); if (_localCacheAvailable) { Map<Serializable, Object> localCache = _localCache.get(); localCache.put(bagKey, bag); } _permissionCheckerBag...
[DELETED]