id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
10,801
RedisConnection<K, V> conn = super.connect(codec); conn.auth(password); return conn;</BUG> } @Override <BUG>public <K, V> RedisAsyncConnection<K, V> connectAsync(RedisCodec<K, V> codec) { RedisAsyncConnection<K, V> conn = super.connectAsync(codec); conn.auth(password); return conn;</BUG> }
public AuthenticatingRedisClient(String host, int port, String password) { super(null, RedisURI.builder().withHost(host).withPort(port).withPassword(password).build()); public AuthenticatingRedisClient(String host, String password) { super(null, RedisURI.builder().withHost(host).withPassword(password).build()); public <K, V> StatefulRedisConnection<K, V> connect(RedisCodec<K, V> codec) { return super.connect(codec);
10,802
RedisAsyncConnection<K, V> conn = super.connectAsync(codec); conn.auth(password); return conn;</BUG> } @Override <BUG>public <K, V> RedisPubSubConnection<K, V> connectPubSub(RedisCodec<K, V> codec) { RedisPubSubConnection<K, V> conn = super.connectPubSub(codec); conn.auth(password); return conn;</BUG> }
public AuthenticatingRedisClient(String host, int port, String password) { super(null, RedisURI.builder().withHost(host).withPort(port).withPassword(password).build()); public AuthenticatingRedisClient(String host, String password) { super(null, RedisURI.builder().withHost(host).withPassword(password).build()); public <K, V> StatefulRedisConnection<K, V> connect(RedisCodec<K, V> codec) { return super.connect(codec);
10,803
this.client = RedisClient.create(clientResources, getRedisURI()); } else { this.client = RedisClient.create(getRedisURI()); } client.setDefaultTimeout(timeout, TimeUnit.MILLISECONDS); <BUG>this.internalPool = new GenericObjectPool<RedisAsyncConnection>(new LettuceFactory(client, dbIndex), poolConfig); }</BUG> private RedisURI getRedisURI() { RedisURI redisUri = isRedisSentinelAware()
this.internalPool = new GenericObjectPool<StatefulConnection<byte[], byte[]>>(new LettuceFactory(client, dbIndex),
10,804
return internalPool.borrowObject(); } catch (Exception e) { throw new PoolException("Could not get a resource from the pool", e); } } <BUG>public void returnBrokenResource(final RedisAsyncConnection<byte[], byte[]> resource) { </BUG> try { internalPool.invalidateObject(resource); } catch (Exception e) {
public void returnBrokenResource(final StatefulConnection<byte[], byte[]> resource) {
10,805
internalPool.invalidateObject(resource); } catch (Exception e) { throw new PoolException("Could not invalidate the broken resource", e); } } <BUG>public void returnResource(final RedisAsyncConnection<byte[], byte[]> resource) { </BUG> try { internalPool.returnObject(resource); } catch (Exception e) {
public void returnResource(final StatefulConnection<byte[], byte[]> resource) {
10,806
super(); this.client = client; this.dbIndex = dbIndex; } @Override <BUG>public void activateObject(PooledObject<RedisAsyncConnection> pooledObject) throws Exception { pooledObject.getObject().select(dbIndex); } public void destroyObject(final PooledObject<RedisAsyncConnection> obj) throws Exception { </BUG> try {
public void activateObject(PooledObject<StatefulConnection<byte[], byte[]>> pooledObject) throws Exception { if (pooledObject.getObject() instanceof StatefulRedisConnection) { ((StatefulRedisConnection) pooledObject.getObject()).sync().select(dbIndex); public void destroyObject(final PooledObject<StatefulConnection<byte[], byte[]>> obj) throws Exception {
10,807
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;
10,808
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;
10,809
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"),
10,810
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]
10,811
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) {
10,812
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;
10,813
import java.io.InputStream; import java.net.URL; import static org.assertj.core.api.Assertions.assertThat; public class TomcatWebServerTest { @Test <BUG>public void shouldBootWebServer() throws Exception { try(WeldContainer weldContainer = new Weld().disableDiscovery()</BUG> .extensions(new ConfigurationExtension()) .beanClasses(TomcatWebServer.class, DefaultServlet.class, MessageProvider.class, WebServerConfiguration.class, DefaultConfigPropertyProducer.class)
SSLBypass.disableSSLChecks(); try(WeldContainer weldContainer = new Weld().disableDiscovery()
10,814
tomcat.start(); try(InputStream stream = new URL("http://localhost:8080/").openStream()) { String data = IOUtils.toString(stream).trim(); assertThat(data).isEqualTo(MessageProvider.DATA); } <BUG>try(InputStream stream = new URL("http://localhost:8080/rest").openStream()) { </BUG> String data = IOUtils.toString(stream).trim(); assertThat(data).isEqualTo("Hello, world!"); }
try(InputStream stream = new URL("https://localhost:8443/rest").openStream()) {
10,815
import java.io.InputStream; import java.net.URL; import static org.assertj.core.api.Assertions.assertThat; public class JettyBootTest { @Test <BUG>public void shouldBootWebServer() throws Exception { try(WeldContainer weldContainer = new Weld().disableDiscovery()</BUG> .extensions(new ConfigurationExtension()) .beanClasses(JettyWebServer.class, DefaultServlet.class, MessageProvider.class, WebServerConfiguration.class, DefaultConfigPropertyProducer.class)
SSLBypass.disableSSLChecks(); try(WeldContainer weldContainer = new Weld().disableDiscovery()
10,816
webServer.start(); try(InputStream stream = new URL("http://localhost:8080/").openStream()) { String data = IOUtils.toString(stream).trim(); assertThat(data).isEqualTo(MessageProvider.DATA); } <BUG>try(InputStream stream = new URL("http://localhost:8080/").openStream()) { </BUG> String data = IOUtils.toString(stream).trim(); assertThat(data).isEqualTo(MessageProvider.DATA); }
try(InputStream stream = new URL("https://localhost:8443/").openStream()) {
10,817
} public String getAddress() { return address; } public boolean isSecuredConfigured(){ <BUG>return securedPort != 0 && keystorePath != null && truststorePassword != null; }</BUG> public int getSecuredPort(){ return securedPort; }
public int getPort() { return port; return securedPort != 0;
10,818
import org.eclipse.ui.forms.editor.FormPage; import org.eclipse.ui.forms.widgets.FormToolkit; import org.eclipse.ui.forms.widgets.Section; import rocks.inspectit.shared.cs.ci.Environment; import rocks.inspectit.shared.cs.ci.sensor.ISensorConfig; <BUG>import rocks.inspectit.shared.cs.ci.sensor.platform.AbstractPlatformSensorConfig; import rocks.inspectit.ui.rcp.ci.form.input.EnvironmentEditorInput;</BUG> import rocks.inspectit.ui.rcp.formatter.ImageFormatter; import rocks.inspectit.ui.rcp.formatter.TextFormatter; public class PlatformSensorSelectionPart extends SectionPart implements IPropertyListener {
import rocks.inspectit.ui.rcp.InspectIT; import rocks.inspectit.ui.rcp.InspectITImages; import rocks.inspectit.ui.rcp.ci.form.input.EnvironmentEditorInput;
10,819
label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE)); getSection().setDescriptionControl(label); } private void createClient(Section section, FormToolkit toolkit) { Composite mainComposite = toolkit.createComposite(section); <BUG>mainComposite.setLayout(new GridLayout(1, true)); </BUG> section.setClient(mainComposite); Table table = toolkit.createTable(mainComposite, SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.CHECK); table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
mainComposite.setLayout(new GridLayout(2, false));
10,820
package rocks.inspectit.ui.rcp.statushandlers; <BUG>import org.apache.commons.lang.StringUtils; import org.eclipse.core.runtime.IStatus;</BUG> import org.eclipse.jface.dialogs.Dialog; import org.eclipse.swt.widgets.Display; import org.eclipse.ui.PlatformUI;
import org.apache.commons.lang.ArrayUtils; import org.apache.commons.lang.SystemUtils; import org.eclipse.core.runtime.IStatus;
10,821
public static Image getMethodVisibilityImage(ResourceManager resourceManager, MethodSensorAssignment methodSensorAssignment) { ImageDescriptor[] descriptors = new ImageDescriptor[4]; if (methodSensorAssignment.isPublicModifier()) { descriptors[0] = InspectIT.getDefault().getImageDescriptor(InspectITImages.IMG_METHOD_PUBLIC); } else { <BUG>descriptors[0] = ImageDescriptor.createWithFlags(InspectIT.getDefault().getImageDescriptor(InspectITImages.IMG_METHOD_PUBLIC), SWT.IMAGE_DISABLE); </BUG> } if (methodSensorAssignment.isProtectedModifier()) { descriptors[1] = InspectIT.getDefault().getImageDescriptor(InspectITImages.IMG_METHOD_PROTECTED);
descriptors[0] = InspectIT.getDefault().getImageDescriptor(InspectITImages.IMG_METHOD_PUBLIC_DISABLED);
10,822
</BUG> } if (methodSensorAssignment.isProtectedModifier()) { descriptors[1] = InspectIT.getDefault().getImageDescriptor(InspectITImages.IMG_METHOD_PROTECTED); } else { <BUG>descriptors[1] = ImageDescriptor.createWithFlags(InspectIT.getDefault().getImageDescriptor(InspectITImages.IMG_METHOD_PROTECTED), SWT.IMAGE_DISABLE); </BUG> } if (methodSensorAssignment.isDefaultModifier()) { descriptors[2] = InspectIT.getDefault().getImageDescriptor(InspectITImages.IMG_METHOD_DEFAULT);
public static Image getMethodVisibilityImage(ResourceManager resourceManager, MethodSensorAssignment methodSensorAssignment) { ImageDescriptor[] descriptors = new ImageDescriptor[4]; if (methodSensorAssignment.isPublicModifier()) { descriptors[0] = InspectIT.getDefault().getImageDescriptor(InspectITImages.IMG_METHOD_PUBLIC); descriptors[0] = InspectIT.getDefault().getImageDescriptor(InspectITImages.IMG_METHOD_PUBLIC_DISABLED); descriptors[1] = InspectIT.getDefault().getImageDescriptor(InspectITImages.IMG_METHOD_PROTECTED_DISABLED);
10,823
menuManager.add(new EditProfileAction()); Menu menu = menuManager.createContextMenu(table); table.setMenu(menu); } private void createColumns() { <BUG>TableViewerColumn selectedColumn = new TableViewerColumn(tableViewer, SWT.NONE); selectedColumn.getColumn().setResizable(false); selectedColumn.getColumn().setWidth(40); selectedColumn.getColumn().setText("Selected"); selectedColumn.getColumn().setToolTipText("If profile is included in the environment.");</BUG> TableViewerColumn profileNameColumn = new TableViewerColumn(tableViewer, SWT.NONE);
[DELETED]
10,824
} @Override protected Image getColumnImage(Object element, int index) { if (element instanceof Profile) { Profile profile = ((Profile) element); <BUG>switch (index) { case 1: return ImageFormatter.getProfileImage(profile); case 2: return profile.isActive() ? InspectIT.getDefault().getImage(InspectITImages.IMG_CHECKMARK) : null; // NOPMD </BUG> case 3:
private void updateCheckedItems() { for (TableItem item : tableViewer.getTable().getItems()) { Profile data = (Profile) item.getData(); item.setChecked(environment.getProfileIds().contains(data.getId()));
10,825
case 2: return profile.isActive() ? InspectIT.getDefault().getImage(InspectITImages.IMG_CHECKMARK) : null; // NOPMD </BUG> case 3: <BUG>return profile.isDefaultProfile() ? InspectIT.getDefault().getImage(InspectITImages.IMG_CHECKMARK) : null; // NOPMD case 4:</BUG> return ImageFormatter.getProfileDataImage(profile.getProfileData()); default: return super.getColumnImage(element, index); }
[DELETED]
10,826
import android.text.format.DateFormat; import android.widget.ImageView; import android.zetterstrom.com.forecast.ForecastClient; import android.zetterstrom.com.forecast.ForecastConfiguration; import com.bumptech.glide.Glide; <BUG>import com.crashlytics.android.Crashlytics; import com.evernote.android.job.JobManager; import com.karumi.dexter.Dexter;</BUG> import com.mikepenz.materialdrawer.util.AbstractDrawerImageLoader; import com.mikepenz.materialdrawer.util.DrawerImageLoader;
import com.crashlytics.android.core.CrashlyticsCore;
10,827
super.attachBaseContext(base); MultiDex.install(this); } @Override public void onCreate() { <BUG>super.onCreate(); Fabric.with(this, new Crashlytics()); </BUG> Crashlytics.setString("Timezone", String.valueOf(TimeZone.getDefault().getDisplayName())); Crashlytics.setString("Language", Locale.getDefault().getDisplayLanguage());
Crashlytics crashlyticsKit = new Crashlytics.Builder() .core(new CrashlyticsCore.Builder() .disabled(BuildConfig.DEBUG).build()) .build(); Fabric.with(this, crashlyticsKit);
10,828
import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager; import com.intellij.openapi.vfs.LocalFileSystem; import com.intellij.openapi.vfs.VirtualFile; import org.jetbrains.idea.svn.integrate.AlienDirtyScope; import org.junit.Assert; <BUG>import org.junit.Test; import java.util.Collection;</BUG> import java.util.List; public class SvnDeleteTest extends SvnTestCase { @Test
import java.io.File; import java.util.Collection;
10,829
throw new RuntimeException(e); } } }.execute(); final ProcessOutput result = runSvn("status"); <BUG>verify(result, "A child", "A child\\a.txt"); </BUG> } @Test public void testDirAfterFile() throws Exception {
verify(result, "A child", "A child" + File.separatorChar + "a.txt");
10,830
import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.List; public class SvnRenameTest extends SvnTestCase { <BUG>@NonNls private static final String LOG_SEPARATOR = "------------------------------------------------------------------------\r\n"; @Test</BUG> public void testSimpleRename() throws Exception { enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD); final VirtualFile a = createFileInCommand("a.txt", "test");
@NonNls private static final String LOG_SEPARATOR = "------------------------------------------------------------------------\n"; @Test
10,831
public void testRenameAddedPackage() throws Exception { enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD); final VirtualFile dir = createDirInCommand(myWorkingCopyDir, "child"); createFileInCommand(dir, "a.txt", "content"); renameFileInCommand(dir, "newchild"); <BUG>verify(runSvn("status"), "A newchild", "A newchild\\a.txt"); </BUG> } @Test public void testDoubleRename() throws Exception {
verify(runSvn("status"), "A newchild", "A newchild" + File.separatorChar + "a.txt");
10,832
changeListManager.ensureUpToDate(false); List<Change> changes = new ArrayList<Change>(changeListManager.getDefaultChangeList().getChanges()); Assert.assertEquals(4, changes.size()); sortChanges(changes); verifyChange(changes.get(0), "child", "childnew"); <BUG>verifyChange(changes.get(1), "child\\a.txt", "childnew\\a.txt"); verifyChange(changes.get(2), "child\\grandChild", "childnew\\grandChild"); verifyChange(changes.get(3), "child\\grandChild\\b.txt", "childnew\\grandChild\\b.txt"); VirtualFile oldChild = myWorkingCopyDir.findChild("child");</BUG> Assert.assertEquals(FileStatus.DELETED, changeListManager.getStatus(oldChild));
verifyChange(changes.get(1), "child" + File.separatorChar + "a.txt", "childnew" + File.separatorChar + "a.txt"); verifyChange(changes.get(2), "child" + File.separatorChar + "grandChild", "childnew" + File.separatorChar + "grandChild"); verifyChange(changes.get(3), "child" + File.separatorChar + "grandChild" + File.separatorChar + "b.txt", "childnew" + File.separatorChar + "grandChild" + File.separatorChar + "b.txt"); VirtualFile oldChild = myWorkingCopyDir.findChild("child");
10,833
public void testRenameFileRenameDir() throws Exception { final VirtualFile child = prepareDirectoriesForRename(); final VirtualFile f = child.findChild("a.txt"); renameFileInCommand(f, "anew.txt"); renameFileInCommand(child, "newchild"); <BUG>verifySorted(runSvn("status"), "A + newchild", "A + newchild\\anew.txt", "D child", "D child\\a.txt", "D child\\grandChild", "D child\\grandChild\\b.txt", "D + newchild\\a.txt"); final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);</BUG> LocalFileSystem.getInstance().refresh(false); // wait for end of refresh operations initiated from SvnFileSystemListener
verifySorted(runSvn("status"), "A + newchild", "A + newchild" + File.separatorChar + "anew.txt", "D child", "D child" + File.separatorChar + "a.txt", "D child" + File.separatorChar + "grandChild", "D child" + File.separatorChar + "grandChild" + File.separatorChar + "b.txt", "D + newchild" + File.separatorChar + "a.txt"); final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
10,834
public void testMoveToNewPackageCommitted() throws Throwable { enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD); final VirtualFile file = createFileInCommand(myWorkingCopyDir, "a.txt", "A"); checkin(); moveToNewPackage(file, "child"); <BUG>verifySorted(runSvn("status"), "A child", "A + child\\a.txt", "D a.txt"); </BUG> } private void moveToNewPackage(final VirtualFile file, final String packageName) throws Throwable { new WriteCommandAction.Simple(myProject) {
verifySorted(runSvn("status"), "A child", "A + child" + File.separatorChar + "a.txt", "D a.txt");
10,835
import javax.servlet.http.HttpServletRequest;</BUG> import org.apache.sling.api.resource.Resource; import org.apache.sling.api.resource.ResourceResolver; public class WorkspaceResourceResolver implements ResourceResolver { <BUG>private ResourceResolver delegate; private String workspaceName; public WorkspaceResourceResolver(ResourceResolver delegate, String workspaceName) { this.delegate = delegate; this.workspaceName = workspaceName; </BUG> }
package org.apache.sling.servlets.resolver.internal; import java.util.Iterator; import java.util.Map; import javax.jcr.Session; import javax.servlet.http.HttpServletRequest; private final ResourceResolver delegate; private final String workspaceName; public WorkspaceResourceResolver(ResourceResolver delegate) { this.workspaceName = getWorkspaceName(delegate);
10,836
import java.util.HashMap; import java.util.Hashtable; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; <BUG>import javax.jcr.Credentials; import javax.jcr.RepositoryException; import javax.jcr.Session; import javax.jcr.SimpleCredentials;</BUG> import javax.servlet.Servlet;
[DELETED]
10,837
import org.apache.sling.api.scripting.SlingScriptResolver; import org.apache.sling.api.servlets.OptingServlet; import org.apache.sling.api.servlets.ServletResolver; import org.apache.sling.commons.osgi.OsgiUtil; import org.apache.sling.engine.servlets.ErrorHandler; <BUG>import org.apache.sling.jcr.api.SlingRepository; import org.apache.sling.jcr.resource.JcrResourceResolverFactory;</BUG> import org.apache.sling.servlets.resolver.internal.defaults.DefaultErrorHandlerServlet; import org.apache.sling.servlets.resolver.internal.defaults.DefaultServlet; import org.apache.sling.servlets.resolver.internal.helper.AbstractResourceCollector;
[DELETED]
10,838
public static final Integer DEFAULT_CACHE_SIZE = 200; private static final String REF_SERVLET = "Servlet"; public static final String PROP_PATHS = "servletresolver.paths"; private static final String[] DEFAULT_PATHS = new String[] {"/"}; private ServletContext servletContext; <BUG>private JcrResourceResolverFactory jcrResourceResolverFactory; private SlingRepository repository; private ConcurrentHashMap<String, Session> scriptSessions; private Session defaultScriptSession;</BUG> private ConcurrentHashMap<String, WorkspaceResourceResolver> scriptResolvers;
private ResourceResolverFactory resourceResolverFactory;
10,839
return; } RequestProgressTracker tracker = request.getRequestProgressTracker(); String timerName = "handleError:status=" + status; tracker.startTimer(timerName); <BUG>try { Resource resource = getErrorResource(request);</BUG> ResourceCollector locationUtil = new ResourceCollector(String.valueOf(status), ServletResolverConstants.ERROR_HANDLER_PATH, resource, scriptResolver.getWorkspaceName(), this.executionPaths);
final WorkspaceResourceResolver scriptResolver = getScriptResolver(getWorkspaceName(request)); Resource resource = getErrorResource(request);
10,840
tracker.logTimer(timerName, "Error handler finished"); } } public void handleError(Throwable throwable, SlingHttpServletRequest request, SlingHttpServletResponse response) throws IOException { <BUG>String wspName = getWorkspaceName(request); WorkspaceResourceResolver scriptResolver = getScriptResolver(wspName);</BUG> if (request.getAttribute(SlingConstants.ERROR_REQUEST_URI) != null) { log.error("handleError: Recursive invocation. Not further handling Throwable:", throwable); return;
[DELETED]
10,841
return; } RequestProgressTracker tracker = request.getRequestProgressTracker(); String timerName = "handleError:throwable=" + throwable.getClass().getName(); tracker.startTimer(timerName); <BUG>try { Servlet servlet = null;</BUG> Resource resource = getErrorResource(request); Class<?> tClass = throwable.getClass(); while (servlet == null && tClass != Object.class) {
final WorkspaceResourceResolver scriptResolver = getScriptResolver(getWorkspaceName(request)); Servlet servlet = null;
10,842
else if (t == ANY_CYPHER_OPTION) { r = AnyCypherOption(b, 0); } else if (t == ANY_FUNCTION_INVOCATION) { r = AnyFunctionInvocation(b, 0); <BUG>} else if (t == BULK_IMPORT_QUERY) {</BUG> r = BulkImportQuery(b, 0); } else if (t == CALL) {
else if (t == ARRAY) { r = Array(b, 0); else if (t == BULK_IMPORT_QUERY) {
10,843
if (!r) r = MapLiteral(b, l + 1); if (!r) r = MapProjection(b, l + 1); if (!r) r = CountStar(b, l + 1); if (!r) r = ListComprehension(b, l + 1); if (!r) r = PatternComprehension(b, l + 1); <BUG>if (!r) r = Expression1_12(b, l + 1); if (!r) r = FilterFunctionInvocation(b, l + 1);</BUG> if (!r) r = ExtractFunctionInvocation(b, l + 1); if (!r) r = ReduceFunctionInvocation(b, l + 1); if (!r) r = AllFunctionInvocation(b, l + 1);
if (!r) r = Array(b, l + 1); if (!r) r = FilterFunctionInvocation(b, l + 1);
10,844
import javax.portlet.ActionRequest; import javax.portlet.ActionResponse; import javax.portlet.PortletException; import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; <BUG>import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession;</BUG> public class NotificationsPortlet extends MVCPortlet { public void deleteUserNotificationEvent( ActionRequest actionRequest, ActionResponse actionResponse)
[DELETED]
10,845
package wew.water.gpf; <BUG>import org.esa.beam.framework.gpf.OperatorException; public class ChlorophyllNetworkOperation implements NeuralNetworkOperation { @Override public void compute(float[] in, float[] out, int mask, int errMask, float a) {</BUG> if(in.length != getNumberOfInputNodes()) {
public class ChlorophyllNetworkOperation { public static int compute(float[] in, float[] out) {
10,846
if(in.length != getNumberOfInputNodes()) { throw new IllegalArgumentException("Wrong input array size"); } if(out.length != getNumberOfOutputNodes()) { throw new IllegalArgumentException("Wrong output array size"); <BUG>} NeuralNetworkComputer.compute(in, out, mask, errMask, a, </BUG> NeuralNetworkConstants.INPUT_SCALE_LIMITS, NeuralNetworkConstants.INPUT_SCALE_OFFSET_FACTORS,
final int[] rangeCheckErrorMasks = { WaterProcessorOp.RESULT_ERROR_VALUES[1], WaterProcessorOp.RESULT_ERROR_VALUES[2] }; return NeuralNetworkComputer.compute(in, out, rangeCheckErrorMasks,
10,847
+4.332827e-01, +4.453712e-01, -2.355489e-01, +4.329192e-02, -3.259577e-02, +4.245090e-01, -1.132328e-01, +2.511418e-01, -1.995074e-01, +1.797701e-01, -3.817864e-01, +2.854951e-01, }, }; <BUG>private final double[][] input_hidden_weights = new double[][]{ </BUG> { -5.127986e-01, +5.872741e-01, +4.411426e-01, +1.344507e+00, -7.758738e-01, -7.235078e-01, +2.421909e+00, +1.923607e-02,
private static final double[][] input_hidden_weights = new double[][]{
10,848
-1.875955e-01, +7.851294e-01, -1.226189e+00, -1.852845e-01, +9.392875e-01, +9.886471e-01, +8.400441e-01, -1.657109e+00, +8.292500e-01, +6.291445e-01, +1.855838e+00, +7.817575e-01, }, }; <BUG>private final double[][] input_intercept_and_slope = new double[][]{ </BUG> {+4.165578e-02, +1.161174e-02}, {+3.520901e-02, +1.063665e-02}, {+2.920864e-02, +1.050035e-02},
private static final double[][] input_intercept_and_slope = new double[][]{
10,849
{+2.468300e-01, +8.368545e-01}, {-6.613120e-01, +1.469582e+00}, {-6.613120e-01, +1.469582e+00}, {+7.501110e-01, +2.776545e-01}, }; <BUG>private final double[][] output_weights = new double[][]{ </BUG> {-6.498447e+00,}, {-1.118659e+01,}, {+7.141798e+00,},
private static final double[][] output_weights = new double[][]{
10,850
package wew.water.gpf; public class NeuralNetworkComputer { <BUG>public static void compute(float[] in, float[] out, int mask, int errMask, float a, </BUG> double[][] input_scale_limits, double[] input_scale_offset_factors, int[] input_scale_flag,
public static int compute(float[] in, float[] out, int[] rangeCheckErrorMasks,
10,851
package wew.water.gpf; <BUG>public class AtmosphericCorrectionNetworkOperation implements NeuralNetworkOperation { @Override public void compute(float[] in, float[] out, int mask, int errMask, float a) { if(in.length != getNumberOfInputNodes()) { </BUG> throw new IllegalArgumentException("Wrong input array size");
import java.util.Arrays; public class AtmosphericCorrectionNetworkOperation { public static int compute(float[] in, float[] out) { if (in.length != getNumberOfInputNodes()) {
10,852
String currentFieldName = null; XContentParser.Token token; while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) { if (token == XContentParser.Token.FIELD_NAME) { currentFieldName = parser.currentName(); <BUG>} else if (token == XContentParser.Token.START_OBJECT) { if (fieldName != null) { throw new ParsingException(parser.getTokenLocation(), "[span_term] query doesn't support multiple fields, found [" + fieldName + "] and [" + currentFieldName + "]"); }</BUG> fieldName = currentFieldName;
throwParsingExceptionOnMultipleFields(NAME, parser.getTokenLocation(), fieldName, currentFieldName);
10,853
throw new ParsingException(parser.getTokenLocation(), "[span_term] query does not support [" + currentFieldName + "]"); } } } <BUG>} else { fieldName = parser.currentName();</BUG> value = parser.objectBytes(); } }
throwParsingExceptionOnMultipleFields(NAME, parser.getTokenLocation(), fieldName, parser.currentName()); fieldName = parser.currentName();
10,854
extends Mapper<LongWritable, Text, ImmutableBytesWritable, Put> { protected long ts; private String separator; private boolean skipBadLines; <BUG>private Counter badLineCount; protected ImportTsv.TsvParser parser;</BUG> protected Configuration conf; protected String cellVisibilityExpr; protected long ttl;
private boolean logBadLines; protected ImportTsv.TsvParser parser;
10,855
separator = new String(Base64.decode(separator)); } ts = conf.getLong(ImportTsv.TIMESTAMP_CONF_KEY, 0); skipBadLines = context.getConfiguration().getBoolean( ImportTsv.SKIP_LINES_CONF_KEY, true); <BUG>badLineCount = context.getCounter("ImportTsv", "Bad Lines"); hfileOutPath = conf.get(ImportTsv.BULK_OUTPUT_CONF_KEY);</BUG> } @Override public void map(LongWritable offset, Text value,
logBadLines = context.getConfiguration().getBoolean(ImportTsv.LOG_BAD_LINES_CONF_KEY, false); hfileOutPath = conf.get(ImportTsv.BULK_OUTPUT_CONF_KEY);
10,856
continue; } populatePut(lineBytes, parsed, put, i); } context.write(rowKey, put); <BUG>} catch (ImportTsv.TsvParser.BadTsvLineException badLine) { if (skipBadLines) { System.err.println( "Bad line at offset: " + offset.get() + ":\n" + badLine.getMessage());</BUG> incrementBadLineCount(1);
} catch (ImportTsv.TsvParser.BadTsvLineException|IllegalArgumentException badLine) { if (logBadLines) { System.err.println(value); System.err.println("Bad line at offset: " + offset.get() + ":\n" + badLine.getMessage());
10,857
import org.apache.hadoop.conf.Configured; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HTableDescriptor; <BUG>import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.TableNotFoundException;</BUG> import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.classification.InterfaceStability; import org.apache.hadoop.hbase.client.Admin;
import org.apache.hadoop.hbase.TableNotEnabledException; import org.apache.hadoop.hbase.TableNotFoundException;
10,858
import org.apache.hadoop.hbase.util.Pair; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; import org.apache.hadoop.mapreduce.lib.input.TextInputFormat; <BUG>import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; import org.apache.hadoop.security.Credentials;</BUG> import org.apache.hadoop.util.Tool; import org.apache.hadoop.util.ToolRunner; import java.io.File;
import org.apache.hadoop.mapreduce.lib.output.NullOutputFormat; import org.apache.hadoop.security.Credentials;
10,859
protected static final Log LOG = LogFactory.getLog(ImportTsv.class); final static String NAME = "importtsv"; public final static String MAPPER_CONF_KEY = "importtsv.mapper.class"; public final static String BULK_OUTPUT_CONF_KEY = "importtsv.bulk.output"; public final static String TIMESTAMP_CONF_KEY = "importtsv.timestamp"; <BUG>public final static String JOB_NAME_CONF_KEY = "mapreduce.job.name"; public final static String SKIP_LINES_CONF_KEY = "importtsv.skip.bad.lines";</BUG> public final static String COLUMNS_CONF_KEY = "importtsv.columns"; public final static String SEPARATOR_CONF_KEY = "importtsv.separator"; public final static String ATTRIBUTE_SEPERATOR_CONF_KEY = "attributes.seperator";
public final static String DRY_RUN_CONF_KEY = "importtsv.dry.run"; public final static String LOG_BAD_LINES_CONF_KEY = "importtsv.log.bad.lines"; public final static String SKIP_LINES_CONF_KEY = "importtsv.skip.bad.lines";
10,860
final static String DEFAULT_SEPARATOR = "\t"; final static String DEFAULT_ATTRIBUTES_SEPERATOR = "=>"; final static String DEFAULT_MULTIPLE_ATTRIBUTES_SEPERATOR = ","; final static Class DEFAULT_MAPPER = TsvImporterMapper.class; public final static String CREATE_TABLE_CONF_KEY = "create.table"; <BUG>public final static String NO_STRICT_COL_FAMILY = "no.strict"; public static class TsvParser {</BUG> private final byte[][] families; private final byte[][] qualifiers; private final byte separatorByte;
private static boolean dryRunTableCreated; public static class TsvParser {
10,861
String jobName = conf.get(JOB_NAME_CONF_KEY,NAME + "_" + tableName.getNameAsString()); job = Job.getInstance(conf, jobName); job.setJarByClass(mapperClass); FileInputFormat.setInputPaths(job, inputDir); job.setInputFormatClass(TextInputFormat.class); <BUG>job.setMapperClass(mapperClass); String hfileOutPath = conf.get(BULK_OUTPUT_CONF_KEY);</BUG> String[] columns = conf.getStrings(COLUMNS_CONF_KEY); if(StringUtils.isNotEmpty(conf.get(CREDENTIALS_LOCATION))) { String fileLoc = conf.get(CREDENTIALS_LOCATION);
job.setMapOutputKeyClass(ImmutableBytesWritable.class); String hfileOutPath = conf.get(BULK_OUTPUT_CONF_KEY);
10,862
+ "=true.\n"; usage(msg); System.exit(-1); } } <BUG>job.setReducerClass(PutSortReducer.class); Path outputDir = new Path(hfileOutPath); FileOutputFormat.setOutputPath(job, outputDir); job.setMapOutputKeyClass(ImmutableBytesWritable.class);</BUG> if (mapperClass.equals(TsvImporterTextMapper.class)) {
[DELETED]
10,863
"By default importtsv will load data directly into HBase. To instead generate\n" + "HFiles of data to prepare for a bulk data load, pass the option:\n" + " -D" + BULK_OUTPUT_CONF_KEY + "=/path/for/output\n" + " Note: if you do not use this option, then the target table must already exist in HBase\n" + "\n" + <BUG>"Other options that may be specified with -D include:\n" + " -D" + SKIP_LINES_CONF_KEY + "=false - fail if encountering an invalid line\n" + " '-D" + SEPARATOR_CONF_KEY + "=|' - eg separate on pipes instead of tabs\n" +</BUG> " -D" + TIMESTAMP_CONF_KEY + "=currentTimeAsLong - use the specified timestamp for the import\n" + " -D" + MAPPER_CONF_KEY + "=my.Mapper - A user-defined Mapper to use instead of " +
" -D" + DRY_RUN_CONF_KEY + "=true - Dry run mode. Data is not actually populated into" + " table. If table does not exist, it is created but deleted in the end.\n" + " -D" + LOG_BAD_LINES_CONF_KEY + "=true - logs invalid lines to stderr\n" + " '-D" + SEPARATOR_CONF_KEY + "=|' - eg separate on pipes instead of tabs\n" +
10,864
public class TsvImporterTextMapper extends Mapper<LongWritable, Text, ImmutableBytesWritable, Text> { private String separator; private boolean skipBadLines; <BUG>private Counter badLineCount; private ImportTsv.TsvParser parser;</BUG> public boolean getSkipBadLines() { return skipBadLines; }
private boolean logBadLines; private ImportTsv.TsvParser parser;
10,865
if (separator == null) { separator = ImportTsv.DEFAULT_SEPARATOR; } else { separator = new String(Base64.decode(separator)); } <BUG>skipBadLines = context.getConfiguration().getBoolean(ImportTsv.SKIP_LINES_CONF_KEY, true); badLineCount = context.getCounter("ImportTsv", "Bad Lines");</BUG> } @Override public void map(LongWritable offset, Text value, Context context) throws IOException {
logBadLines = context.getConfiguration().getBoolean(ImportTsv.LOG_BAD_LINES_CONF_KEY, false); badLineCount = context.getCounter("ImportTsv", "Bad Lines");
10,866
try { Pair<Integer,Integer> rowKeyOffests = parser.parseRowKey(value.getBytes(), value.getLength()); ImmutableBytesWritable rowKey = new ImmutableBytesWritable( value.getBytes(), rowKeyOffests.getFirst(), rowKeyOffests.getSecond()); context.write(rowKey, value); <BUG>} catch (ImportTsv.TsvParser.BadTsvLineException badLine) { if (skipBadLines) { System.err.println("Bad line at offset: " + offset.get() + ":\n" + badLine.getMessage());</BUG> incrementBadLineCount(1);
} catch (ImportTsv.TsvParser.BadTsvLineException|IllegalArgumentException badLine) { if (logBadLines) { System.err.println(value); } System.err.println("Bad line at offset: " + offset.get() + ":\n" + badLine.getMessage());
10,867
import static java.lang.String.format; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.io.IOException; <BUG>import java.util.Arrays; import java.util.Iterator; import java.util.Set;</BUG> import java.util.TreeSet; import java.util.UUID;
import java.util.HashMap; import java.util.Map; import java.util.Set;
10,868
final ParsedContent content = new ParsedContent(); final Statistics holder = new Statistics(); </BUG> StaxParserProcessor.parse(content, paths.getBaseReportPath(), <BUG>paths.getPatchReportPath(), XML_PARSE_PORTION_SIZE, holder); System.out.println("XML files successfully parsed."); generateSite(paths, content, holder); System.out.println("Creation of an html site succeed."); </BUG> }
final Statistics statistics = new Statistics(); paths.getPatchReportPath(), XML_PARSE_PORTION_SIZE, statistics); System.out.println("Creation of diff html site is started."); try { SiteGenerator.generate(content, statistics, paths);
10,869
Intent intent = new Intent(this, MainActivity.class); startActivity(intent); finish(); } private void openLoadingDialog() { <BUG>progressDialog = LightProgressDialog.create(this, R.string.login_activity_authenticating); progressDialog.show(); }</BUG> public void handleLogin() {
progressDialog = new MaterialDialog.Builder(this) .progress(true, 0) .content(R.string.login_activity_authenticating)
10,870
import android.content.Intent; import android.graphics.Bitmap; import android.net.Uri; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; <BUG>import android.webkit.WebViewClient; import com.github.pockethub.R; import com.github.pockethub.ui.LightProgressDialog;</BUG> import com.github.pockethub.ui.WebView; public class LoginWebViewActivity extends AppCompatActivity {
import com.afollestad.materialdialogs.MaterialDialog;
10,871
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); WebView webView = new WebView(this); webView.loadUrl(getIntent().getStringExtra(LoginActivity.INTENT_EXTRA_URL)); webView.setWebViewClient(new WebViewClient() { <BUG>LightProgressDialog dialog = (LightProgressDialog) LightProgressDialog.create( LoginWebViewActivity.this, R.string.loading); @Override</BUG> public void onPageStarted(android.webkit.WebView view, String url, Bitmap favicon) { dialog.show();
MaterialDialog dialog = new MaterialDialog.Builder(LoginWebViewActivity.this) .content(R.string.loading) .progress(true, 0) .build(); @Override
10,872
lastStateTime = TimeUtils.millis(); startOfState = false; } retryingText.draw(); if (TimeUtils.millis() - lastStateTime > TIME_RETRY_CLIENT) { <BUG>try { ftc.connect(adress, port); Header hdr = ftc.getHeader();</BUG> nSamples = hdr.nSamples; fSample = hdr.fSample;
headerText.draw(); Header hdr = ftc.getHeader();
10,873
lastStateTime = TimeUtils.millis(); startOfState = false; } tryConnectText.draw(); if (TimeUtils.millis() - lastStateTime > TIME_RETRY_CLIENT) { <BUG>try { ftc.connect(adress, port); Header hdr = ftc.getHeader();</BUG> nSamples = hdr.nSamples; fSample = hdr.fSample;
headerText.draw(); Header hdr = ftc.getHeader();
10,874
package com.cronutils.model.time.generator; import java.util.Collections; <BUG>import java.util.List; import org.apache.commons.lang3.Validate;</BUG> import com.cronutils.model.field.CronField; import com.cronutils.model.field.expression.FieldExpression; public abstract class FieldValueGenerator {
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;
10,875
import java.util.ResourceBundle; import java.util.function.Function;</BUG> class DescriptionStrategyFactory { private DescriptionStrategyFactory() {} public static DescriptionStrategy daysOfWeekInstance(final ResourceBundle bundle, final FieldExpression expression) { <BUG>final Function<Integer, String> nominal = integer -> new DateTime().withDayOfWeek(integer).dayOfWeek().getAsText(bundle.getLocale()); </BUG> NominalDescriptionStrategy dow = new NominalDescriptionStrategy(bundle, nominal, expression); dow.addDescription(fieldExpression -> { if (fieldExpression instanceof On) {
import java.util.function.Function; import com.cronutils.model.field.expression.FieldExpression; import com.cronutils.model.field.expression.On; final Function<Integer, String> nominal = integer -> DayOfWeek.of(integer).getDisplayName(TextStyle.FULL, bundle.getLocale());
10,876
return dom; } public static DescriptionStrategy monthsInstance(final ResourceBundle bundle, final FieldExpression expression) { return new NominalDescriptionStrategy( bundle, <BUG>integer -> new DateTime().withMonthOfYear(integer).monthOfYear().getAsText(bundle.getLocale()), expression</BUG> ); } public static DescriptionStrategy plainInstance(ResourceBundle bundle, final FieldExpression expression) {
integer -> Month.of(integer).getDisplayName(TextStyle.FULL, bundle.getLocale()), expression
10,877
<BUG>package com.cronutils.model.time.generator; import com.cronutils.mapper.WeekDay;</BUG> import com.cronutils.model.field.CronField; import com.cronutils.model.field.CronFieldName; import com.cronutils.model.field.constraint.FieldConstraintsBuilder;
import java.time.LocalDate; import java.util.Collections; import java.util.List; import java.util.Set; import org.apache.commons.lang3.Validate; import com.cronutils.mapper.WeekDay;
10,878
import com.cronutils.model.field.expression.Between; import com.cronutils.model.field.expression.FieldExpression; import com.cronutils.parser.CronParserField; import com.google.common.collect.Lists; import com.google.common.collect.Sets; <BUG>import org.apache.commons.lang3.Validate; import org.joda.time.DateTime; import java.util.Collections; import java.util.List; import java.util.Set;</BUG> class BetweenDayOfWeekValueGenerator extends FieldValueGenerator {
[DELETED]
10,879
<BUG>package com.cronutils.model.time.generator; import com.cronutils.model.field.CronField;</BUG> import com.cronutils.model.field.CronFieldName; import com.cronutils.model.field.expression.FieldExpression; import com.cronutils.model.field.expression.On;
import java.time.DayOfWeek; import java.time.LocalDate; import java.util.List; import org.apache.commons.lang3.Validate; import com.cronutils.model.field.CronField;
10,880
import com.cronutils.model.field.CronField;</BUG> import com.cronutils.model.field.CronFieldName; import com.cronutils.model.field.expression.FieldExpression; import com.cronutils.model.field.expression.On; import com.google.common.collect.Lists; <BUG>import org.apache.commons.lang3.Validate; import org.joda.time.DateTime; import java.util.List;</BUG> class OnDayOfMonthValueGenerator extends FieldValueGenerator { private int year;
package com.cronutils.model.time.generator; import java.time.DayOfWeek; import java.time.LocalDate; import java.util.List; import com.cronutils.model.field.CronField;
10,881
class OnDayOfMonthValueGenerator extends FieldValueGenerator { private int year; private int month; public OnDayOfMonthValueGenerator(CronField cronField, int year, int month) { super(cronField); <BUG>Validate.isTrue(CronFieldName.DAY_OF_MONTH.equals(cronField.getField()), "CronField does not belong to day of month"); this.year = year;</BUG> this.month = month; }
Validate.isTrue(CronFieldName.DAY_OF_MONTH.equals(cronField.getField()), "CronField does not belong to day of" + " month"); this.year = year;
10,882
package com.cronutils.mapper; public class ConstantsMapper { private ConstantsMapper() {} public static final WeekDay QUARTZ_WEEK_DAY = new WeekDay(2, false); <BUG>public static final WeekDay JODATIME_WEEK_DAY = new WeekDay(1, false); </BUG> public static final WeekDay CRONTAB_WEEK_DAY = new WeekDay(1, true); public static int weekDayMapping(WeekDay source, WeekDay target, int weekday){ return source.mapTo(weekday, target);
public static final WeekDay JAVA8 = new WeekDay(1, false);
10,883
return nextMatch; } catch (NoSuchValueException e) { throw new IllegalArgumentException(e); } } <BUG>DateTime nextClosestMatch(DateTime date) throws NoSuchValueException { </BUG> List<Integer> year = yearsValueGenerator.generateCandidates(date.getYear(), date.getYear()); TimeNode days = null; int lowestMonth = months.getValues().get(0);
ZonedDateTime nextClosestMatch(ZonedDateTime date) throws NoSuchValueException {
10,884
boolean questionMarkSupported = cronDefinition.getFieldDefinition(DAY_OF_WEEK).getConstraints().getSpecialChars().contains(QUESTION_MARK); if(questionMarkSupported){ return new TimeNode( generateDayCandidatesQuestionMarkSupported( <BUG>date.getYear(), date.getMonthOfYear(), </BUG> ((DayOfWeekFieldDefinition) cronDefinition.getFieldDefinition(DAY_OF_WEEK) ).getMondayDoWValue()
date.getYear(), date.getMonthValue(),
10,885
) ); }else{ return new TimeNode( generateDayCandidatesQuestionMarkNotSupported( <BUG>date.getYear(), date.getMonthOfYear(), </BUG> ((DayOfWeekFieldDefinition) cronDefinition.getFieldDefinition(DAY_OF_WEEK) ).getMondayDoWValue()
date.getYear(), date.getMonthValue(),
10,886
} public DateTime lastExecution(DateTime date){ </BUG> Validate.notNull(date); try { <BUG>DateTime previousMatch = previousClosestMatch(date); </BUG> if(previousMatch.equals(date)){ previousMatch = previousClosestMatch(date.minusSeconds(1)); }
public java.time.Duration timeToNextExecution(ZonedDateTime date){ return java.time.Duration.between(date, nextExecution(date)); public ZonedDateTime lastExecution(ZonedDateTime date){ ZonedDateTime previousMatch = previousClosestMatch(date);
10,887
return previousMatch; } catch (NoSuchValueException e) { throw new IllegalArgumentException(e); } } <BUG>public Duration timeFromLastExecution(DateTime date){ return new Interval(lastExecution(date), date).toDuration(); } public boolean isMatch(DateTime date){ </BUG> return nextExecution(lastExecution(date)).equals(date);
[DELETED]
10,888
<BUG>package com.cronutils.model.time.generator; import com.cronutils.model.field.CronField;</BUG> import com.cronutils.model.field.expression.Every; import com.cronutils.model.field.expression.FieldExpression; import com.google.common.annotations.VisibleForTesting;
import java.time.ZonedDateTime; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.cronutils.model.field.CronField;
10,889
import com.cronutils.model.field.CronField;</BUG> import com.cronutils.model.field.expression.Every; import com.cronutils.model.field.expression.FieldExpression; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.Lists; <BUG>import org.joda.time.DateTime; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.List;</BUG> class EveryFieldValueGenerator extends FieldValueGenerator {
package com.cronutils.model.time.generator; import java.time.ZonedDateTime; import java.util.List; import com.cronutils.model.field.CronField;
10,890
private static final Logger log = LoggerFactory.getLogger(EveryFieldValueGenerator.class); public EveryFieldValueGenerator(CronField cronField) { super(cronField); log.trace(String.format( "processing \"%s\" at %s", <BUG>cronField.getExpression().asString(), DateTime.now() </BUG> )); } @Override
cronField.getExpression().asString(), ZonedDateTime.now()
10,891
package org.jetbrains.jet.plugin.project; <BUG>import com.intellij.openapi.diagnostic.Log; </BUG> import com.intellij.openapi.project.Project; import com.intellij.openapi.roots.ProjectRootManager; import com.intellij.openapi.util.Pair;
import com.intellij.openapi.diagnostic.Logger;
10,892
String version = lines.length >= 2 ? lines[1] : null; String pathToIndicationFileLocation = indicationFile.getParent().getPath(); return new Pair<String, String>(pathToIndicationFileLocation + "/" + pathToLibFile, version); } catch (IOException e) { <BUG>Log.print("Could not open file " + indicationFile.getPath()); </BUG> return Pair.empty(); } }
[DELETED]
10,893
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;
10,894
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;
10,895
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"),
10,896
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]
10,897
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) {
10,898
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;
10,899
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.Status; import org.mariotaku.sqliteqb.library.AllColumns;</BUG> import org.mariotaku.sqliteqb.library.Columns; import org.mariotaku.sqliteqb.library.Columns.Column; import org.mariotaku.sqliteqb.library.Expression;
import org.mariotaku.pickncrop.library.PNCUtils; import org.mariotaku.sqliteqb.library.AllColumns;
10,900
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());