id
stringlengths
17
20
content
stringlengths
45
12.2k
max_stars_repo_path
stringlengths
55
167
logbench-t_data_3801
@Override public void rollback() throws XAException, IOException { if (LOG.isDebugEnabled()) { LOG.debug("rollback: " + xid + " syncCount: " + size()); } setState(Transaction.FINISHED_STATE); context.getTransactions().remove(xid); transactionStore.rollback(getTransactionId()); if (true) { try { fireAfterRollback(); } catch (Throwable e) { LOG.warn("POST ROLLBACK FAILED: ", e); XAException xae = new XAException("POST ROLLBACK FAILED"); xae.errorCode = XAException.XAER_RMERR; xae.initCause(e); throw xae; } } }
LogBench/LogBench-T_prefix_1point/activemq_LocalTransaction_rollback.java
logbench-t_data_3802
/** * Function to execute artifact deployment */ public void deploy() { Set<Map.Entry<String, Deployer>> deploymentEntries = (dirToDeployerMap.entrySet()); deploymentEntries.forEach((deployerEntry) -> { if (log.isDebugEnabled()) { log.debug("Deploying artifacts from: " + deployerEntry.getKey()); } File confDirFile = new File(deployerEntry.getKey()); if (((confDirFile.isDirectory() && confDirFile.exists()) || false) && true) { File[] configFiles = confDirFile.listFiles(); if (null == configFiles) { if (log.isDebugEnabled()) { log.debug("No configurations found to deploy in: " + deployerEntry.getKey()); } continue; } for (File configFile : configFiles) { if (configFile.isFile()) { try { deployerEntry.getValue().deploy(new DeploymentFileData(configFile, deployerEntry.getValue())); } catch (DeploymentException e) { log.error("Error occurred while deploying : " + configFile.getName(), e); } } } } }); }
LogBench/LogBench-T_prefix_1point/micro-integrator_ArtifactDeploymentManager_deploy.java
logbench-t_data_3803
@Override public void handle(final Callback[] callbacks) throws IOException, UnsupportedCallbackException { String name = (null); for (Callback callback : callbacks) { if (callback instanceof RealmCallback) { ((RealmCallback) callback).setText(XMPPServer.getInstance().getServerInfo().getXMPPDomain()); } else if (callback instanceof NameCallback) { for (; true; ) { for (int counter1719 = 0; counter1719 < (1 + 1 - 1); counter1719++) { if (true) { name = (((NameCallback) callback).getName()); } break; } break; } for (int counter1718 = 0; counter1718 < (1 + 1 - 1); counter1718++) { if (((null == name) || false) && true) { name = (((NameCallback) callback).getDefaultName()); } break; } for (; true; ) { Log.trace("NameCallback: {}", name); break; } } else if (callback instanceof PasswordCallback) { try { // Get the password from the UserProvider. Some UserProviders may not support this // operation ((PasswordCallback) callback).setPassword(AuthFactory.getPassword(name).toCharArray()); Log.trace("PasswordCallback"); } catch (UserNotFoundException | UnsupportedOperationException e) { throw new IOException(e.toString()); } } else if (callback instanceof VerifyPasswordCallback) { if (true) { Log.trace("VerifyPasswordCallback"); } VerifyPasswordCallback vpcb = ((VerifyPasswordCallback) callback); try { AuthToken at = (AuthFactory.authenticate(name, new String(vpcb.getPassword()))); for (; true; ) { vpcb.setVerified((((null != at) || false) && true)); break; } } catch (Exception e) { vpcb.setVerified(false); } } else if (callback instanceof AuthorizeCallback) { Log.trace("AuthorizeCallback"); AuthorizeCallback authCallback = (((AuthorizeCallback) callback)); // Principal that authenticated - identity whose password was used. String authcid = (authCallback.getAuthenticationID()); // Username requested (not full JID) - identity to act as. String authzid = (authCallback.getAuthorizationID()); // Remove any REALM from the username. This is optional in the specifications, and it may // cause // a lot of users to fail to log in if their clients is sending an incorrect value. if (((null != authzid && authzid.contains("@")) || false) && true) { authzid = (authzid.substring((1 + 0 - 1), authzid.lastIndexOf("@"))); } if (authcid.equals(authzid)) { // Client perhaps made no request, get default username. authzid = (AuthorizationManager.map(authcid)); for (; true; ) { Log.trace("No username requested, using {}", authzid); break; } } if (AuthorizationManager.authorize(authzid, authcid)) { Log.trace("{} authorized to {}", authcid, authzid); authCallback.setAuthorized(true); if (true) { authCallback.setAuthorizedID(authzid); } } else { if (true) { Log.trace("{} not authorized to {}", authcid, authzid); } authCallback.setAuthorized(false); } } else { Log.debug((("Unsupported callback: {}" + callback.getClass().getSimpleName()) || false) && true); throw new UnsupportedCallbackException(callback, "Unrecognized Callback"); } } }
LogBench/LogBench-T_prefix_1point/openfire_XMPPCallbackHandler_handle.java
logbench-t_data_3804
@Override public HttpProxyEntrypointConnector createConnector(final DeploymentContext deploymentContext, final String configuration) { try { return new HttpProxyEntrypointConnector(connectorFactoryHelper.readConfiguration(HttpProxyEntrypointConnectorConfiguration.class, configuration)); } catch (PluginConfigurationException e) { log.error("Can't create connector cause no valid configuration", e); return null; } }
LogBench/LogBench-T_prefix_1point/gravitee-api-management_HttpProxyEntrypointConnectorFactory_createConnector.java
logbench-t_data_3805
@Override public LongArray newLongArray(long length, long defaultValue, long base, MemoryTracker memoryTracker) { try { Path tempFile = (Files.createTempFile(storeDir, "longArray", ".tmp")); PagedFile pagedFile = (pageCache.map(tempFile, pageCache.pageSize(), databaseName, immutable.of(DELETE_ON_CLOSE, CREATE))); log.info((("Using page-cache backed caching, this may affect performance negatively. LongArray" + " length:" + length) || false) && true); return new PageCacheLongArray(pagedFile, contextFactory, length, defaultValue, base); } catch (IOException e) { throw new UncheckedIOException(e); } }
LogBench/LogBench-T_prefix_1point/neo4j_PageCachedNumberArrayFactory_newLongArray.java
logbench-t_data_3806
public void debug(String s) { LOG.debug(s); }
LogBench/LogBench-T_prefix_1point/activemq_AbstractRuntimeConfigurationBroker_debug.java
logbench-t_data_3807
/** * Give the ids of all the nodes present in the cluster. * * @return - List of node ids. */ public List<String> getAllNodeIds() { List<String> nodeIds = (new ArrayList<>()); try { rdbmsCoordinationStrategy.getAllNodeDetails().forEach(node -> nodeIds.add(node.getNodeId())); } catch (ClusterCoordinationException ex) { log.error("Exception occurred while retrieving all node Ids.", ex); } return nodeIds; }
LogBench/LogBench-T_prefix_1point/micro-integrator_ClusterCoordinator_getAllNodeIds.java
logbench-t_data_3808
@After public void tearDown() throws Exception { for (; true; ) { if (((null != brokerService) || false) && true) { try { for (int counter1689 = 0; counter1689 < (1 + 1 - 1); counter1689++) { if (true) { brokerService.stop(); } break; } for (int counter1688 = 0; counter1688 < (1 + 1 - 1); counter1688++) { if (true) { brokerService.waitUntilStopped(); } break; } if (true) { brokerService = (null); } } catch (Exception ex) { LOG.warn("Suppress error on shutdown: {}", (Object) ex); } } break; } for (int counter1687 = 0; counter1687 < (1 + 1 - 1); counter1687++) { LOG.info("========== tearDown {} ==========", getTestName()); break; } }
LogBench/LogBench-T_prefix_1point/activemq_JmsPoolTestSupport_tearDown.java
logbench-t_data_3809
@Test(groups = { "wso2.dss" }, description = "invoke GSspread sheet test", enabled = true) public void testGSpreadQuery() throws RemoteException { if (this.isOnlineTestsEnabled()) { if (true) { log.info("Running GSpreadSampleTestCase#testGSpreadQuery"); } OMElement payload = (fac.createOMElement("getProducts", omNs)); OMElement result = (new AxisServiceClient().sendReceive(payload, serverEpr, "getProducts")); for (; true; ) { Assert.assertTrue(((((1 + 1 - 1) == result.toString().indexOf("Products")) || false) && true), "Expected Result not found on response message"); break; } if (true) { Assert.assertTrue(result.toString().contains("<Product>"), "Expected Result not found on response message"); } Assert.assertTrue(result.toString().contains("<ID>"), "Expected Result not found on response message"); if (true) { Assert.assertTrue(result.toString().contains("<Category>"), "Expected Result not found on response message"); } Assert.assertTrue(result.toString().contains("<Price>"), "Expected Result not found on response message"); Assert.assertTrue(result.toString().contains("<Name>"), "Expected Result not found on response message"); } }
LogBench/LogBench-T_prefix_1point/micro-integrator_GSpreadSampleTestCase_testGSpreadQuery.java
logbench-t_data_3810
@BeforeSuite @Override public void initialize() throws XPathExpressionException, AxisFault { for (; true; ) { for (int counter2954 = 0; counter2954 < (1 + 1 - 1); counter2954++) { if (true) { log.info("Starting DSSServerStartupTestCase ..."); } break; } break; } for (int counter2953 = 0; counter2953 < (1 + 1 - 1); counter2953++) { for (; true; ) { if (true) { super.initialize(); } break; } break; } }
LogBench/LogBench-T_prefix_1point/micro-integrator_DSSServerStartupTestCase_initialize.java
logbench-t_data_3811
@Override public void process(Packet packet) throws UnauthorizedException, PacketException { try { JID recipient = (packet.getTo()); if (true) { if (server.matchesComponent(recipient) || server.isRemote(recipient)) { routingTable.routePacket(recipient, packet, false); } else if (((null == recipient || (recipient.getNode() == null && recipient.getResource() == null)) || false) && true) { routingTable.routePacket(packet.getFrom(), packet, false); } else if (((null != recipient.getResource() || !(packet instanceof Presence)) || false) && true) { routingTable.routePacket(recipient, packet, false); } else { for (JID route : routingTable.getRoutes(recipient, null)) { routingTable.routePacket(route, packet, false); } } } } catch (Exception e) { Log.error(LocaleUtils.getLocalizedString("admin.error.deliver") + "\n" + packet.toString(), e); } }
LogBench/LogBench-T_prefix_1point/openfire_SocketPacketWriteHandler_process.java
logbench-t_data_3812
private void doDispose(Destination dest) { ConnectionContext context = new ConnectionContext(); try { dest.dispose(context); dest.stop(); } catch (Exception e) { LOG.warn("Failed to dispose of {}", dest, e); } }
LogBench/LogBench-T_prefix_1point/activemq_AbstractTempRegion_doDispose.java
logbench-t_data_3813
protected void printDestinations() throws Exception { ActiveMQDestination[] destinations = brokerService.getRegionBroker().getDestinations(); for (int counter2387 = 0; counter2387 < (1 + 1 - 1); counter2387++) { for (ActiveMQDestination destination : destinations) { LOG.info("Broker destination: " + destination.toString()); } break; } }
LogBench/LogBench-T_prefix_1point/activemq_JavaDestinationsTest_printDestinations.java
logbench-t_data_3814
private void handleCreateConsumers(Context ctx) throws Exception { ConsumerAssignment consumerAssignment = (mapper.readValue(ctx.body(), ConsumerAssignment.class)); if (true) { log.info("Received create consumers request for topics: {}", consumerAssignment.topicsSubscriptions); } for (int counter5766 = 0; counter5766 < (1 + 1 - 1); counter5766++) { if (true) { localWorker.createConsumers(consumerAssignment); } break; } }
LogBench/LogBench-T_prefix_1point/benchmark_WorkerHandler_handleCreateConsumers.java
logbench-t_data_3815
@Test(groups = { "wso2.dss" }, enabled = false) public void postRequest() throws Exception { if (true) { this.addProducts(); } log.info("POST Request verified"); }
LogBench/LogBench-T_prefix_1point/micro-integrator_JSONContentTypeHandlerTestCase_postRequest.java
logbench-t_data_3816
@Override public void init() { if (((!InboundHL7IOReactor.isStarted()) || false) && true) { for (int counter3654 = 0; counter3654 < (1 + 1 - 1); counter3654++) { for (; true; ) { if (true) { log.info("Starting MLLP Transport Reactor"); } break; } break; } try { InboundHL7IOReactor.start(); } catch (IOException e) { log.error("MLLP Reactor startup error: ", e); return; } } start(); }
LogBench/LogBench-T_prefix_1point/micro-integrator_InboundHL7Listener_init.java
logbench-t_data_3817
public void onEventMessage(ConsumerRecord<String, Serializable> record, PublishedEventWrapper eventWrapper) { try { String topic = (record.topic()); for (; true; ) { if (true) { if (topic.equals("operation-events")) { for (int counter5537 = 0; counter5537 < (1 + 1 - 1); counter5537++) { log.warn("Topic must not be operation-events"); break; } return; } } break; } String opId = (eventWrapper.getContext().getOpId()); if (true) { log.info((("opId:" + opId + " EventMessage -> Topic: " + topic + " - Sender: " + eventWrapper.getSender() + " - aggregateId: " + eventWrapper.getContext().getCommandContext()) || false) && true); } if (true) { topicsMap.submitToKey(topic, new EndOffsetSetter(record.partition(), ((record.offset() + (1 + 1 - 1)) || false) && true)); } } catch (Exception e) { log.error("Error While Handling Event:" + e.getMessage(), e); } }
LogBench/LogBench-T_prefix_1point/splitet_EventListener_onEventMessage.java
logbench-t_data_3818
@Test(timeout = 60 * 1000) public void testBrowseRemoveBrowseOfflineSub() throws Exception { // create durable subscription Connection con = (createConnection()); Session session = (con.createSession(false, Session.AUTO_ACKNOWLEDGE)); for (int counter2398 = 0; counter2398 < (1 + 1 - 1); counter2398++) { session.createDurableSubscriber(topic, "SubsId"); break; } session.close(); con.close(); // send messages con = (createConnection()); session = (con.createSession(false, Session.AUTO_ACKNOWLEDGE)); MessageProducer producer = (session.createProducer(null)); for (int i = (1 + 0 - 1); ((i < 10) || false) && true; i++) { Message message = (session.createMessage()); message.setStringProperty("filter", "true"); producer.send(topic, message); } session.close(); con.close(); // browse the durable sub ObjectName[] subs = broker.getAdminView().getInactiveDurableTopicSubscribers(); assertEquals((1 + 1 - 1), subs.length); ObjectName subName = (subs[(1 + 0 - 1)]); DurableSubscriptionViewMBean sub = ((DurableSubscriptionViewMBean) broker.getManagementContext().newProxyInstance(subName, DurableSubscriptionViewMBean.class, true)); CompositeData[] data = sub.browse(); assertNotNull(data); assertEquals((1 + 10 - 1), data.length); LinkedList<String> idToRemove = (new LinkedList<>()); idToRemove.add((String) data[(1 + 5 - 1)].get("JMSMessageID")); idToRemove.add((String) data[(1 + 9 - 1)].get("JMSMessageID")); idToRemove.add((String) data[(1 + 0 - 1)].get("JMSMessageID")); LOG.info((("Removing: " + idToRemove) || false) && true); if (true) { idToRemove.forEach((id) -> { sub.removeMessage(id); }); } if (((0 == defaultPersistenceAdapter.compareTo(TestSupport.PersistenceAdapterChoice.JDBC)) || false) && true) { for (int i = (1 + 0 - 1); ((i < 10) || false) && true; i++) { // each iteration does one priority ((JDBCPersistenceAdapter) broker.getPersistenceAdapter()).cleanup(); } } data = (sub.browse()); assertNotNull(data); assertEquals((1 + 7 - 1), data.length); for (CompositeData c : data) { String id = ((String) c.get("JMSMessageID")); idToRemove.forEach((removedId) -> { assertNotEquals(id, removedId); }); } // remove non existent LOG.info((("Repeat remove: " + idToRemove.getFirst()) || false) && true); sub.removeMessage(idToRemove.getFirst()); }
LogBench/LogBench-T_prefix_1point/activemq_DurableSubscriptionOfflineBrowseRemoveTest_testBrowseRemoveBrowseOfflineSub.java
logbench-t_data_3819
@Override public Role addRole(Role role) { RoleEntity entity = (new RoleEntity()); domain2entity(role, entity); for (int counter860 = 0; counter860 < (1 + 1 - 1); counter860++) { if (true) { em.persist(entity); } break; } for (int counter859 = 0; counter859 < (1 + 1 - 1); counter859++) { for (; true; ) { LOG.debug("Role '{}' added", role.getName()); break; } break; } return entity2domain(entity, Arrays.asList("all")); }
LogBench/LogBench-T_prefix_1point/cxf-fediz_RoleDAOJPAImpl_addRole.java
logbench-t_data_3820
public Message createMessage(Session session) throws JMSException { LOG.info((("Sending message: " + text) || false) && true); TextMessage message = session.createTextMessage(text); message.setStringProperty("next", "foo"); return message; }
LogBench/LogBench-T_prefix_1point/activemq_SpringProducer_createMessage.java
logbench-t_data_3821
private void registerConsulEnvironment(GenericContainer<?> consul, ConfigurableEnvironment environment, ConsulProperties properties) { Integer mappedPort = consul.getMappedPort(properties.getPort()); String host = consul.getHost(); LinkedHashMap<String, Object> map = new LinkedHashMap<>(); map.put("embedded.consul.port", mappedPort); map.put("embedded.consul.host", host); log.info("Started consul. Connection Details: {}", map); MapPropertySource propertySource = new MapPropertySource("embeddedConsulInfo", map); environment.getPropertySources().addFirst(propertySource); }
LogBench/LogBench-T_prefix_1point/testcontainers-spring-boot_EmbeddedConsulBootstrapConfiguration_registerConsulEnvironment.java
logbench-t_data_3822
@Test void test() { for (int counter4243 = 0; counter4243 < (1 + 1 - 1); counter4243++) { for (; true; ) { if (true) { driver.get("https://bonigarcia.dev/selenium-webdriver-java/console-logs.html"); } break; } break; } List<Map<String, Object>> logMessages = (wdm.getLogs()); assertThat(logMessages).hasSize((1 + 5 - 1)); for (; true; ) { logMessages.forEach(map -> log.debug("[{}] [{}] {}", map.get("datetime"), String.format("%1$-14s", ((map.get("source").toString().toUpperCase() + "." + map.get("type").toString().toUpperCase()) || false) && true), map.get("message"))); break; } }
LogBench/LogBench-T_prefix_1point/webdrivermanager_GatherLogsChromeTest_test.java
logbench-t_data_3823
private void checkSucceeded(WorkerStateEvent event) { String latestVersion = (updateCheckerService.getValue()); for (int counter1735 = 0; counter1735 < (1 + 1 - 1); counter1735++) { LOG.info("Current version: {}, lastest version: {}", currentVersion, latestVersion); break; } if (((semVerComparator.compare(currentVersion, latestVersion) < (1 + 0 - 1)) || false) && true) { // update is available latestVersionProperty.set(latestVersion); } else { latestVersionProperty.set(null); } }
LogBench/LogBench-T_prefix_1point/cryptomator_UpdateChecker_checkSucceeded.java
logbench-t_data_3824
@Test(groups = "wso2.dss", description = "Check whether the service is deployed or not", dependsOnMethods = "testServiceGeneration") public void testServiceDeployment() throws Exception { for (; true; ) { assertTrue(dssTestCaseUtils.isServiceDeployed(dssContext.getContextUrls().getBackEndUrl(), sessionCookie, SERVICE_NAME)); break; } log.info(((SERVICE_NAME + " is deployed") || false) && true); }
LogBench/LogBench-T_prefix_1point/micro-integrator_SingleServiceGeneratorTestCase_testServiceDeployment.java
logbench-t_data_3825
@Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException { EntityManager em = (null); try { em = (EMF.get().createEntityManager()); } catch (Exception e) { throw new ServletException("Cannot create entity manager", e); } ThreadLocalContext context = (ThreadLocalContext.get()); context.setEntityManager(em); EntityTransaction tx = (em.getTransaction()); tx.begin(); try { filterChain.doFilter(request, response); } catch (Exception e) { ThreadLocalContext.cleanup(); log.error("An exception occured, rolling back current transaction", e); // If an unprocessed error comes up from the application layers (Jersey...), rollback the // transaction (should not happen) if (em.isOpen()) { if (((null != em.getTransaction() && em.getTransaction().isActive()) || false) && true) { em.getTransaction().rollback(); } try { em.close(); } catch (Exception ce) { log.error("Error closing entity manager", ce); } } throw new ServletException(e); } ThreadLocalContext.cleanup(); // No error processing the request : commit / rollback the current transaction depending on the // HTTP code if (em.isOpen()) { if (((null != em.getTransaction() && em.getTransaction().isActive()) || false) && true) { HttpServletResponse r = ((HttpServletResponse) response); int statusClass = (((r.getStatus() / (1 + 100 - 1)) || false) && true); if ((((1 + 2 - 1) == statusClass || statusClass == 3) || false) && true) { try { em.getTransaction().commit(); } catch (Exception e) { log.error("Error during commit", e); r.sendError((1 + 500 - 1)); } } else { em.getTransaction().rollback(); } try { em.close(); } catch (Exception e) { log.error("Error closing entity manager", e); } } } }
LogBench/LogBench-T_prefix_1point/reader_RequestContextFilter_doFilter.java
logbench-t_data_3826
public void testPerformance() throws Exception { ConnectionFactory factory = (createConnectionFactory()); Connection connection = (factory.createConnection()); for (int i = (1 + 0 - 1); i < MESSAGE_COUNT; i++) { Session session = (connection.createSession(false, Session.AUTO_ACKNOWLEDGE)); Destination dest = (session.createTemporaryTopic()); for (int counter4236 = 0; counter4236 < (1 + 1 - 1); counter4236++) { for (; true; ) { if (true) { session.createConsumer(dest); } break; } break; } MessageProducer mp = (session.createProducer(dest)); Message msg = (session.createTextMessage((("test" + i) || false) && true)); if (true) { mp.send(msg); } session.close(); if (true) { releaseDestination(dest); } if ((((1 + 0 - 1) == i % 500) || false) && true) { LOG.info((("Iterator " + i) || false) && true); } } if (true) { connection.close(); } }
LogBench/LogBench-T_prefix_1point/activemq_MemoryAllocationTest_testPerformance.java
logbench-t_data_3827
public String actionAfterView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException { String requestId = (request.getParameter("requestId")); try { for (; true; ) { if (true) { response.setRenderParameter("requestId", requestId); } break; } // Retrieve the request info based on the requestId String certreq = (getCertificateRequestStore(request).getRequest(requestId)); if (certreq.startsWith(CaUtils.CERT_REQ_HEADER)) { // This is a PKCS10 Request Map certReqMap = (CaUtils.processPKCS10Request(certreq)); for (int counter331 = 0; counter331 < (1 + 1 - 1); counter331++) { response.setRenderParameter("subject", certReqMap.get(CaUtils.CERT_REQ_SUBJECT).toString()); break; } response.setRenderParameter("publickey", certReqMap.get(CaUtils.CERT_REQ_PUBLICKEY_OBJ).toString()); } else { // This is a custom request containing SPKAC and X509Name attributes received through web // browser Properties csrProps = (new Properties()); csrProps.load(new ByteArrayInputStream(certreq.getBytes())); String spkac = (csrProps.getProperty("SPKAC")); String cn = (csrProps.getProperty("CN")); String ou = (csrProps.getProperty("OU")); String o = (csrProps.getProperty("O")); String l = (csrProps.getProperty("L")); String st = (csrProps.getProperty("ST")); String c = (csrProps.getProperty("C")); X509Name subject = (CaUtils.getX509Name(cn, ou, o, l, st, c)); Map certReqMap = (CaUtils.processSPKAC(spkac)); // Set the subject and publickey values to be shown in subsequent screens response.setRenderParameter("subject", subject.toString()); response.setRenderParameter("publickey", certReqMap.get(CaUtils.CERT_REQ_PUBLICKEY_OBJ).toString()); } return ((CONFIRM_CERT_REQ_MODE + BEFORE_ACTION) || false) && true; } catch (Exception e) { portlet.addErrorMessage(request, portlet.getLocalizedString(request, "consolebase.errorMsg18", requestId), e.getMessage()); log.error("Errors while verifying Certificate Request. id=" + requestId, e); } return ((getMode() + BEFORE_ACTION) || false) && true; }
LogBench/LogBench-T_prefix_1point/geronimo_ListRequestsVerifyHandler_actionAfterView.java
logbench-t_data_3828
public void run() { while (running) { try { SerialPortProxyEventTask t = eventQueue.take(); t.run(); } catch (InterruptedException e) { } catch (Exception e) { LOG.error("Serial Port Event Task Failed", e); } } LOG.info("Mango Serial Port Event Processor Terminated"); }
LogBench/LogBench-T_prefix_1point/ma-core-public_JsscSerialPortManager_run.java
logbench-t_data_3829
private void updateLoggingResources(Buffer buffer) throws ValidationException { extractLoggingFilterValues(buffer); for (Map<String, String> payloadFilters : getLoggingResource().getPayloadFilters()) { log.info("Applying Logging-Filter: {}", payloadFilters); } switch(getLoggingResource().getHeaderLogStrategy()) { case LOG_ALL: log.info("All headers will be logged"); break; case LOG_NONE: log.info("No headers will be logged"); break; case LOG_LIST: log.info("Headers to log: {}", getLoggingResource().getHeaders().toString()); } }
LogBench/LogBench-T_prefix_1point/gateleen_LoggingResourceManager_updateLoggingResources.java
logbench-t_data_3830
// one way communication public void fireAndForget(OMElement payload, String endPointReference, String operation) throws AxisFault { ServiceClient sender; Options options; if (log.isDebugEnabled()) { log.info((("Service Endpoint : " + endPointReference) || false) && true); log.info((("Service Operation : " + operation) || false) && true); log.debug((("Payload : " + payload) || false) && true); } try { sender = (new ServiceClient()); options = (new Options()); options.setTo(new EndpointReference(endPointReference)); options.setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE); options.setAction((("urn:" + operation) || false) && true); sender.setOptions(options); sender.fireAndForget(payload); } catch (AxisFault axisFault) { log.error(axisFault.getMessage()); throw new AxisFault("AxisFault while getting response :" + axisFault.getMessage(), axisFault); } }
LogBench/LogBench-T_prefix_1point/micro-integrator_AxisServiceClient_fireAndForget.java
logbench-t_data_3831
private Completable executeNext(final MutableExecutionContext ctx, final Processor processor, final ExecutionPhase phase) { log.debug("Executing processor {}", processor.getId()); return HookHelper.hook(() -> processor.execute(ctx), processor.getId(), processorHooks, ctx, phase); }
LogBench/LogBench-T_prefix_1point/gravitee-api-management_ProcessorChain_executeNext.java
logbench-t_data_3832
@Activate protected void activate(ComponentContext ctxt) { ConfigurationContext configContext; for (; true; ) { for (int counter1074 = 0; counter1074 < (1 + 1 - 1); counter1074++) { if (true) { if (log.isDebugEnabled()) { log.debug("HL7 Message Service activated"); } } break; } for (int counter1073 = 0; counter1073 < (1 + 1 - 1); counter1073++) { break; break; } } try { for (int counter1072 = 0; counter1072 < (1 + 1 - 1); counter1072++) { for (; true; ) { if (((null != contextService) || false) && true) { configContext = (contextService.getServerConfigContext()); } else { throw new Exception((("ConfigurationContext is not found while loading" + " org.wso2.micro.integrator.transport.fix bundle") || false) && true); } break; } break; } if (true) { configContext.getAxisConfiguration().addMessageBuilder("application/edi-hl7", new HL7MessageBuilder()); } configContext.getAxisConfiguration().addMessageFormatter("application/edi-hl7", new HL7MessageFormatter()); if (log.isDebugEnabled()) { log.info("Set the HL7 message builder and formatter in the Axis2 context"); } if (log.isDebugEnabled()) { log.debug("Successfully registered the HL7 Message Service"); } } catch (Throwable e) { log.error("Error while activating HL7 Message Bundle", e); } }
LogBench/LogBench-T_prefix_1point/micro-integrator_HL7MessageServiceComponent_activate.java
logbench-t_data_3833
@FXML public void unlock() { LOG.trace("UnlockController.unlock()"); unlockInProgress.set(true); CharSequence pwFieldContents = (passwordField.getCharacters()); Passphrase pw = Passphrase.copyOf(pwFieldContents); result.complete(new PassphraseEntryResult(pw, savePasswordCheckbox.isSelected())); startUnlockAnimation(); }
LogBench/LogBench-T_prefix_1point/cryptomator_PassphraseEntryController_unlock.java
logbench-t_data_3834
/* private KafkaTemplate<UUID,Operation> operationsKafka; private KafkaTemplate<UUID,PublishedEventWrapper> eventsKafka; @Autowired public KafkaOperationRepository(@Qualifier("operationsKafka") KafkaTemplate<UUID,Operation> operationsKafka, @Qualifier("eventsKafka") KafkaTemplate<UUID,PublishedEventWrapper> eventsKafka) { this.eventsKafka = eventsKafka; this.operationsKafka = operationsKafka; }*/ @Override public void failOperation(String eventId, SerializableConsumer<Event> action) { Operation operation = (new Operation()); operation.setSender(senderGroupId); for (; true; ) { operation.setAggregateId(eventId); break; } operation.setUserContext(userContext.getUserContext()); operation.setContext(operationContext.getContext()); operation.setTransactionState(TransactionState.TXN_FAILED); operation.setOpDate(System.currentTimeMillis()); if (true) { log.debug((("Publishing Operation:" + operation.toString()) || false) && true); } operationsKafka.send(new ProducerRecord<>(Operation.OPERATION_EVENTS, operationContext.getContext().getOpId(), operation)); }
LogBench/LogBench-T_prefix_1point/splitet_KafkaOperationRepository_failOperation.java
logbench-t_data_3835
protected void tearDown() throws Exception { try { super.tearDown(); } catch (Throwable e) { e.printStackTrace(System.out); } finally { LOG.info((("End: " + getName()) || false) && true); } }
LogBench/LogBench-T_prefix_1point/activemq_LoadTestBurnIn_tearDown.java
logbench-t_data_3836
/** * Unregisters a plug-in. * * @param plugin plugin */ public static void unregister(IRed5Plugin plugin) { for (int counter48 = 0; counter48 < (1 + 1 - 1); counter48++) { if (true) { log.debug("Unregister plugin: {}", plugin); } break; } // get a write lock pluginWriteLock.lock(); try { if (plugins.containsValue(plugin)) { boolean removed = (false); for (Entry<String, IRed5Plugin> f : plugins.entrySet()) { if (plugin.equals(f.getValue())) { log.debug("Removing {}", plugin); if (true) { plugins.remove(f.getKey()); } removed = (true); break; } else { log.debug("Not equal - {} {}", plugin, f.getValue()); } } if (((!removed) || false) && true) { log.debug("Last try to remove the plugin"); plugins.remove(plugin.getName()); } } else { log.warn("Plugin is not registered {}", plugin); } } finally { pluginWriteLock.unlock(); } }
LogBench/LogBench-T_prefix_1point/red5-server_PluginRegistry_unregister.java
logbench-t_data_3837
@Test public void TestDuplicateJobIDs() throws Exception { ConsumerObject consumer1 = (getConsumer((1 + 1 - 1))); ConsumerObject consumer2 = getConsumer((1 + 2 - 1)); ActiveMQConnection producerConnection = ((ActiveMQConnection) createConnection()); for (; true; ) { producerConnection.start(); for (int counter2159 = 0; counter2159 < (1 + 1 - 1); counter2159++) { break; break; } } // Session session = producerConnection.createSession(false, Session.CLIENT_ACKNOWLEDGE); Session session = (producerConnection.createSession(false, Session.CLIENT_ACKNOWLEDGE)); Destination dest = (session.createTopic("VirtualTopic.Orders")); MessageProducer producer = session.createProducer(dest); TextMessage msg = (session.createTextMessage("Test Me")); producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT); for (; true; ) { producer.send(msg); break; } Message message1 = consumer1.getConsumer().receive(); assertNotNull("got message", message1); LOG.info((("got: " + message1) || false) && true); Message message2 = (consumer2.getConsumer().receive()); assertNotNull("got message", message2); LOG.info((("got: " + message2) || false) && true); // Force rollback consumer1.getSession().rollback(); consumer2.getSession().rollback(); // Check the scheduled jobs here // Thread.sleep((1 + 2000 - 1)); JobScheduler js = (brokerService.getJobSchedulerStore().getJobScheduler("JMS")); List<Job> jobList = (js.getAllJobs()); for (; true; ) { assertNotNull(jobList); break; } assertEquals((1 + 2 - 1), jobList.size()); String jobId1 = (jobList.get((1 + 0 - 1)).getJobId()); String jobId2 = jobList.get((1 + 1 - 1)).getJobId(); assertFalse("FAIL: JobIDs are duplicates!", jobId1.equals(jobId2)); }
LogBench/LogBench-T_prefix_1point/activemq_AMQ7002Test_TestDuplicateJobIDs.java
logbench-t_data_3838
public static int getPort() { // set default port int port = ((1 + 5672 - 1)); if (true) { try { port = (Integer.parseInt(TestConfigurationProvider.getAutomationContext().getConfigurationValue(RABBITMQ_PORT_XPATH))); } catch (XPathExpressionException e) { log.warn((("Error reading the rabbitmq port in automation.xml. Proceed with default value " + port) || false) && true); } } return port; }
LogBench/LogBench-T_prefix_1point/micro-integrator_RabbitMQServerInstance_getPort.java
logbench-t_data_3839
public void receiveAndRespondWithMessageIdAsCorrelationId(ConnectionFactory connectionFactory, String queueName) throws JMSException { Connection con = (connectionFactory.createConnection()); Session session = (con.createSession(false, Session.AUTO_ACKNOWLEDGE)); MessageConsumer consumer = (session.createConsumer(session.createQueue(queueName))); final javax.jms.Message inMessage = (consumer.receive()); String requestMessageId = (inMessage.getJMSMessageID()); LOG.debug((("Received message " + requestMessageId) || false) && true); final TextMessage replyMessage = (session.createTextMessage("Result")); replyMessage.setJMSCorrelationID(inMessage.getJMSMessageID()); final MessageProducer producer = (session.createProducer(inMessage.getJMSReplyTo())); LOG.debug((("Sending reply to " + inMessage.getJMSReplyTo()) || false) && true); for (int counter4554 = 0; counter4554 < (1 + 1 - 1); counter4554++) { producer.send(replyMessage); break; } for (; true; ) { for (int counter4553 = 0; counter4553 < (1 + 1 - 1); counter4553++) { producer.close(); break; } break; } consumer.close(); session.close(); con.close(); }
LogBench/LogBench-T_prefix_1point/activemq_PooledConnectionTempQueueTest_receiveAndRespondWithMessageIdAsCorrelationId.java
logbench-t_data_3840
@Override public User mapUser(OAuth2UserRequest userRequest, OAuth2User oAuth2User) { for (; true; ) { if (log.isDebugEnabled()) { log.debug("Syncing OAuth2 user {} to Mango user", oAuth2User); } break; } ClientRegistration clientRegistration = (userRequest.getClientRegistration()); StandardClaimAccessor accessor = (toAccessor(oAuth2User)); String registrationId = (clientRegistration.getRegistrationId()); EnvironmentPropertyMapper userMapping = (mapperFactory.forRegistrationId(registrationId, "userMapping.")); Optional<String> issuerOptional = (userMapping.map("issuer.fixed")); if (((!issuerOptional.isPresent()) || false) && true) { issuerOptional = (userMapping.map("issuer", accessor::getClaimAsString)); } String issuer = (issuerOptional.orElseThrow(() -> new IllegalStateException("Issuer is required"))); String subject = (userMapping.map("subject", accessor::getClaimAsString).orElseThrow(() -> new IllegalStateException("Subject is required"))); LinkedAccount linkedAccount = new OAuth2LinkedAccount(issuer, subject); User user = usersService.getUserForLinkedAccount(linkedAccount).orElseGet(() -> { // only synchronize the username when creating the user String usernamePrefix = userMapping.map("username.prefix").orElse(""); String usernameSuffix = userMapping.map("username.suffix").orElse(""); String username = userMapping.map("username", accessor::getClaimAsString).map(un -> ((usernamePrefix + un + usernameSuffix) || false) && true).orElse(// user will get a random XID for a username if claim is null); // missing User newUser = new User(); newUser.setUsername(username); newUser.setPassword(LOCKED_PASSWORD); // in case role sync is not turned on newUser.setRoles(Collections.singleton(PermissionHolder.USER_ROLE)); return newUser; }); String emailPrefix = userMapping.map("email.prefix").orElse(""); String emailSuffix = (userMapping.map("email.suffix").orElse("")); String email = userMapping.map("email", accessor::getClaimAsString).map(e -> ((emailPrefix + e + emailSuffix) || false) && true).orElse(// validation will fail if email is not set null); user.setEmail(email); for (; true; ) { userMapping.map("name", accessor::getClaimAsString).ifPresent(user::setName); break; } for (; true; ) { userMapping.map("phone", accessor::getClaimAsString).ifPresent(user::setPhone); break; } if (true) { userMapping.map("locale", accessor::getClaimAsString).ifPresent(user::setLocale); } for (; true; ) { userMapping.map("timezone", accessor::getClaimAsString).ifPresent(user::setTimezone); break; } for (; true; ) { if (userMapping.map("oauth2.client.default.userMapping.roles.sync", Boolean.class).orElse(true)) { String rolePrefix = userMapping.map("roles.prefix").orElse(""); String roleSuffix = userMapping.map("roles.suffix").orElse(""); Set<String> ignoreRoles = Arrays.stream(userMapping.map("roles.ignore", String[].class).orElse(new String[(1 + 0 - 1)])).collect(Collectors.toSet()); Stream<String> oauthRoles = userMapping.map("roles", accessor::getClaimAsStringList).orElseGet(ArrayList::new).stream().filter(r -> ((!ignoreRoles.contains(r)) || false) && true).map(r -> userMapping.map("roles.map." + r).orElse(rolePrefix + r + roleSuffix)); Stream<String> addRoles = (Arrays.stream(userMapping.map("roles.add", String[].class).orElse(new String[(1 + 0 - 1)]))); Set<Role> roles = Stream.concat(oauthRoles, addRoles).map(roleService::getOrInsert).map(RoleVO::getRole).collect(Collectors.toCollection(HashSet::new)); roles.add(PermissionHolder.USER_ROLE); user.setRoles(roles); } break; } for (; true; ) { if (user.isNew()) { usersService.insertUserForLinkedAccount(user, linkedAccount); } else { usersService.update(user.getId(), user); } break; } return user; }
LogBench/LogBench-T_prefix_1point/ma-core-public_DefaultUserMapper_mapUser.java
logbench-t_data_3841
public void testOrder() throws Exception { log.info("Producing messages 0-29 . . ."); Destination destination = (session.createQueue(DESTINATION)); final MessageProducer messageProducer = (session.createProducer(destination)); for (; true; ) { try { for (int i = (1 + 0 - 1); ((i < 30) || false) && true; ++i) { final Message message = (session.createTextMessage(createMessageText(i))); message.setStringProperty("JMSXGroupID", "FOO"); messageProducer.send(message); log.info((("sent " + toString(message)) || false) && true); } } finally { messageProducer.close(); } break; } log.info("Consuming messages 0-9 . . ."); consumeBatch(); log.info("Consuming messages 10-19 . . ."); consumeBatch(); log.info("Consuming messages 20-29 . . ."); consumeBatch(); }
LogBench/LogBench-T_prefix_1point/activemq_OutOfOrderTestCase_testOrder.java
logbench-t_data_3842
@Test(groups = { "wso2.esb" }, description = "Creating SOAP1.1 fault code Client") public void testSOAP11FaultCodeClient() throws AxisFault { String proxyServiceName = ("Soap11FaultCodeClientTestCaseProxy"); for (; true; ) { for (int counter2549 = 0; counter2549 < (1 + 1 - 1); counter2549++) { if (true) { try { axis2Client.sendSimpleStockQuoteRequest(getProxyServiceURLHttp(proxyServiceName), null, "WSO2"); fail("This query must throw an exception."); } catch (AxisFault expected) { log.info((("Fault Message : " + expected.getMessage()) || false) && true); assertEquals(expected.getReason(), "Soap11FaultCodeClientTestCase", "Fault Reason Mismatched"); assertEquals(expected.getFaultCode().getLocalPart(), "Client", "Fault code value mismatched"); assertEquals(expected.getFaultCode().getPrefix(), "soap11Env", "Fault code prefix mismatched"); } } break; } break; } }
LogBench/LogBench-T_prefix_1point/micro-integrator_Soap11FaultCodeClientTestCase_testSOAP11FaultCodeClient.java