id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
15,201
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 DestroyStatusTask task = new DestroyStatusTask(context,accountKey, statusId); </BUG> return asyncTaskManager.add(task, true); } public int destroyUserListAsync(final UserKey accountKey, final String listId) {
final DestroyStatusTask task = new DestroyStatusTask(context, accountKey, statusId);
15,202
@Override public void afterExecute(Bus handler, SingleResponse<Relationship> result) { if (result.hasData()) { handler.post(new FriendshipUpdatedEvent(accountKey, userKey, result.getData())); } else if (result.hasException()) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, "Unable to update friendship", result.getException()); }</BUG> }
public UserKey[] getAccountKeys() { return DataStoreUtils.getActivatedAccountKeys(context);
15,203
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);
15,204
} final String replacementText = stringBuilder.toString();</BUG> CommandProcessor.getInstance().executeCommand(element.getProject(), new Runnable() { public void run() { document.replaceString(textRange.getStartOffset(), textRange.getEndOffset(), <BUG>getPrefix(element) + replacementText); final CodeFormatterFacade codeFormatter = new CodeFormatterFacade(</BUG> CodeStyleSettingsManager.getSettings(element.getProject())); codeFormatter.doWrapLongLinesIfNecessary(editor, element.getProject(), document, textRange.getStartOffset(),
appendPostfix(element, text, stringBuilder); final String replacementText = stringBuilder.toString(); final CodeFormatterFacade codeFormatter = new CodeFormatterFacade(
15,205
int endOffset = getEndOffset(element, editor); return TextRange.create(startOffset, endOffset); } private int getStartOffset(@NotNull final PsiElement element, @NotNull final Editor editor) { if (isBunchOfElement(element)) { <BUG>final PsiElement firstCommentElement = getFirstElement(element); return firstCommentElement != null? firstCommentElement.getTextRange().getStartOffset() : element.getTextRange().getStartOffset();</BUG> } final int offset = editor.getCaretModel().getOffset();
final PsiElement firstElement = getFirstElement(element); return firstElement != null? firstElement.getTextRange().getStartOffset() : element.getTextRange().getStartOffset();
15,206
PsiElement prevSibling = element.getPrevSibling(); PsiElement result = element; while (prevSibling != null && (prevSibling.getNode().getElementType().equals(elementType) || (atWhitespaceToken(prevSibling) && StringUtil.countChars(prevSibling.getText(), '\n') <= 1))) { <BUG>final String text = prevSibling.getText(); if (prevSibling.getNode().getElementType().equals(elementType) && StringUtil.isEmptyOrSpaces( StringUtil.trimStart(text.trim(), getPrefix(element)))) { break;</BUG> }
final String prefix = getPrefix(element); final String postfix = getPostfix(element); text = StringUtil.trimStart(text.trim(), prefix.trim()); text = StringUtil.trimEnd(text, postfix); if (prevSibling.getNode().getElementType().equals(elementType) && StringUtil.isEmptyOrSpaces(text)) { break;
15,207
PsiElement nextSibling = element.getNextSibling(); PsiElement result = element; while (nextSibling != null && (nextSibling.getNode().getElementType().equals(elementType) || (atWhitespaceToken(nextSibling) && StringUtil.countChars(nextSibling.getText(), '\n') <= 1))) { <BUG>final String text = nextSibling.getText(); if (nextSibling.getNode().getElementType().equals(elementType) && StringUtil.isEmptyOrSpaces( StringUtil.trimStart(text.trim(), getPrefix(element)))) { break;</BUG> }
final String prefix = getPrefix(element); final String postfix = getPostfix(element); text = StringUtil.trimStart(text.trim(), prefix.trim()); text = StringUtil.trimEnd(text, postfix); if (nextSibling.getNode().getElementType().equals(elementType) && StringUtil.isEmptyOrSpaces(text)) { break;
15,208
customTokens.put("%%mlFinalForestsPerHost%%", hubConfig.finalForestsPerHost.toString()); customTokens.put("%%mlTraceAppserverName%%", hubConfig.traceHttpName); customTokens.put("%%mlTracePort%%", hubConfig.tracePort.toString()); customTokens.put("%%mlTraceDbName%%", hubConfig.traceDbName); customTokens.put("%%mlTraceForestsPerHost%%", hubConfig.traceForestsPerHost.toString()); <BUG>customTokens.put("%%mlModulesDbName%%", hubConfig.modulesDbName); }</BUG> public void init() { try { LOGGER.error("PLUGINS DIR: " + pluginsDir.toString());
customTokens.put("%%mlTriggersDbName%%", hubConfig.triggersDbName); customTokens.put("%%mlSchemasDbName%%", hubConfig.schemasDbName); }
15,209
package com.github.fabienrenaud.jjb; <BUG>import javax.json.spi.JsonProvider; public final class JsonUtils {</BUG> private JsonUtils() { } public static void printJavaxJsonProvider() {
import java.io.ByteArrayOutputStream; public final class JsonUtils {
15,210
package com.github.fabienrenaud.jjb.databind; <BUG>import com.alibaba.fastjson.JSON; import com.bluelinelabs.logansquare.LoganSquare; import com.fasterxml.jackson.core.JsonProcessingException; import com.github.fabienrenaud.jjb.JsonBench; import org.openjdk.jmh.annotations.Benchmark; public class Serialization extends JsonBench {</BUG> @Benchmark
import com.alibaba.fastjson.serializer.SerializerFeature; import com.github.fabienrenaud.jjb.JsonUtils; import java.io.ByteArrayOutputStream; public class Serialization extends JsonBench {
15,211
import com.github.fabienrenaud.jjb.JsonBench; import org.openjdk.jmh.annotations.Benchmark; public class Serialization extends JsonBench {</BUG> @Benchmark @Override <BUG>public Object gson() { return JSON_SOURCE.provider().gson().toJson(JSON_SOURCE.nextPojo()); }</BUG> @Benchmark
import com.github.fabienrenaud.jjb.JsonUtils; import java.io.ByteArrayOutputStream; public class Serialization extends JsonBench {
15,212
return JSON_SOURCE.provider().gson().toJson(JSON_SOURCE.nextPojo()); }</BUG> @Benchmark @Override <BUG>public Object jackson() throws JsonProcessingException { return JSON_SOURCE.provider().jackson().writeValueAsString(JSON_SOURCE.nextPojo()); }</BUG> @Benchmark
import com.github.fabienrenaud.jjb.JsonBench; import com.github.fabienrenaud.jjb.JsonUtils; import org.openjdk.jmh.annotations.Benchmark; import java.io.ByteArrayOutputStream; public class Serialization extends JsonBench {
15,213
return JSON_SOURCE.provider().jackson().writeValueAsString(JSON_SOURCE.nextPojo()); }</BUG> @Benchmark @Override <BUG>public Object jackson_afterburner() throws JsonProcessingException { return JSON_SOURCE.provider().jacksonAfterburner().writeValueAsString(JSON_SOURCE.nextPojo()); }</BUG> @Benchmark
import com.github.fabienrenaud.jjb.JsonBench; import com.github.fabienrenaud.jjb.JsonUtils; import org.openjdk.jmh.annotations.Benchmark; import java.io.ByteArrayOutputStream; public class Serialization extends JsonBench {
15,214
return JSON_SOURCE.provider().jacksonAfterburner().writeValueAsString(JSON_SOURCE.nextPojo()); }</BUG> @Benchmark @Override <BUG>public Object genson() { return JSON_SOURCE.provider().genson().serialize(JSON_SOURCE.nextPojo()); }</BUG> @Benchmark
import com.github.fabienrenaud.jjb.JsonBench; import com.github.fabienrenaud.jjb.JsonUtils; import org.openjdk.jmh.annotations.Benchmark; import java.io.ByteArrayOutputStream; public class Serialization extends JsonBench {
15,215
return JSON_SOURCE.provider().genson().serialize(JSON_SOURCE.nextPojo()); }</BUG> @Benchmark @Override <BUG>public Object fastjson() { return JSON.toJSONString(JSON_SOURCE.nextPojo()); }</BUG> @Benchmark
import com.github.fabienrenaud.jjb.JsonBench; import com.github.fabienrenaud.jjb.JsonUtils; import org.openjdk.jmh.annotations.Benchmark; import java.io.ByteArrayOutputStream; public class Serialization extends JsonBench {
15,216
public Object flexjson() { return JSON_SOURCE.provider().flexjsonSer().serialize(JSON_SOURCE.nextPojo()); } @Benchmark @Override <BUG>public Object boon() { return JSON_SOURCE.provider().boon().writeValueAsString(JSON_SOURCE.nextPojo()); }</BUG> @Benchmark
[DELETED]
15,217
return JSON_SOURCE.provider().boon().writeValueAsString(JSON_SOURCE.nextPojo()); }</BUG> @Benchmark @Override <BUG>public Object johnson() { return JSON_SOURCE.provider().johnson().writeObjectAsString(JSON_SOURCE.nextPojo()); }</BUG> @Benchmark
public Object flexjson() { return JSON_SOURCE.provider().flexjsonSer().serialize(JSON_SOURCE.nextPojo()); }
15,218
import org.opencms.ui.components.CmsBasicDialog.DialogWidth; import org.opencms.ui.components.CmsErrorDialog; import org.opencms.ui.components.CmsResourceIcon; import org.opencms.ui.components.CmsResourceInfo; import org.opencms.ui.components.OpenCmsTheme; <BUG>import org.opencms.ui.components.fileselect.CmsSitemapTreeContainer; import org.opencms.ui.contextmenu.CmsContextMenu;</BUG> import org.opencms.ui.contextmenu.CmsContextMenu.ContextMenuItem; import org.opencms.ui.contextmenu.CmsContextMenu.ContextMenuItemClickEvent; import org.opencms.ui.contextmenu.CmsContextMenu.ContextMenuItemClickListener;
import org.opencms.ui.components.fileselect.CmsSitemapTreeContainer.IconMode; import org.opencms.ui.contextmenu.CmsContextMenu;
15,219
import org.opencms.main.CmsLog; import org.opencms.main.OpenCms; import org.opencms.site.CmsSite; import org.opencms.ui.A_CmsUI; import org.opencms.ui.CmsVaadinUtils; <BUG>import org.opencms.ui.components.fileselect.CmsSitemapTreeContainer; import org.opencms.util.CmsStringUtil;</BUG> import org.opencms.workplace.CmsWorkplace; import org.opencms.workplace.explorer.CmsExplorerTypeSettings; import org.opencms.workplace.explorer.CmsResourceUtil;
import org.opencms.ui.components.fileselect.CmsSitemapTreeContainer.IconMode; import org.opencms.util.CmsStringUtil;
15,220
path = path.substring(siteRoot.length()); path = CmsStringUtil.joinPaths("/", path); } } info.getBottomLine().setValue(path); <BUG>String icon = CmsSitemapTreeContainer.getSitemapResourceIcon(A_CmsUI.getCmsObject(), resUtil.getResource()); info.getResourceIcon().initContent(resUtil, icon, null);</BUG> return info; } public Label getBottomLine() {
String icon = CmsSitemapTreeContainer.getSitemapResourceIcon( A_CmsUI.getCmsObject(), resUtil.getResource(), IconMode.localeCompare); info.getResourceIcon().initContent(resUtil, icon, null);
15,221
import org.opencms.workplace.explorer.CmsExplorerTypeSettings; import java.util.List; import org.apache.commons.logging.Log; import com.google.common.collect.Lists; import com.vaadin.data.Item; <BUG>public class CmsSitemapTreeContainer extends CmsResourceTreeContainer { private static final Log LOG = CmsLog.getLog(CmsSitemapTreeContainer.class);</BUG> private static final long serialVersionUID = 1L; public CmsSitemapTreeContainer() { super();
public enum IconMode { localeCompare, sitemapSelect; } private static final Log LOG = CmsLog.getLog(CmsSitemapTreeContainer.class);
15,222
return CmsWorkplace.getResourceUri(CmsWorkplace.RES_PATH_FILETYPES + CmsIconUtil.ICON_NAV_LEVEL_BIG); } CmsResource maybePage = resourcesForType.get(0); if (CmsResourceTypeXmlContainerPage.isContainerPage(maybePage)) { CmsADEConfigData config = OpenCms.getADEManager().lookupConfiguration(cms, maybePage.getRootPath()); <BUG>for (DetailInfo info : config.getDetailInfos(cms)) { CmsDetailPageInfo realInfo = info.getDetailPageInfo(); </BUG> if (realInfo.getUri().equals(maybePage.getRootPath()) || realInfo.getUri().equals(CmsResource.getParentFolder(maybePage.getRootPath()))) {
for (CmsDetailPageInfo realInfo : config.getAllDetailPages(true)) {
15,223
import android.graphics.Point; import android.util.Log; import org.catrobat.paintroid.PaintroidApplication; import org.catrobat.paintroid.tools.helper.FillAlgorithm; public class FillCommand extends BaseCommand { <BUG>public static final int COLOR_TOLERANCE = 50; private static final int EMPTY_COMMAND_LIST_LENGTH = 1; private Point mClickedPixel; public FillCommand(Point clickedPixel, Paint currentPaint) { </BUG> super(currentPaint);
private float mColorTolerance; public FillCommand(Point clickedPixel, Paint currentPaint, float colorTolerance) {
15,224
private Point mClickedPixel; public FillCommand(Point clickedPixel, Paint currentPaint) { </BUG> super(currentPaint); <BUG>mClickedPixel = clickedPixel; }</BUG> @Override public void run(Canvas canvas, Bitmap bitmap) { notifyStatus(NOTIFY_STATES.COMMAND_STARTED); if (mClickedPixel == null) {
public FillCommand(Point clickedPixel, Paint currentPaint, float colorTolerance) { mColorTolerance = colorTolerance; }
15,225
Log.w(PaintroidApplication.TAG, "Fill Command color: " + mPaint.getColor()); } else { int replacementColor = bitmap.getPixel(mClickedPixel.x, mClickedPixel.y); int targetColor = mPaint.getColor(); <BUG>FillAlgorithm fillAlgorithm = new FillAlgorithm(bitmap, mClickedPixel, targetColor, replacementColor, COLOR_TOLERANCE); </BUG> fillAlgorithm.performFilling(); } notifyStatus(NOTIFY_STATES.COMMAND_DONE);
FillAlgorithm fillAlgorithm = new FillAlgorithm(bitmap, mClickedPixel, targetColor, replacementColor, mColorTolerance);
15,226
package org.catrobat.paintroid.test.junit.tools; import android.graphics.Bitmap; import android.graphics.Color; <BUG>import android.graphics.Point; import org.catrobat.paintroid.R; import org.catrobat.paintroid.command.implementation.FillCommand;</BUG> import org.catrobat.paintroid.test.utils.PrivateAccess; import org.catrobat.paintroid.tools.ToolType;
import android.util.Log;
15,227
import org.catrobat.paintroid.tools.implementation.FillTool; import org.catrobat.paintroid.ui.TopBar.ToolButtonIDs; import org.junit.Before; import org.junit.Test; import java.util.Queue; <BUG>public class FillToolTests extends BaseToolTest { public FillToolTests() {</BUG> super(); } @Override
private static final float NO_TOLERANCE = 0.0f; private static final float HALF_TOLERANCE = FillTool.MAX_TOLERANCE / 2.0f; private static final float MAX_TOLERANCE = FillTool.MAX_TOLERANCE; public FillToolTests() {
15,228
assertEquals(ToolType.FILL, toolType); } @Test public void testShouldReturnCorrectResourceForBottomButtonOne() { int resource = mToolToTest.getAttributeButtonResource(ToolButtonIDs.BUTTON_ID_PARAMETER_BOTTOM_1); <BUG>assertEquals("Transparent should be displayed", R.drawable.icon_menu_no_icon, resource); </BUG> } @Test public void testShouldReturnCorrectResourceForBottomButtonTwo() {
assertEquals("Fill options should be displayed", R.drawable.icon_fill_options, resource);
15,229
int[][] pixels = createBitmapArrayAndDrawSpiral(replacementColor, boundaryColor); int height = pixels.length; int width = pixels[0].length; Point clickedPixel = new Point(1, 1); Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); <BUG>FillAlgorithm fillAlgorithm = new FillAlgorithm(bitmap, clickedPixel, targetColor, replacementColor, FillCommand.COLOR_TOLERANCE); </BUG> PrivateAccess.setMemberValue(FillAlgorithm.class, fillAlgorithm, "mPixels", pixels); fillAlgorithm.performFilling(); int[][] actualPixels = (int[][]) PrivateAccess.getMemberValue(FillAlgorithm.class, fillAlgorithm, "mPixels");
FillAlgorithm fillAlgorithm = new FillAlgorithm(bitmap, clickedPixel, targetColor, replacementColor, NO_TOLERANCE);
15,230
package org.catrobat.paintroid; import java.io.File; import org.catrobat.paintroid.dialog.BrushPickerDialog; import org.catrobat.paintroid.dialog.CustomAlertDialogBuilder; import org.catrobat.paintroid.dialog.DialogAbout; <BUG>import org.catrobat.paintroid.dialog.DialogTermsOfUseAndService; import org.catrobat.paintroid.dialog.IndeterminateProgressDialog;</BUG> import org.catrobat.paintroid.dialog.InfoDialog; import org.catrobat.paintroid.dialog.InfoDialog.DialogType; import org.catrobat.paintroid.dialog.TextToolDialog;
import org.catrobat.paintroid.dialog.FillToolDialog; import org.catrobat.paintroid.dialog.IndeterminateProgressDialog;
15,231
public void onCreate(Bundle savedInstanceState) { ColorPickerDialog.init(this); BrushPickerDialog.init(this); ToolsDialog.init(this); IndeterminateProgressDialog.init(this); <BUG>TextToolDialog.init(this); super.onCreate(savedInstanceState);</BUG> setContentView(R.layout.main); initActionBar(); PaintroidApplication.catroidPicturePath = null;
FillToolDialog.init(this); super.onCreate(savedInstanceState);
15,232
import java.util.List; import jetbrains.buildServer.dotNet.buildRunner.agent.TextParser; import jetbrains.buildServer.util.StringUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; <BUG>public class AccessControlListProviderImpl implements AccessControlListProvider { private final PathsService myPathsService;</BUG> private final TextParser<AccessControlList> myFileAccessParser; public AccessControlListProviderImpl( @NotNull final PathsService pathsService,
private static final Logger LOG = Logger.getInstance(AccessControlListProviderImpl.class.getName()); private final PathsService myPathsService;
15,233
myFileAccessParser = fileAccessParser; } @NotNull @Override public AccessControlList getAfterAgentInitializedAcl(@Nullable final String additionalAcl) { <BUG>final List<AccessControlEntry> acl = new ArrayList<AccessControlEntry>( </BUG> Arrays.asList( new AccessControlEntry(myPathsService.getPath(WellKnownPaths.Work), AccessControlAccount.forAll(), EnumSet.of(AccessPermissions.GrantRead, AccessPermissions.Recursive)), new AccessControlEntry(myPathsService.getPath(WellKnownPaths.System), AccessControlAccount.forAll(), EnumSet.of(AccessPermissions.GrantRead, AccessPermissions.GrantWrite, AccessPermissions.GrantExecute, AccessPermissions.Recursive)),
final List<AccessControlEntry> aceList = new ArrayList<AccessControlEntry>(
15,234
package jetbrains.buildServer.runAs.agent; import java.io.File; <BUG>import java.util.EnumSet; import org.jetbrains.annotations.NotNull; class AccessControlEntry {</BUG> @NotNull private final File myFile; private final AccessControlAccount myAccount;
import com.intellij.openapi.util.text.StringUtil; import java.util.HashMap; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; class AccessControlEntry {
15,235
import java.util.regex.Matcher; import java.util.regex.Pattern; import jetbrains.buildServer.dotNet.buildRunner.agent.BuildStartException; import jetbrains.buildServer.dotNet.buildRunner.agent.TextParser; import org.jetbrains.annotations.NotNull; <BUG>public class FileAccessParser implements TextParser<AccessControlList> { private static final Pattern OutAccessPattern = Pattern.compile("\\s*([rcua\\s]+)\\s*([\\+\\-rwx\\s]+)\\s*,(.+)", Pattern.CASE_INSENSITIVE); private final PathsService myPathsService; public FileAccessParser( @NotNull final PathsService pathsService) { myPathsService = pathsService; }</BUG> @NotNull
private static final Logger LOG = Logger.getInstance(FileAccessParser.class.getName());
15,236
package jetbrains.buildServer.runAs.agent; import java.util.ArrayList; <BUG>import java.util.Collections; import java.util.List;</BUG> import jetbrains.buildServer.dotNet.buildRunner.agent.CommandLineExecutionContext; import org.jetbrains.annotations.NotNull; public class AccessControlResourceImpl implements AccessControlResource {
import java.util.HashMap; import java.util.List;
15,237
import jetbrains.buildServer.runAs.common.Constants; import jetbrains.buildServer.util.StringUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; public class ParametersServiceImpl implements ParametersService { <BUG>private final SecuredParametersService mySecuredParametersService; public ParametersServiceImpl( @NotNull final SecuredParametersService securedParametersService) { mySecuredParametersService = securedParametersService; }</BUG> @Nullable
private final RunnerParametersService myRunnerParametersService; private final BuildFeatureParametersService myBuildFeatureParametersService; @NotNull final RunnerParametersService runnerParametersService, @NotNull final BuildFeatureParametersService buildFeatureParametersService) { myRunnerParametersService = runnerParametersService; myBuildFeatureParametersService = buildFeatureParametersService; }
15,238
} else { mb.bold(true).escaped("Viewing order for " + args[0].toLowerCase() + ":").bold(false); BufferedReader reader = new BufferedReader(new InputStreamReader(stream)); String line; while ((line = reader.readLine()) != null) { <BUG>mb.raw("\n"); if (line.startsWith("**")) {</BUG> mb.bold(true).escaped(line.substring(2)).bold(false); } else if (line.startsWith("//")) { mb.italic(true).escaped(line.substring(2)).italic(false);
InputStream stream = this.getClass().getResourceAsStream("/viewingorder/" + args[0].toLowerCase() + ".txt"); if (stream == null) { mb.escaped("No viewing order found with name " + args[0].toLowerCase()); mb.newLine(); if (line.startsWith("**")) {
15,239
group.sendMessage(mb.escaped("[Hangman] The phrase has been set to: ").code(true).escaped(this.currentPhrase)); } } else if (this.currentPhrase == null) { group.sendMessage(mb.escaped("[Hangman] There is no game in progress currently!").newLine().escaped("[Hangman] To set the phrase, PM me `" + prefix + "hangman [phrase]`!")); } else if (args.length != 1) { <BUG>group.sendMessage(mb.bold(true).escaped("Usage: ").bold(false).escaped(prefix + "hangman [guess]").raw(this.currentPhrase != null ? sys.message().newLine().escaped("Phrase so far: ").code(true).escaped(this.found).build() : "")); </BUG> } else { char first = args[0].trim().toUpperCase().charAt(0); if (args[0].trim().length() != 1) {
group.sendMessage(mb.bold(true).escaped("Usage: ").bold(false).escaped(prefix + "hangman [guess]").raw(this.currentPhrase != null ? sys.message().newLine().escaped("Phrase so far: ").code(true).escaped(this.found) : sys.message()));
15,240
this.sendNoProfile(sys, user, group); return; } Map<Show, String> progress = SuperBotController.getUserProgress(prof.getName()); Calendar now = Calendar.getInstance(); <BUG>List<String> lines = new LinkedList<>(); </BUG> for (Entry<Show, String> entry : progress.entrySet()) { Show show = entry.getKey(); if (show == null) {
List<MessageBuilder> lines = new LinkedList<>();
15,241
if (set != null) { lines.add(this.get(day, set, sys)); } } if (args.length > 0) { <BUG>lines.removeIf(s -> !s.toLowerCase().contains(Joiner.join(" ", args).toLowerCase())); </BUG> } MessageBuilder builder = sys.message(); builder.bold(true).escaped(lines.isEmpty() ? "No matching shows or days." : "Shows by day:").bold(false);
lines.removeIf(s -> !s.build().toLowerCase().contains(Joiner.join(" ", args).toLowerCase()));
15,242
if (argz.size() > 0) { sent = true; for (int i = 0; i < argz.size(); i++) { Show show = SuperBotShows.getShow(argz.get(i)); if (i > 0) { <BUG>builder.raw("\n"); }</BUG> if (show == null) { builder = builder.escaped("Invalid show: " + argz.get(i)); } else {
builder.newLine(); }
15,243
if (!started.getAndSet(true)) { board.get().playerTwo = clicker.getUniqueId(); resultMessage.set(sys.message().escaped("Tic Tac Toe").newLine().escaped(user.getUsername()).escaped(" vs ").escaped(clicker.getUsername())); Consumer<Boolean> onWin = playerOne -> m.get().edit(sys.message().escaped("Congratulations, " + (playerOne ? user.getUsername() : clicker.getUsername())).newLine().raw(board.get().toTextKeyboard(sys)).setKeyboard(new Keyboard())); Runnable onDraw = () -> m.get().edit(sys.message().escaped("It's a draw between " + user.getUsername() + " and " + clicker.getUsername()).newLine().raw(board.get().toTextKeyboard(sys)).setKeyboard(new Keyboard())); <BUG>onClick.set(() -> m.get().edit(sys.message().raw(resultMessage.get().build()).newLine().escaped("It's " + (board.get().playerOneTurn ? user.getUsername() : clicker.getUsername()) + "'s turn!").setKeyboard(board.get().toKeyboard(onClick.get(), onDraw, onWin)))); onClick.get().run();</BUG> } }))); m.set(group.sendMessage(sys.message().escaped("Click to begin ").bold(z -> z.escaped("Tic Tac Toe")).setKeyboard(kb)));
onClick.set(() -> m.get().edit(sys.message().raw(resultMessage.get()).newLine().escaped("It's " + (board.get().playerOneTurn ? user.getUsername() : clicker.getUsername()) + "'s turn!").setKeyboard(board.get().toKeyboard(onClick.get(), onDraw, onWin)))); onClick.get().run();
15,244
try { Sys sys = SuperBotController.PROVIDERS.get(linkedGroup.getKey()); if (sys != null) { Group o = sys.getGroup(linkedGroup.getValue()); if (o != null) { <BUG>o.sendMessage(m); }</BUG> } } catch (Exception ex) { ex.printStackTrace();
Set<Map.Entry<String, String>> linkedGroups = LinkCommand.getLinkedGroups(this); for (Map.Entry<String, String> linkedGroup : linkedGroups) { o.sendMessageNoShare(sys.message().raw(m));
15,245
import java.net.URL; import xyz.nickr.superbot.Imgur; public interface Conversable { Sys getProvider(); String getUniqueId(); <BUG>Message sendMessage(MessageBuilder mb); default boolean supportsMultiplePhotos() {</BUG> return false; } default void sendPhoto(File file) {
Message sendMessageNoShare(MessageBuilder mb); default boolean supportsMultiplePhotos() {
15,246
<BUG>package org.apache.commons.jcs.access; import org.apache.commons.jcs.JCS;</BUG> import org.apache.commons.jcs.access.behavior.ICacheAccess; import org.apache.commons.jcs.access.exception.CacheException; import org.apache.commons.jcs.access.exception.ConfigurationException;
import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import org.apache.commons.jcs.JCS;
15,247
import org.apache.commons.jcs.engine.behavior.ICompositeCacheAttributes; import org.apache.commons.jcs.engine.behavior.IElementAttributes; import org.apache.commons.jcs.engine.stats.behavior.ICacheStats; import org.apache.commons.jcs.utils.props.AbstractPropertyContainer; import org.apache.commons.logging.Log; <BUG>import org.apache.commons.logging.LogFactory; import java.io.Serializable; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; public class PartitionedCacheAccess<K extends Serializable, V extends Serializable></BUG> extends AbstractPropertyContainer
public class PartitionedCacheAccess<K, V>
15,248
<BUG>package org.apache.commons.jcs.auxiliary.lateral.socket.tcp; import org.apache.commons.jcs.auxiliary.lateral.LateralElementDescriptor;</BUG> import org.apache.commons.jcs.auxiliary.lateral.socket.tcp.behavior.ITCPLateralCacheAttributes; import org.apache.commons.jcs.io.ObjectInputStreamClassLoaderAware; import org.apache.commons.logging.Log;
import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.net.InetSocketAddress; import java.net.Socket; import org.apache.commons.jcs.auxiliary.lateral.LateralElementDescriptor;
15,249
import org.apache.commons.jcs.auxiliary.lateral.LateralElementDescriptor;</BUG> import org.apache.commons.jcs.auxiliary.lateral.socket.tcp.behavior.ITCPLateralCacheAttributes; import org.apache.commons.jcs.io.ObjectInputStreamClassLoaderAware; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; <BUG>import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.net.InetSocketAddress; import java.net.Socket;</BUG> public class LateralTCPSender
package org.apache.commons.jcs.auxiliary.lateral.socket.tcp; import java.net.Socket; import org.apache.commons.jcs.auxiliary.lateral.LateralElementDescriptor;
15,250
<BUG>package org.apache.commons.jcs.auxiliary.remote.http.server; import org.apache.commons.jcs.engine.behavior.ICacheElement;</BUG> import org.apache.commons.jcs.engine.behavior.ICacheServiceNonLocal; import org.apache.commons.jcs.engine.behavior.ICompositeCacheManager; import org.apache.commons.jcs.engine.control.CompositeCache;
import java.io.IOException; import java.io.Serializable; import java.util.Map; import java.util.Set; import org.apache.commons.jcs.engine.behavior.ICacheElement;
15,251
import org.apache.commons.jcs.engine.control.CompositeCache; import org.apache.commons.jcs.engine.logging.CacheEvent; import org.apache.commons.jcs.engine.logging.behavior.ICacheEvent; import org.apache.commons.jcs.engine.logging.behavior.ICacheEventLogger; import org.apache.commons.logging.Log; <BUG>import org.apache.commons.logging.LogFactory; import java.io.IOException; import java.io.Serializable; import java.util.Map; import java.util.Set; public abstract class AbstractRemoteCacheService<K extends Serializable, V extends Serializable></BUG> implements ICacheServiceNonLocal<K, V>
public abstract class AbstractRemoteCacheService<K, V>
15,252
if ( cacheEventLogger != null ) { cacheEventLogger.logApplicationEvent( source, eventName, optionalDetails ); } } <BUG>protected <T extends Serializable> void logICacheEvent( ICacheEvent<T> cacheEvent ) {</BUG> if ( cacheEventLogger != null ) { cacheEventLogger.logICacheEvent( cacheEvent );
protected <T> void logICacheEvent( ICacheEvent<T> cacheEvent )
15,253
it.remove();</BUG> } <BUG>} } } private void printContainingComments(Node n, Object arg) { if (comments != null) {</BUG> Iterator<Comment> it = comments.iterator(); while (it.hasNext()) {
javadoc.accept(this, arg); private void printPreviousComments(Node n, Object arg) { if (comments != null) { Node previous = null;
15,254
printer.print(" = "); n.getValue().accept(this, arg); } public void visit(LineComment n, Object arg) { printer.print("//"); <BUG>printer.print(n.getContent()); if (!n.getContent().endsWith("\n")) { printer.printLn(); }</BUG> }
String content = n.getContent(); if (content.endsWith("\n")) { content = content.substring(0, content.length() - 1); printer.printLn(content);
15,255
package jetbrains.mps.smodel.language; import jetbrains.mps.smodel.Language; import jetbrains.mps.smodel.LanguageAspect; <BUG>import jetbrains.mps.smodel.SNodeUtil; import jetbrains.mps.smodel.adapter.MetaAdapterByDeclaration; import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory; import jetbrains.mps.smodel.structure.ExtensionPoint; import jetbrains.mps.util.annotation.ToRemove; import org.jetbrains.annotations.NotNull;</BUG> import org.jetbrains.annotations.Nullable;
import jetbrains.mps.util.IterableUtil; import org.apache.log4j.LogManager; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull;
15,256
if (getNewAspect(model) != null) return true; return false; } public static Collection<SModel> getAspectModels(@NotNull SModule language) { assert language instanceof Language; <BUG>LinkedHashSet<SModel> result = new LinkedHashSet<SModel>(); for (LanguageAspect la : LanguageAspect.values()) {</BUG> SModel aspectModel = la.get(((Language) language)); if (aspectModel == null) continue; result.add(aspectModel);
for (LanguageAspectDescriptor d : collectAspects()) { result.addAll(d.getAspectModels(language)); for (LanguageAspect la : LanguageAspect.values()) {
15,257
import org.apache.sling.jcr.resource.JcrResourceConstants; import org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl; import org.apache.sling.jcr.resource.internal.helper.MapEntries; import org.apache.sling.jcr.resource.internal.helper.Mapping; import org.apache.sling.performance.annotation.PerformanceTestSuite; <BUG>import org.apache.sling.performance.tests.ResolveNonExistingWith10000AliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWith10000VanityPathTest; import org.apache.sling.performance.tests.ResolveNonExistingWith1000AliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWith1000VanityPathTest; import org.apache.sling.performance.tests.ResolveNonExistingWith5000AliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWith5000VanityPathTest;</BUG> import org.junit.runner.RunWith;
import org.apache.sling.performance.tests.ResolveNonExistingWithManyAliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWithManyVanityPathTest;
15,258
@PerformanceTestSuite public ParameterizedTestList testPerformance() throws Exception { Helper helper = new Helper(); ParameterizedTestList testCenter = new ParameterizedTestList(); testCenter.setTestSuiteTitle("jcr.resource-2.0.10"); <BUG>testCenter.addTestObject(new ResolveNonExistingWith1000VanityPathTest(helper)); testCenter.addTestObject(new ResolveNonExistingWith5000VanityPathTest(helper)); testCenter.addTestObject(new ResolveNonExistingWith10000VanityPathTest(helper)); testCenter.addTestObject(new ResolveNonExistingWith1000AliasTest(helper)); testCenter.addTestObject(new ResolveNonExistingWith5000AliasTest(helper)); testCenter.addTestObject(new ResolveNonExistingWith10000AliasTest(helper)); </BUG> return testCenter;
testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith1000VanityPathTest",helper, 100, 10)); testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith5000VanityPathTest",helper, 100, 50)); testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith10000VanityPathTest",helper, 100, 100)); testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWithManyAliasTest",helper, 1000)); testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWith5000AliasTest",helper, 5000)); testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWith10000AliasTest",helper, 10000));
15,259
package org.apache.sling.performance; <BUG>import static org.mockito.Mockito.*; import javax.jcr.NamespaceRegistry;</BUG> import javax.jcr.Session; import junitx.util.PrivateAccessor;
import static org.mockito.Mockito.when; import static org.mockito.Mockito.mock; import javax.jcr.NamespaceRegistry;
15,260
import org.apache.sling.jcr.resource.JcrResourceConstants; import org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl; import org.apache.sling.jcr.resource.internal.helper.MapEntries; import org.apache.sling.jcr.resource.internal.helper.Mapping; import org.apache.sling.performance.annotation.PerformanceTestSuite; <BUG>import org.apache.sling.performance.tests.ResolveNonExistingWith10000AliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWith10000VanityPathTest; import org.apache.sling.performance.tests.ResolveNonExistingWith1000AliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWith1000VanityPathTest; import org.apache.sling.performance.tests.ResolveNonExistingWith5000AliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWith5000VanityPathTest;</BUG> import org.junit.runner.RunWith;
import org.apache.sling.performance.tests.ResolveNonExistingWithManyAliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWithManyVanityPathTest;
15,261
import org.apache.sling.api.resource.ResourceResolver; import org.apache.sling.jcr.api.SlingRepository; import org.apache.sling.jcr.resource.JcrResourceConstants; import org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProviderFactory; import org.apache.sling.performance.annotation.PerformanceTestSuite; <BUG>import org.apache.sling.performance.tests.ResolveNonExistingWith10000AliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWith10000VanityPathTest; import org.apache.sling.performance.tests.ResolveNonExistingWith1000AliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWith1000VanityPathTest; import org.apache.sling.performance.tests.ResolveNonExistingWith5000AliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWith5000VanityPathTest;</BUG> import org.apache.sling.resourceresolver.impl.ResourceResolverFactoryActivator;
import org.apache.sling.performance.tests.ResolveNonExistingWithManyAliasTest; import org.apache.sling.performance.tests.ResolveNonExistingWithManyVanityPathTest;
15,262
@PerformanceTestSuite public ParameterizedTestList testPerformance() throws Exception { Helper helper = new Helper(); ParameterizedTestList testCenter = new ParameterizedTestList(); testCenter.setTestSuiteTitle("jcr.resource-2.2.0"); <BUG>testCenter.addTestObject(new ResolveNonExistingWith1000VanityPathTest(helper)); testCenter.addTestObject(new ResolveNonExistingWith5000VanityPathTest(helper)); testCenter.addTestObject(new ResolveNonExistingWith10000VanityPathTest(helper)); testCenter.addTestObject(new ResolveNonExistingWith1000AliasTest(helper)); testCenter.addTestObject(new ResolveNonExistingWith5000AliasTest(helper)); testCenter.addTestObject(new ResolveNonExistingWith10000AliasTest(helper)); </BUG> return testCenter;
testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith1000VanityPathTest",helper, 100, 10)); testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith5000VanityPathTest",helper, 100, 50)); testCenter.addTestObject(new ResolveNonExistingWithManyVanityPathTest("ResolveNonExistingWith10000VanityPathTest",helper, 100, 100)); testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWith1000AliasTest",helper, 1000)); testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWith5000AliasTest",helper, 5000)); testCenter.addTestObject(new ResolveNonExistingWithManyAliasTest("ResolveNonExistingWith10000AliasTest",helper, 10000));
15,263
System.out.println(change); } } }; @Override <BUG>protected Callback<VChild, Void> copyChildCallback() </BUG> { return (child) -> {
protected Callback<VChild, Void> copyIntoCallback()
15,264
package jfxtras.labs.icalendarfx.components; import jfxtras.labs.icalendarfx.properties.component.descriptive.Comment; <BUG>import jfxtras.labs.icalendarfx.properties.component.misc.IANAProperty; import jfxtras.labs.icalendarfx.properties.component.misc.UnknownProperty;</BUG> import jfxtras.labs.icalendarfx.properties.component.recurrence.RecurrenceDates; import jfxtras.labs.icalendarfx.properties.component.recurrence.RecurrenceRule;
import jfxtras.labs.icalendarfx.properties.component.misc.NonStandardProperty;
15,265
VEVENT ("VEVENT", Arrays.asList(PropertyType.ATTACHMENT, PropertyType.ATTENDEE, PropertyType.CATEGORIES, PropertyType.CLASSIFICATION, PropertyType.COMMENT, PropertyType.CONTACT, PropertyType.DATE_TIME_CREATED, PropertyType.DATE_TIME_END, PropertyType.DATE_TIME_STAMP, PropertyType.DATE_TIME_START, PropertyType.DESCRIPTION, PropertyType.DURATION, PropertyType.EXCEPTION_DATE_TIMES, <BUG>PropertyType.GEOGRAPHIC_POSITION, PropertyType.IANA_PROPERTY, PropertyType.LAST_MODIFIED, PropertyType.LOCATION, PropertyType.NON_STANDARD, PropertyType.ORGANIZER, PropertyType.PRIORITY,</BUG> PropertyType.RECURRENCE_DATE_TIMES, PropertyType.RECURRENCE_IDENTIFIER, PropertyType.RELATED_TO, PropertyType.RECURRENCE_RULE, PropertyType.REQUEST_STATUS, PropertyType.RESOURCES, PropertyType.SEQUENCE, PropertyType.STATUS, PropertyType.SUMMARY, PropertyType.TIME_TRANSPARENCY, PropertyType.UNIQUE_IDENTIFIER,
PropertyType.GEOGRAPHIC_POSITION, PropertyType.LAST_MODIFIED, PropertyType.LOCATION, PropertyType.NON_STANDARD, PropertyType.ORGANIZER, PropertyType.PRIORITY,
15,266
VTODO ("VTODO", Arrays.asList(PropertyType.ATTACHMENT, PropertyType.ATTENDEE, PropertyType.CATEGORIES, PropertyType.CLASSIFICATION, PropertyType.COMMENT, PropertyType.CONTACT, PropertyType.DATE_TIME_COMPLETED, PropertyType.DATE_TIME_CREATED, PropertyType.DATE_TIME_DUE, PropertyType.DATE_TIME_STAMP, PropertyType.DATE_TIME_START, PropertyType.DESCRIPTION, PropertyType.DURATION, <BUG>PropertyType.EXCEPTION_DATE_TIMES, PropertyType.GEOGRAPHIC_POSITION, PropertyType.IANA_PROPERTY, PropertyType.LAST_MODIFIED, PropertyType.LOCATION, PropertyType.NON_STANDARD, PropertyType.ORGANIZER,</BUG> PropertyType.PERCENT_COMPLETE, PropertyType.PRIORITY, PropertyType.RECURRENCE_DATE_TIMES, PropertyType.RECURRENCE_IDENTIFIER, PropertyType.RELATED_TO, PropertyType.RECURRENCE_RULE, PropertyType.REQUEST_STATUS, PropertyType.RESOURCES, PropertyType.SEQUENCE, PropertyType.STATUS,
PropertyType.EXCEPTION_DATE_TIMES, PropertyType.GEOGRAPHIC_POSITION, PropertyType.LAST_MODIFIED, PropertyType.LOCATION, PropertyType.NON_STANDARD, PropertyType.ORGANIZER,
15,267
throw new RuntimeException("not implemented"); } }, DAYLIGHT_SAVING_TIME ("DAYLIGHT", Arrays.asList(PropertyType.COMMENT, PropertyType.DATE_TIME_START, <BUG>PropertyType.IANA_PROPERTY, PropertyType.NON_STANDARD, PropertyType.RECURRENCE_DATE_TIMES, PropertyType.RECURRENCE_RULE, PropertyType.TIME_ZONE_NAME, PropertyType.TIME_ZONE_OFFSET_FROM,</BUG> PropertyType.TIME_ZONE_OFFSET_TO), DaylightSavingTime.class) {
PropertyType.RECURRENCE_RULE, PropertyType.TIME_ZONE_NAME, PropertyType.TIME_ZONE_OFFSET_FROM,
15,268
throw new RuntimeException("not implemented"); } }, VALARM ("VALARM", Arrays.asList(PropertyType.ACTION, PropertyType.ATTACHMENT, PropertyType.ATTENDEE, PropertyType.DESCRIPTION, <BUG>PropertyType.DURATION, PropertyType.IANA_PROPERTY, PropertyType.NON_STANDARD, PropertyType.REPEAT_COUNT, PropertyType.SUMMARY, PropertyType.TRIGGER),</BUG> VAlarm.class) { @Override
DAYLIGHT_SAVING_TIME ("DAYLIGHT", Arrays.asList(PropertyType.COMMENT, PropertyType.DATE_TIME_START, PropertyType.NON_STANDARD, PropertyType.RECURRENCE_DATE_TIMES, PropertyType.RECURRENCE_RULE, PropertyType.TIME_ZONE_NAME, PropertyType.TIME_ZONE_OFFSET_FROM, PropertyType.TIME_ZONE_OFFSET_TO), DaylightSavingTime.class)
15,269
private ContentLineStrategy contentLineGenerator; protected void setContentLineGenerator(ContentLineStrategy contentLineGenerator) { this.contentLineGenerator = contentLineGenerator; } <BUG>protected Callback<VChild, Void> copyChildCallback() </BUG> { throw new RuntimeException("Can't copy children. copyChildCallback isn't overridden in subclass." + this.getClass()); };
protected Callback<VChild, Void> copyIntoCallback()
15,270
import jfxtras.labs.icalendarfx.properties.calendar.Version; import jfxtras.labs.icalendarfx.properties.component.misc.NonStandardProperty; public enum CalendarProperty { CALENDAR_SCALE ("CALSCALE", <BUG>Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD, ParameterType.IANA_PARAMETER), CalendarScale.class)</BUG> { @Override public VChild parse(VCalendar vCalendar, String contentLine)
Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD), CalendarScale.class)
15,271
CalendarScale calendarScale = (CalendarScale) child; destination.setCalendarScale(calendarScale); } }, METHOD ("METHOD", <BUG>Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD, ParameterType.IANA_PARAMETER), Method.class)</BUG> { @Override public VChild parse(VCalendar vCalendar, String contentLine)
Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD), Method.class)
15,272
} list.add(new NonStandardProperty((NonStandardProperty) child)); } }, PRODUCT_IDENTIFIER ("PRODID", <BUG>Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD, ParameterType.IANA_PARAMETER), ProductIdentifier.class)</BUG> { @Override public VChild parse(VCalendar vCalendar, String contentLine)
public void copyChild(VChild child, VCalendar destination) CalendarScale calendarScale = (CalendarScale) child; destination.setCalendarScale(calendarScale); METHOD ("METHOD", Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD), Method.class)
15,273
ProductIdentifier productIdentifier = (ProductIdentifier) child; destination.setProductIdentifier(productIdentifier); } }, VERSION ("VERSION", <BUG>Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD, ParameterType.IANA_PARAMETER), Version.class)</BUG> { @Override public VChild parse(VCalendar vCalendar, String contentLine)
Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD), Version.class)
15,274
package jfxtras.labs.icalendarfx.components; import jfxtras.labs.icalendarfx.properties.component.descriptive.Comment; <BUG>import jfxtras.labs.icalendarfx.properties.component.misc.IANAProperty; import jfxtras.labs.icalendarfx.properties.component.misc.UnknownProperty;</BUG> import jfxtras.labs.icalendarfx.properties.component.recurrence.RecurrenceDates; import jfxtras.labs.icalendarfx.properties.component.recurrence.RecurrenceRule;
import jfxtras.labs.icalendarfx.properties.component.misc.NonStandardProperty;
15,275
if (connect(isProducer)) { break; } } catch (InvalidSelectorException e) { throw new ConnectionException( <BUG>"Connection to JMS failed. Invalid message selector"); } catch (JMSException | NamingException e) { logger.log(LogLevel.ERROR, "RECONNECTION_EXCEPTION", </BUG> new Object[] { e.toString() });
Messages.getString("CONNECTION_TO_JMS_FAILED_INVALID_MSG_SELECTOR")); //$NON-NLS-1$ logger.log(LogLevel.ERROR, "RECONNECTION_EXCEPTION", //$NON-NLS-1$
15,276
private synchronized void createConnectionNoRetry() throws ConnectionException { if (!isConnectValid()) { try { connect(isProducer); } catch (JMSException e) { <BUG>logger.log(LogLevel.ERROR, "Connection to JMS failed", new Object[] { e.toString() }); throw new ConnectionException( "Connection to JMS failed. Did not try to reconnect as the policy is reconnection policy does not apply here."); }</BUG> }
logger.log(LogLevel.ERROR, "CONNECTION_TO_JMS_FAILED", new Object[] { e.toString() }); //$NON-NLS-1$ Messages.getString("CONNECTION_TO_JMS_FAILED_NO_RECONNECT_AS_RECONNECT_POLICY_DOES_NOT_APPLY")); //$NON-NLS-1$
15,277
boolean res = false; int count = 0; do { try { if(count > 0) { <BUG>logger.log(LogLevel.INFO, "ATTEMPT_TO_RESEND_MESSAGE", new Object[] { count }); </BUG> Thread.sleep(messageRetryDelay); } synchronized (getSession()) {
logger.log(LogLevel.INFO, "ATTEMPT_TO_RESEND_MESSAGE", new Object[] { count }); //$NON-NLS-1$
15,278
getProducer().send(message); res = true; } } catch (JMSException e) { <BUG>logger.log(LogLevel.WARN, "ERROR_DURING_SEND", new Object[] { e.toString() }); logger.log(LogLevel.INFO, "ATTEMPT_TO_RECONNECT"); </BUG> setConnect(null);
logger.log(LogLevel.WARN, "ERROR_DURING_SEND", new Object[] { e.toString() }); //$NON-NLS-1$ logger.log(LogLevel.INFO, "ATTEMPT_TO_RECONNECT"); //$NON-NLS-1$
15,279
import org.w3c.dom.NodeList; import org.xml.sax.SAXException; import com.ibm.streams.operator.Attribute; import com.ibm.streams.operator.StreamSchema; import com.ibm.streams.operator.Type; <BUG>import com.ibm.streams.operator.Type.MetaType; class ConnectionDocumentParser {</BUG> private static final Set<String> supportedSPLTypes = new HashSet<String>(Arrays.asList("int8", "uint8", "int16", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ "uint16", "int32", "uint32", "int64", "float32", "float64", "boolean", "blob", "rstring", "uint64", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ "decimal32", "decimal64", "decimal128", "ustring", "timestamp", "xml")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
import com.ibm.streamsx.messaging.jms.Messages; class ConnectionDocumentParser {
15,280
return msgClass; } private void convertProviderURLPath(File applicationDir) throws ParseConnectionDocumentException { if(!isAMQ()) { if(this.providerURL == null || this.providerURL.trim().length() == 0) { <BUG>throw new ParseConnectionDocumentException("A value must be specified for provider_url attribute in connection document"); }</BUG> try { URL url = new URL(providerURL); if("file".equalsIgnoreCase(url.getProtocol())) { //$NON-NLS-1$
throw new ParseConnectionDocumentException(Messages.getString("PROVIDER_URL_MUST_BE_SPECIFIED_IN_CONN_DOC")); //$NON-NLS-1$
15,281
URL absProviderURL = new URL(url.getProtocol(), url.getHost(), applicationDir.getAbsolutePath() + File.separator + path); this.providerURL = absProviderURL.toExternalForm(); } } } catch (MalformedURLException e) { <BUG>throw new ParseConnectionDocumentException("Invalid provider_url value detected: " + e.getMessage()); }</BUG> } } public void parseAndValidateConnectionDocument(String connectionDocument, String connection, String access,
throw new ParseConnectionDocumentException(Messages.getString("INVALID_PROVIDER_URL", e.getMessage())); //$NON-NLS-1$
15,282
for (int j = 0; j < accessSpecChildNodes.getLength(); j++) { if (accessSpecChildNodes.item(j).getNodeName().equals("destination")) { //$NON-NLS-1$ destIndex = j; } else if (accessSpecChildNodes.item(j).getNodeName().equals("uses_connection")) { //$NON-NLS-1$ if (!connection.equals(accessSpecChildNodes.item(j).getAttributes().getNamedItem("connection") //$NON-NLS-1$ <BUG>.getNodeValue())) { throw new ParseConnectionDocumentException("The value of the connection parameter " + connection + " is not the same as the connection used by access element " + access + " as mentioned in the uses_connection element in connections document");</BUG> }
throw new ParseConnectionDocumentException(Messages.getString("VALUE_OF_CONNECTION_PARAM_NOT_THE_SAME_AS_CONN_USED_BY_ACCESS_ELEMENT", connection, access )); //$NON-NLS-1$
15,283
nativeSchema = access_specification.item(i).getChildNodes().item(nativeSchemaIndex); } break; } } <BUG>if (!accessFound) { throw new ParseConnectionDocumentException("The value of the access parameter " + access + " is not found in the connections document");</BUG> } return nativeSchema;
throw new ParseConnectionDocumentException(Messages.getString("VALUE_OF_ACCESS_PARAM_NOT_FOUND_IN_CONN_DOC", access )); //$NON-NLS-1$
15,284
nativeAttrLength = Integer.parseInt((attrList.item(i).getAttributes().getNamedItem("length") //$NON-NLS-1$ .getNodeValue())); } if ((msgClass == MessageClass.wbe || msgClass == MessageClass.wbe22) && ((streamSchema.getAttribute(nativeAttrName) != null) && (streamSchema <BUG>.getAttribute(nativeAttrName).getType().getMetaType() == Type.MetaType.BLOB))) { throw new ParseConnectionDocumentException(" Blob data type is not supported for message class " + msgClass);</BUG> } Iterator<NativeSchema> it = nativeSchemaObjects.iterator();
throw new ParseConnectionDocumentException(Messages.getString("BLOB_NOT_SUPPORTED_FOR_MSG_CLASS", msgClass)); //$NON-NLS-1$
15,285
throw new ParseConnectionDocumentException(" Blob data type is not supported for message class " + msgClass);</BUG> } Iterator<NativeSchema> it = nativeSchemaObjects.iterator(); while (it.hasNext()) { <BUG>if (it.next().getName().equals(nativeAttrName)) { throw new ParseConnectionDocumentException("Parameter name: " + nativeAttrName + " is appearing more than once In native schema file");</BUG> } }
nativeAttrLength = Integer.parseInt((attrList.item(i).getAttributes().getNamedItem("length") //$NON-NLS-1$ .getNodeValue())); if ((msgClass == MessageClass.wbe || msgClass == MessageClass.wbe22) && ((streamSchema.getAttribute(nativeAttrName) != null) && (streamSchema .getAttribute(nativeAttrName).getType().getMetaType() == Type.MetaType.BLOB))) { throw new ParseConnectionDocumentException(Messages.getString("BLOB_NOT_SUPPORTED_FOR_MSG_CLASS", msgClass)); //$NON-NLS-1$ throw new ParseConnectionDocumentException(Messages.getString("PARAMETER_NOT_UNIQUE_IN_NATIVE_SCHEMA", nativeAttrName )); //$NON-NLS-1$
15,286
if (msgClass == MessageClass.text) { typesWithLength = new HashSet<String>(Arrays.asList("Bytes")); //$NON-NLS-1$ } Set<String> typesWithoutLength = new HashSet<String>(Arrays.asList("Byte", "Short", "Int", "Long", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ "Float", "Double", "Boolean")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ <BUG>if (typesWithoutLength.contains(nativeAttrType) && nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA) { throw new ParseConnectionDocumentException("Length attribute should not be present for parameter: " + nativeAttrName + " In native schema file");</BUG> } if ((nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA)
throw new ParseConnectionDocumentException(Messages.getString("LENGTH_ATTRIB_SHOULD_NOT_BE_PRESENT_FOR_PARAM_IN_NATIVE_SCHEMA", nativeAttrName )); //$NON-NLS-1$
15,287
if ((nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA) && (msgClass == MessageClass.wbe || msgClass == MessageClass.wbe22 || msgClass == MessageClass.xml) && (streamSchema.getAttribute(nativeAttrName) != null) && (streamSchema.getAttribute(nativeAttrName).getType().getMetaType() != Type.MetaType.RSTRING) && (streamSchema.getAttribute(nativeAttrName).getType().getMetaType() != Type.MetaType.USTRING) <BUG>&& (streamSchema.getAttribute(nativeAttrName).getType().getMetaType() != Type.MetaType.BLOB)) { throw new ParseConnectionDocumentException("Length attribute should not be present for parameter: " + nativeAttrName + " In native schema file");</BUG> } if (streamSchema.getAttribute(nativeAttrName) != null) {
throw new ParseConnectionDocumentException(Messages.getString("LENGTH_ATTRIB_SHOULD_NOT_BE_PRESENT_FOR_PARAM_IN_NATIVE_SCHEMA", nativeAttrName )); //$NON-NLS-1$
15,288
if (streamSchema.getAttribute(nativeAttrName) != null) { MetaType metaType = streamSchema.getAttribute(nativeAttrName).getType().getMetaType(); if (metaType == Type.MetaType.DECIMAL32 || metaType == Type.MetaType.DECIMAL64 || metaType == Type.MetaType.DECIMAL128 || metaType == Type.MetaType.TIMESTAMP) { if (nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA) { <BUG>throw new ParseConnectionDocumentException( "Length attribute should not be present for parameter: " + nativeAttrName + " with type " + metaType + " in native schema file.");</BUG> } if (msgClass == MessageClass.bytes) {
Messages.getString("LENGTH_ATTRIB_SHOULD_NOT_BE_PRESENT_FOR_PARAM_WITH_TYPE_IN_NATIVE_SCHEMA", nativeAttrName, metaType )); //$NON-NLS-1$
15,289
nativeAttrLength = -4; } } } if (typesWithLength.contains(nativeAttrType)) { <BUG>if (nativeAttrLength == LENGTH_ABSENT_IN_NATIVE_SCHEMA && msgClass == MessageClass.bytes) { throw new ParseConnectionDocumentException("Length attribute should be present for parameter: " + nativeAttrName + " In native schema file for message class bytes");</BUG> } if ((nativeAttrLength < 0) && nativeAttrLength != LENGTH_ABSENT_IN_NATIVE_SCHEMA) {
throw new ParseConnectionDocumentException(Messages.getString("LENGTH_ATTRIB_SHOULD_NOT_BE_PRESENT_FOR_PARAM_IN_NATIVE_SCHEMA_FOR_MSG_CLASS_BYTES", nativeAttrName )); //$NON-NLS-1$
15,290
if (streamSchema.getAttribute(nativeAttrName) != null) { streamAttrName = streamSchema.getAttribute(nativeAttrName).getName(); streamAttrMetaType = streamSchema.getAttribute(nativeAttrName).getType().getMetaType(); if ((msgClass == MessageClass.stream || msgClass == MessageClass.map) && !mapSPLToNativeSchemaDataTypesForOtherMsgClass.get(streamAttrMetaType.getLanguageType()) <BUG>.equals(nativeAttrType)) { throw new ParseConnectionDocumentException("Attribute Name: " + nativeAttrName + " with type:" + nativeAttrType + " in the native schema cannot be mapped with attribute: " + streamAttrName + " with type : " + streamAttrMetaType.getLanguageType());</BUG> }
throw new ParseConnectionDocumentException(Messages.getString("ATTRIB_WITH_TYPE_IN_NATIVE_SCHEMA_CANNOT_BE_MAPPED_TO_ATTRIB_WITH_TYPE", nativeAttrName, nativeAttrType, streamAttrName, streamAttrMetaType.getLanguageType())); //$NON-NLS-1$
15,291
+ nativeAttrType + " in the native schema cannot be mapped with attribute: " + streamAttrName + " with type : " + streamAttrMetaType.getLanguageType());</BUG> } else if (msgClass == MessageClass.bytes && !mapSPLToNativeSchemaDataTypesForBytes.get(streamAttrMetaType.getLanguageType()).equals( <BUG>nativeAttrType)) { throw new ParseConnectionDocumentException("Attribute Name: " + nativeAttrName + " with type:" + nativeAttrType + " in the native schema cannot be mapped with attribute: " + streamAttrName + " with type : " + streamAttrMetaType.getLanguageType());</BUG> }
if (streamSchema.getAttribute(nativeAttrName) != null) { streamAttrName = streamSchema.getAttribute(nativeAttrName).getName(); streamAttrMetaType = streamSchema.getAttribute(nativeAttrName).getType().getMetaType(); if ((msgClass == MessageClass.stream || msgClass == MessageClass.map) && !mapSPLToNativeSchemaDataTypesForOtherMsgClass.get(streamAttrMetaType.getLanguageType()) .equals(nativeAttrType)) { throw new ParseConnectionDocumentException(Messages.getString("ATTRIB_WITH_TYPE_IN_NATIVE_SCHEMA_CANNOT_BE_MAPPED_TO_ATTRIB_WITH_TYPE", nativeAttrName, nativeAttrType, streamAttrName, streamAttrMetaType.getLanguageType())); //$NON-NLS-1$ throw new ParseConnectionDocumentException(Messages.getString("ATTRIB_WITH_TYPE_IN_NATIVE_SCHEMA_CANNOT_BE_MAPPED_TO_ATTRIB_WITH_TYPE", nativeAttrName, nativeAttrType, streamAttrName, streamAttrMetaType.getLanguageType())); //$NON-NLS-1$
15,292
package com.ibm.streamsx.messaging.i18n; import java.text.MessageFormat; import java.util.MissingResourceException; import java.util.ResourceBundle; public class Messages { <BUG>private static final String BUNDLE_NAME = "com.ibm.streamsx.messaging.mqtt.MQTTMessages"; //$NON-NLS-1$ </BUG> private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle .getBundle(BUNDLE_NAME); private Messages() {
private static final String BUNDLE_NAME = "com.ibm.streamsx.messaging.i18n.CommonMessages"; //$NON-NLS-1$
15,293
private static class NoOpFileWatcherFactory implements FileWatcherFactory { @Override public FileWatcher watch(Iterable<? extends File> roots, FileWatcherListener listener) { return new FileWatcher() { @Override <BUG>public void stop() { }</BUG> }; } }
public boolean isRunning() { return false;
15,294
Bundle savedInstanceState) { final View rootView = inflater.inflate(R.layout.tab_qibla, container, false); final QiblaCompassView qiblaCompassView = (QiblaCompassView)rootView.findViewById(R.id.qibla_compass); qiblaCompassView.setConstants(((TextView)rootView.findViewById(R.id.bearing_north)), getText(R.string.bearing_north), ((TextView)rootView.findViewById(R.id.bearing_qibla)), getText(R.string.bearing_qibla)); <BUG>sOrientationListener = new SensorListener() { </BUG> public void onSensorChanged(int s, float v[]) { float northDirection = v[SensorManager.DATA_X]; qiblaCompassView.setDirections(northDirection, sQiblaDirection);
sOrientationListener = new android.hardware.SensorListener() {
15,295
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;
15,296
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;
15,297
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"),
15,298
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]
15,299
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) {
15,300
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;