auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void concurrentDeleteAndPutTest() throws Exception { MockId id = getUniqueId(); final CountDownLatch getEndOffsetLatch = new CountDownLatch(1); final CountDownLatch findKeyLatch = new CountDownLatch(1); ((MockBlobStore) store).setBetweenGetEndOffsetAndFindKeyFunc(() -> { getEndOffsetLatch.countDown(); try { findKeyLatch.await(); } catch (Exception e) { } }); ExecutorService executorService = Executors.newFixedThreadPool(2); try { Future<Void> deleteFuture = executorService.submit(new Callable<Void>() { @Override public Void call() throws Exception { MessageInfo info = new MessageInfo(id, DELETE_RECORD_SIZE, id.getAccountId(), id.getContainerId(), time.milliseconds(), MessageInfo.LIFE_VERSION_FROM_FRONTEND); store.delete(Collections.singletonList(info)); return null; } }); getEndOffsetLatch.await(); Future<Void> putFuture = executorService.submit(new Callable<Void>() { @Override public Void call() throws Exception { putOneBlobWithId(id, PUT_RECORD_SIZE, Utils.Infinite_Time); return null; } }); putFuture.get(); findKeyLatch.countDown(); try { deleteFuture.get(); fail("Should fail with ID_NOT_FOUND error"); } catch (Exception e) { assertTrue(e.getCause() instanceof StoreException); assertEquals(StoreErrorCodes.ID_Not_Found, ((StoreException) e.getCause()).getErrorCode()); } } finally { ((MockBlobStore) store).setBetweenGetEndOffsetAndFindKeyFunc(null); executorService.shutdownNow(); } }

Target:
public void concurrentDeleteAndPutTest() throws Exception { MockId id = getUniqueId(); final CountDownLatch getEndOffsetLatch = new CountDownLatch(1); final CountDownLatch findKeyLatch = new CountDownLatch(1); ((MockBlobStore) store).setInDeleteBetweenGetEndOffsetAndFindKey(() -> { getEndOffsetLatch.countDown(); findKeyLatch.await(); return null; }); ExecutorService executorService = Executors.newFixedThreadPool(2); try { Future<Void> deleteFuture = executorService.submit(() -> { MessageInfo info = new MessageInfo(id, DELETE_RECORD_SIZE, id.getAccountId(), id.getContainerId(), time.milliseconds(), MessageInfo.LIFE_VERSION_FROM_FRONTEND); store.delete(Collections.singletonList(info)); return null; }); Future<Void> putFuture = executorService.submit(() -> { getEndOffsetLatch.await(); putOneBlobWithId(id, PUT_RECORD_SIZE, Utils.Infinite_Time); findKeyLatch.countDown(); return null; }); putFuture.get(); try { deleteFuture.get(); fail("Should fail with ID_NOT_FOUND error"); } catch (Exception e) { assertTrue(e.getCause() instanceof StoreException); assertEquals(StoreErrorCodes.ID_Not_Found, ((StoreException) e.getCause()).getErrorCode()); } } finally { ((MockBlobStore) store).setInDeleteBetweenGetEndOffsetAndFindKey(null); executorService.shutdownNow(); } }
Source:
private static <T> void runUntilEmpty(Queue<T> queue, Consumer<T> consumer) { while (!queue.isEmpty()) { T element = queue.poll(); if (element == null) { break; } consumer.accept(element); } }

Target:
private static <T> void runUntilEmpty(Queue<T> queue, Consumer<T> consumer) { for (T element = queue.poll(); element != null; element = queue.poll()) { consumer.accept(element); } }
Source:
public Vote checkXid(Xid xid) { if (xid.getFormatId() != XATxConverter.FORMAT_ID) { return Vote.ABSTAIN; } if (!TxControl.getXANodeName().equals(XATxConverter.getSubordinateNodeName(new XidImple(xid).getXID()))) { return Vote.ABSTAIN; } if (!validatePosition()) { return Vote.LEAVE_ALONE; } XidImple theXid = new XidImple(xid); SubordinateTransaction importedTransaction = null; try { importedTransaction = SubordinationManager.getTransactionImporter().getImportedTransaction(theXid); } catch (XAException e) { return Vote.LEAVE_ALONE; } if (importedTransaction != null) { return Vote.LEAVE_ALONE; } else { return Vote.ROLLBACK; } }

Target:
public Vote checkXid(Xid xid) { if (xid.getFormatId() != XATxConverter.FORMAT_ID) { return Vote.ABSTAIN; } if (!TxControl.getXANodeName().equals(XATxConverter.getSubordinateNodeName(new XidImple(xid).getXID()))) { return Vote.ABSTAIN; } if (!getSubordinateAtomicActionRecoveryModule().isRecoveryScanCompletedWithoutError()) { return Vote.LEAVE_ALONE; } XidImple theXid = new XidImple(xid); SubordinateTransaction importedTransaction = null; try { importedTransaction = SubordinationManager.getTransactionImporter().getImportedTransaction(theXid); } catch (XAException e) { return Vote.LEAVE_ALONE; } if (importedTransaction != null) { return Vote.LEAVE_ALONE; } else { return Vote.ROLLBACK; } }
Source:
public ServiceInstancePool() { this(300000); }

Target:
public ServiceInstancePool() { this.timer.schedule(new TimerTask() { @Override public void run() { expire(); } }, this.HOUSEKEEPING_INTERVAL, this.HOUSEKEEPING_INTERVAL); }
Source:
public static String encrypt(String apiKey, Map<String, Object> options) throws ScopedKeyException { if (apiKey.length() == 64) { return encrypt(KeenClient.client(), apiKey, options); } else { return oldEncrypt(KeenClient.client(), apiKey, options); } }

Target:
public static String encrypt(String apiKey, Map<String, Object> options) throws ScopedKeyException { if (apiKey.length() == 64) { return encrypt(KeenClient.client(), apiKey, options); } else { return encrypt32CharacterKey(KeenClient.client(), apiKey, options); } }
Source:
public static void main(String[] args) { String connectionString = "Endpoint={endpoint};SharedAccessKeyName={sharedAccessKeyName};SharedAccessKey={sharedAccessKey};EntityPath={eventHubPath}"; EventHubClient client = new EventHubClientBuilder() .connectionString(connectionString) .build(); EventHubProducer producer = client.createProducer(); List<EventData> dataList = new ArrayList<>(); dataList.add(new EventData("EventData Sample 1".getBytes(UTF_8))); dataList.add(new EventData("EventData Sample 2 ".getBytes(UTF_8))); dataList.add(new EventData("EventData Sample 3".getBytes(UTF_8))); String firstPartition = client.getPartitionIds().blockFirst(OPERATION_TIMEOUT); SendOptions sendOptions = new SendOptions().partitionKey(firstPartition); producer.send(dataList, sendOptions).subscribe( (ignored) -> System.out.println("A list of event sent to specific partition, partition ID = " + firstPartition), error -> { System.err.println("There was an error sending the event batch: " + error.toString()); if (error instanceof AmqpException) { AmqpException amqpException = (AmqpException) error; System.err.println(String.format("Is send operation retriable? %s. Error condition: %s", amqpException.isTransient(), amqpException.getErrorCondition())); } }, () -> { try { producer.close(); } catch (IOException e) { System.err.println("Error encountered while closing producer: " + e.toString()); } client.close(); }); }

Target:
public static void main(String[] args) { String connectionString = "Endpoint={endpoint};SharedAccessKeyName={sharedAccessKeyName};SharedAccessKey={sharedAccessKey};EntityPath={eventHubPath}"; EventHubClient client = new EventHubClientBuilder() .connectionString(connectionString) .buildAsyncClient(); EventHubProducer producer = client.createProducer(); Flux<EventData> data = Flux.just( new EventData("Ball".getBytes(UTF_8)), new EventData("Net".getBytes(UTF_8)), new EventData("Players".getBytes(UTF_8))); SendOptions sendOptions = new SendOptions().partitionKey("basketball"); producer.send(data, sendOptions).subscribe( (ignored) -> System.out.println("Sending a list of events to a partition that the partition key maps to..."), error -> { System.err.println("There was an error sending the event batch: " + error.toString()); if (error instanceof AmqpException) { AmqpException amqpException = (AmqpException) error; System.err.println(String.format("Is send operation retriable? %s. Error condition: %s", amqpException.isTransient(), amqpException.getErrorCondition())); } }, () -> { try { producer.close(); } catch (IOException e) { System.err.println("Error encountered while closing producer: " + e.toString()); } client.close(); }); }
Source:
public View getDropDownView(int position, View convertView, ViewGroup parent) { if (convertView == null) { LayoutInflater inflater = LayoutInflater.from(context); convertView = inflater.inflate(R.layout.custom_spinner_item, parent, false); } TextView tv = (TextView)convertView.findViewById(android.R.id.text1); if(position == 0){ tv.setHeight(0); }else{ tv.setHeight(3*(int)textSize+12); tv.setText(items[position]); tv.setTextSize(textUnit, textSize); tv.setPadding(10, 10, 10, 10); } return convertView; }

Target:
public View getDropDownView(int position, View convertView, ViewGroup parent) { if (convertView == null) { LayoutInflater inflater = LayoutInflater.from(context); convertView = inflater.inflate(R.layout.custom_spinner_item, parent, false); } TextView tv = (TextView)convertView.findViewById(android.R.id.text1); tv.setText(items[position]); tv.setTextSize(textUnit, textSize); tv.setPadding(10, 10, 10, 10); return convertView; }
Source:
public OutputColumns getOutputColumns() { OutputColumns outCols; try { CreateInput createInput = new CreateInput(); createInput.configuration = getConfiguration(getUsedInputColumns()); if(lastOutputColumns != null && createInput.equals(lastCreateInput)) { logger.debug("Reusing cached output columns, nothing changed"); outCols = lastOutputColumns; } else { logger.debug("Getting output columns from server"); boolean wasInit = false; if(client == null) { wasInit = true; initClient(); } try { org.datacleaner.restclient.OutputColumns columnsSpec = client.getOutputColumns(componentDisplayName, createInput); outCols = new OutputColumns(columnsSpec.getColumns().size(), Object.class); int i = 0; for (org.datacleaner.restclient.OutputColumns.OutputColumn colSpec : columnsSpec.getColumns()) { outCols.setColumnName(i, colSpec.name); try { outCols.setColumnType(i, Class.forName(colSpec.type)); } catch (ClassNotFoundException e) { Class type; if (isOutputColumnEnumeration(colSpec.schema)) { type = EnumerationValue.class; } else { type = JsonNode.class; } outCols.setColumnType(i, type); } i++; } lastOutputColumns = outCols; lastCreateInput = createInput; } finally { if(wasInit) { closeClient(); } } } return outCols; } catch(Exception e) { return new OutputColumns(String.class, "Unknown"); } }

Target:
public OutputColumns getOutputColumns() { OutputColumns outCols; try { CreateInput createInput = new CreateInput(); createInput.configuration = getConfiguration(getUsedInputColumns()); if(lastOutputColumns != null && createInput.equals(lastCreateInput)) { logger.debug("Reusing cached output columns, nothing changed"); outCols = lastOutputColumns; } else { logger.debug("Getting output columns from server"); boolean wasInit = false; if(client == null) { wasInit = true; initClient(); } try { org.datacleaner.restclient.OutputColumns columnsSpec = client.getOutputColumns(componentDisplayName, createInput); outCols = new OutputColumns(columnsSpec.getColumns().size(), Object.class); int i = 0; for (org.datacleaner.restclient.OutputColumns.OutputColumn colSpec : columnsSpec.getColumns()) { outCols.setColumnName(i, colSpec.name); try { outCols.setColumnType(i, Class.forName(colSpec.type)); } catch (ClassNotFoundException e) { Class type; if (isOutputColumnEnumeration(colSpec.schema)) { type = String.class; } else { type = JsonNode.class; } outCols.setColumnType(i, type); } i++; } lastOutputColumns = outCols; lastCreateInput = createInput; } finally { if(wasInit) { closeClient(); } } } return outCols; } catch(Exception e) { return new OutputColumns(String.class, "Unknown"); } }
Source:
public void testLargeMessage() throws Exception { int beforeLogSize = logViewer.getAllRemoteSystemLogs().length; String symbol2 = FixedSizeSymbolGenerator.generateMessageMB(3); OMElement response; for (int i = 0; i < 1; i++) { response = axis2Client.sendCustomQuoteRequest(getMainSequenceURL(), null, "MSFT" + symbol2); Assert.assertNotNull(response); Assert.assertTrue(response.toString().contains("MSFT"), "Incorrect symbol in response"); response = null; } LogEvent[] logs = logViewer.getAllRemoteSystemLogs(); int afterLogSize = logs.length; int forEachCount = 0; for (int i = (afterLogSize - beforeLogSize - 1); i >= 0; i--) { String message = logs[i].getMessage(); if (message.contains("foreach = in")) { if (!message.contains("MSFT")) { Assert.fail("Incorrect message entered ForEach scope. Could not find symbol MSFT .."); } forEachCount++; } } Assert.assertEquals(forEachCount, 1, "Count of messages entered ForEach scope is incorrect"); }

Target:
public void testLargeMessage() throws Exception { int beforeLogSize = logViewer.getAllRemoteSystemLogs().length; String symbol2 = FixedSizeSymbolGenerator.generateMessageMB(3); OMElement response; response = axis2Client.sendCustomQuoteRequest(getMainSequenceURL(), null, "MSFT" + symbol2); Assert.assertNotNull(response); Assert.assertTrue(response.toString().contains("MSFT"), "Incorrect symbol in response"); LogEvent[] logs = logViewer.getAllRemoteSystemLogs(); int afterLogSize = logs.length; int forEachCount = 0; for (int i = (afterLogSize - beforeLogSize - 1); i >= 0; i--) { String message = logs[i].getMessage(); if (message.contains("foreach = in")) { if (!message.contains("MSFT")) { Assert.fail("Incorrect message entered ForEach scope. Could not find symbol MSFT .."); } forEachCount++; } } Assert.assertEquals(forEachCount, 1, "Count of messages entered ForEach scope is incorrect"); }
Source:
public Map getConsumerParams() { return consumerParams; }

Target:
public Map<String, String> getConsumerParams() { return consumerParams; }
Source:
public void testListEmptyRootDirectory() throws IOException { skipIfUnsupported(TEST_ROOT_TESTS_ENABLED); FileSystem fs = getFileSystem(); Path root = new Path("/"); FileStatus[] statuses = fs.listStatus(root); for (FileStatus status : statuses) { ContractTestUtils.assertDeleted(fs, status.getPath(), true); } FileStatus[] list1 = fs.listStatus(root); assertEquals("listStatus on empty root-directory returned found: " + join("\n", list1), 0, list1.length); assertNoElements("listFiles(/, false)", fs.listFiles(root, false)); assertNoElements("listFiles(/, true)", fs.listFiles(root, true)); assertNoElements("listLocatedStatus(/)", fs.listLocatedStatus(root)); assertIsDirectory(root); }

Target:
public void testListEmptyRootDirectory() throws IOException { skipIfUnsupported(TEST_ROOT_TESTS_ENABLED); FileSystem fs = getFileSystem(); Path root = new Path("/"); FileStatus[] statuses = fs.listStatus(root); for (FileStatus status : statuses) { ContractTestUtils.assertDeleted(fs, status.getPath(), true); } FileStatus[] rootListStatus = fs.listStatus(root); assertEquals("listStatus on empty root-directory returned found: " + join("\n", rootListStatus), 0, rootListStatus.length); assertNoElements("listFiles(/, false)", fs.listFiles(root, false)); assertNoElements("listFiles(/, true)", fs.listFiles(root, true)); assertNoElements("listLocatedStatus(/)", fs.listLocatedStatus(root)); assertIsDirectory(root); }
Source:
public static void main(String ... argv) { Dataset ds = createAssembler() ; loadData(ds , "data-es.ttl") ; queryData(ds) ; }

Target:
public static void main(String ... argv) { Dataset ds = createCode() ; loadData(ds , "data.ttl") ; queryData(ds) ; }
Source:
public DatastreamTask getAssignedDatastreamTask(String instance, String taskName) { String content = _zkclient.ensureReadData(KeyBuilder.instanceAssignment(_cluster, instance, taskName)); DatastreamTaskImpl task = DatastreamTaskImpl.fromJson(content); String dsName = task.getDatastreamName(); task.setZkAdapter(this); if (_zkclient.exists(KeyBuilder.datastream(_cluster, dsName))) { String dsContent = _zkclient.ensureReadData(KeyBuilder.datastream(_cluster, dsName)); Datastream stream = DatastreamJSonUtil.getDatastreamFromJsonString(dsContent); task.setDatastream(stream); } return task; }

Target:
public DatastreamTask getAssignedDatastreamTask(String instance, String taskName) { String content = _zkclient.ensureReadData(KeyBuilder.instanceAssignment(_cluster, instance, taskName)); DatastreamTaskImpl task = DatastreamTaskImpl.fromJson(content); String dsName = task.getDatastreamName(); task.setZkAdapter(this); String dsPath = KeyBuilder.datastream(_cluster, dsName); if (!_zkclient.exists(dsPath)) { throw new RuntimeException("Missing Datastream in ZooKeeper for task=" + task + " instance=" + instance); } String dsContent = _zkclient.ensureReadData(dsPath); Datastream stream = DatastreamUtils.fromJSON(dsContent); task.setDatastream(stream); return task; }
Source:
protected void canceling() { super.cancel(); }

Target:
protected void canceling() { super.cancel(); segmentStoreReady(false); }
Source:
public void size(final int... size) { this.size = asList(toObject(size)); }

Target:
public Paging size(final int... size) { this.size = asList(toObject(size)); return this; }
Source:
private boolean getJsonConfigs() { HttpClient.HttpResponse response; boolean update = false; if (this.client == null) { return update; } try { String uripath = "agent/jmx/configs?timestamp=" + lastJsonConfigTs; response = client.request("GET", "", uripath); if (!response.isResponse2xx()) { log.warn( "Failed collecting JSON configs: [" + response.getResponseCode() + "] " + response.getResponseBody()); return update; } else if (response.getResponseCode() == 204) { log.debug("No configuration changes..."); return update; } InputStream jsonInputStream = IOUtils.toInputStream(response.getResponseBody(), UTF_8); JsonParser parser = new JsonParser(jsonInputStream); int timestamp = ((Integer) parser.getJsonTimestamp()).intValue(); if (timestamp > lastJsonConfigTs) { adJsonConfigs = (HashMap<String, Object>) parser.getJsonConfigs(); lastJsonConfigTs = timestamp; update = true; log.info("update is in order - updating timestamp: " + lastJsonConfigTs); for (String checkName : adJsonConfigs.keySet()) { log.debug("check " + checkName + " will be run"); } } } catch (JsonProcessingException e) { log.error("error processing JSON response: " + e); } catch (IOException e) { log.error("unable to collect remote JMX configs: " + e); } return update; }

Target:
private boolean getJsonConfigs() { HttpClient.HttpResponse response; boolean update = false; if (this.client == null) { return update; } try { String uripath = "agent/jmx/configs?timestamp=" + lastJsonConfigTs; response = client.request("GET", "", uripath); if (!response.isResponse2xx()) { log.warn( "Failed collecting JSON configs: [" + response.getResponseCode() + "] " + response.getResponseBody()); return update; } else if (response.getResponseCode() == 204) { log.debug("No configuration changes..."); return update; } InputStream jsonInputStream = IOUtils.toInputStream(response.getResponseBody(), UTF_8); JsonParser parser = new JsonParser(jsonInputStream); int timestamp = ((Integer) parser.getJsonTimestamp()).intValue(); if (timestamp > lastJsonConfigTs) { adJsonConfigs = (HashMap<String, Object>) parser.getJsonConfigs(); lastJsonConfigTs = timestamp; update = true; log.info("update is in order - updating timestamp: " + lastJsonConfigTs); for (String checkName : adJsonConfigs.keySet()) { log.debug("received config for check '" + checkName + "'"); } } } catch (JsonProcessingException e) { log.error("error processing JSON response: " + e); } catch (IOException e) { log.error("unable to collect remote JMX configs: " + e); } return update; }
Source:
private void display() throws Failure { final PrintWriter stdout = toPrintWriter(out); try { for (final Project p : db.projects().all()) { if (p.getNameKey().equals(wildProject)) { continue; } final ProjectState e = projectCache.get(p.getNameKey()); final ProjectControl pctl = e.controlFor(currentUser); if (e != null && pctl.isVisible()) { if (showBranch != null) { if (pctl.controlForRef(showBranch).isVisible()) { ObjectId id = getObjectIdForBranch(p.getNameKey(), showBranch); if (id != null) { stdout.print(id.name() + " "); stdout.print(p.getName()); stdout.println(); } } } else { stdout.print(p.getName()); stdout.println(); } } } } catch (OrmException e) { throw new Failure(1, "fatal: database error", e); } finally { stdout.flush(); } }

Target:
private void display() throws Failure { final PrintWriter stdout = toPrintWriter(out); try { for (final Project p : db.projects().all()) { if (p.getNameKey().equals(wildProject)) { continue; } final ProjectState e = projectCache.get(p.getNameKey()); if (e != null && e.controlFor(currentUser).isVisible()) { final ProjectControl pctl = e.controlFor(currentUser); if (showBranch != null) { if (pctl.controlForRef(showBranch).isVisible()) { ObjectId id = getObjectIdForBranch(p.getNameKey(), showBranch); if (id != null) { stdout.print(id.name() + " "); stdout.print(p.getName()); stdout.println(); } } } else { stdout.print(p.getName()); stdout.println(); } } } } catch (OrmException e) { throw new Failure(1, "fatal: database error", e); } finally { stdout.flush(); } }
Source:
public void cleanUp() { this.client.stop(); this.processor.cleanUp(); this.running.set(true); }

Target:
public void cleanUp() { this.client.stop(); this.processor.cleanUp(); this.running.set(false); }
Source:
protected PathRef getExistingUserWorkspaceRoot(CoreSession session, String username, DocumentModel context) { PathRef rootref = new PathRef(computePathUserWorkspaceRoot(session, username, context)); if (session.exists(rootref)) { return rootref; } DocumentModel uwsRootModel = doCreateUserWorkspacesRoot(session, rootref); ACP acp = initUserWorkspaceRootACL(); DocumentModel uwsRootDoc = CoreInstance.doPrivileged(session, s -> { DocumentModel docModel; try { docModel = s.getOrCreateDocument(uwsRootModel, doc -> { s.setACP(doc.getRef(), acp, true); return doc; }); } catch (DocumentNotFoundException e) { targetDomainName = null; PathRef ref = new PathRef(computePathUserWorkspaceRoot(session, username, null)); DocumentModel rootModel = doCreateUserWorkspacesRoot(session, ref); docModel = s.getOrCreateDocument(rootModel, doc -> { s.setACP(doc.getRef(), acp, true); return doc; }); } docModel.detach(true); return docModel; }); return new PathRef(uwsRootDoc.getPathAsString()); }

Target:
protected PathRef getExistingUserWorkspaceRoot(CoreSession session, String username, DocumentModel context) { PathRef rootref = new PathRef(computePathUserWorkspaceRoot(session, username, context)); if (session.exists(rootref)) { return rootref; } String path = CoreInstance.doPrivileged(session, s -> { DocumentModel docModel; try { DocumentModel uwsRootModel = doCreateUserWorkspacesRoot(session, rootref); docModel = s.getOrCreateDocument(uwsRootModel, doc -> initCreateUserWorkspacesRoot(s, doc)); } catch (DocumentNotFoundException e) { targetDomainName = null; PathRef ref = new PathRef(computePathUserWorkspaceRoot(s, username, null)); DocumentModel rootModel = doCreateUserWorkspacesRoot(s, ref); docModel = s.getOrCreateDocument(rootModel, doc -> initCreateUserWorkspacesRoot(s, doc)); } return docModel.getPathAsString(); }); return new PathRef(path); }
Source:
private boolean processAttributeElement(HttpMessage message, int depth, String baseURL, Element element, String attributeName) { String localURL = element.getAttributeValue(attributeName); if (localURL == null) { return false; } if (!attributeName.equalsIgnoreCase("ping")) { processURL(message, depth, localURL, baseURL); } else { for (String pingURL : localURL.split(" ")) { if (!pingURL.equals(" ")) { processURL(message, depth, pingURL, baseURL); } } } return true; }

Target:
private boolean processAttributeElement(HttpMessage message, int depth, String baseURL, Element element, String attributeName) { String localURL = element.getAttributeValue(attributeName); if (localURL == null) { return false; } if (!attributeName.equalsIgnoreCase("ping")) { processURL(message, depth, localURL, baseURL); } else { for (String pingURL : localURL.split("\\s")) { if (!pingURL.isEmpty()) { processURL(message, depth, pingURL, baseURL); } } } return true; }
Source:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { try { HttpServletRequest req = (HttpServletRequest)request; HttpSession session = req.getSession(); boolean persistentAuth = Collections.list(req.getHeaders(FiltersHelper.Constants.HEADER_PREFER)).contains("persistent-auth"); if (persistentAuth) { try { int ttlValue = Integer.parseInt(req.getHeader("Session-TTL")) * SECONDS_IN_MINUTE; if (ttlValue >= MINIMAL_SESSION_TTL) { session.setMaxInactiveInterval(ttlValue); } session.setAttribute( SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY, req.getAttribute(SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY ) ); } catch (NumberFormatException ex) { log.error("Session-TTL header was not passed. Not setting TTL value"); } } chain.doFilter(request, response); if (!persistentAuth && FiltersHelper.isAuthenticated(req)) { InitialContext ctx = new InitialContext(); try { FiltersHelper.getBackend(ctx).runAction( VdcActionType.LogoutBySession, new VdcActionParametersBase( (String) req.getAttribute(SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY) ) ); req.getSession().invalidate(); } finally { ctx.close(); } } } catch (Exception ex) { log.error("Error in REST-API session management. ", ex); } }

Target:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) request; boolean persistentAuth = Collections.list(req.getHeaders(FiltersHelper.Constants.HEADER_PREFER)).contains("persistent-auth"); HttpSession session = req.getSession(); if (persistentAuth) { try { int ttlValue = Integer.parseInt(req.getHeader("Session-TTL")) * SECONDS_IN_MINUTE; if (ttlValue >= MINIMAL_SESSION_TTL) { session.setMaxInactiveInterval(ttlValue); } session.setAttribute( SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY, req.getAttribute(SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY ) ); } catch (NumberFormatException ex) { log.error("Session-TTL header was not passed. Not setting TTL value"); } } chain.doFilter(request, response); try { if (!persistentAuth && FiltersHelper.isAuthenticated(req)) { InitialContext ctx = new InitialContext(); try { FiltersHelper.getBackend(ctx).runAction( VdcActionType.LogoutBySession, new VdcActionParametersBase( (String) req.getAttribute(SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY) ) ); req.getSession().invalidate(); } finally { ctx.close(); } } } catch (Exception ex) { log.error("Error in REST-API session management. ", ex); } }
Source:
public HomeView( Binder uiBinder) { initWidget(uiBinder.createAndBindUi(this)); }

Target:
HomeView(Binder uiBinder) { initWidget(uiBinder.createAndBindUi(this)); }
Source:
public MachineReadableReport(ValidationInfo info, String creationDate, String processingTime, FeaturesReport featuresReport) { this.info = info; this.creationDate = creationDate; this.processingTime = processingTime; this.pdfFeatures = featuresReport; }

Target:
private MachineReadableReport(ValidationInfo info, String creationDate, String processingTime, FeaturesReport featuresReport) { this.info = info; this.creationDate = creationDate; this.processingTime = processingTime; this.pdfFeatures = featuresReport; }
Source:
public DefaultProxyAuthenticator(Credentials credentials) throws MalformedChallengeException { this.proxyCredentials = credentials; basicScheme = new BasicScheme(); basicScheme.processChallenge(new BasicHeader(AUTH.PROXY_AUTH, "BASIC realm=\"proxy\"")); }

Target:
public DefaultProxyAuthenticator(Credentials credentials) throws MalformedChallengeException { this.proxyCredentials = credentials; basicScheme = new BasicScheme(); basicScheme.processChallenge(new BasicHeader(AUTH.PROXY_AUTH, PassThroughConstants.PROXY_BASIC_REALM)); }
Source:
public List<DataSegment> getUnusedSegmentsForInterval(final String dataSource, final Interval interval) { List<DataSegment> matchingSegments = connector.getDBI().withHandle( new HandleCallback<List<DataSegment>>() { @Override public List<DataSegment> withHandle(Handle handle) throws IOException, SQLException { return handle.createQuery( String.format( "SELECT payload FROM %s WHERE dataSource = :dataSource and start >= :start and \"end\" <= :end and used = false", dbTables.getSegmentsTable() ) ) .bind("dataSource", dataSource) .bind("start", interval.getStart().toString()) .bind("end", interval.getEnd().toString()) .fold( Lists.<DataSegment>newArrayList(), new Folder3<List<DataSegment>, Map<String, Object>>() { @Override public List<DataSegment> fold( List<DataSegment> accumulator, Map<String, Object> stringObjectMap, FoldController foldController, StatementContext statementContext ) throws SQLException { try { DataSegment segment = jsonMapper.readValue( (byte[])stringObjectMap.get("payload"), DataSegment.class ); accumulator.add(segment); return accumulator; } catch (Exception e) { throw Throwables.propagate(e); } } } ); } } ); log.info("Found %,d segments for %s for interval %s.", matchingSegments.size(), dataSource, interval); return matchingSegments; }

Target:
public List<DataSegment> getUnusedSegmentsForInterval(final String dataSource, final Interval interval) { List<DataSegment> matchingSegments = connector.getDBI().withHandle( new HandleCallback<List<DataSegment>>() { @Override public List<DataSegment> withHandle(Handle handle) throws IOException, SQLException { return handle .createQuery( String.format( "SELECT payload FROM %s WHERE dataSource = :dataSource and start >= :start and \"end\" <= :end and used = false", dbTables.getSegmentsTable() ) ) .bind("dataSource", dataSource) .bind("start", interval.getStart().toString()) .bind("end", interval.getEnd().toString()) .map(ByteArrayMapper.FIRST) .fold( Lists.<DataSegment>newArrayList(), new Folder3<List<DataSegment>, byte[]>() { @Override public List<DataSegment> fold( List<DataSegment> accumulator, byte[] payload, FoldController foldController, StatementContext statementContext ) throws SQLException { try { accumulator.add(jsonMapper.readValue(payload, DataSegment.class)); return accumulator; } catch (Exception e) { throw Throwables.propagate(e); } } } ); } } ); log.info("Found %,d segments for %s for interval %s.", matchingSegments.size(), dataSource, interval); return matchingSegments; }
Source:
private Registry<ConnectionSocketFactory> getSchemeRegistry(final URI originalUri) { UnixConnectionSocketFactory unix = new UnixConnectionSocketFactory(originalUri); return RegistryBuilder .<ConnectionSocketFactory>create() .register("http", PlainConnectionSocketFactory.getSocketFactory()) .register("https", SSLConnectionSocketFactory.getSocketFactory()) .register("unix", unix) .build(); }

Target:
private Registry<ConnectionSocketFactory> getSchemeRegistry(final URI originalUri) { return RegistryBuilder .<ConnectionSocketFactory>create() .register("http", PlainConnectionSocketFactory.getSocketFactory()) .register("https", SSLConnectionSocketFactory.getSocketFactory()) .register("unix", new UnixConnectionSocketFactory(originalUri)) .build(); }
Source:
public HashConfigurationBuilder capacityFactor(float capacityFactor) { if (numSegments < 0) throw new IllegalArgumentException("capacityFactor must be positive"); this.capacityFactor = capacityFactor; return this; }

Target:
public HashConfigurationBuilder capacityFactor(float capacityFactor) { if (capacityFactor < 0) throw new IllegalArgumentException("capacityFactor must be positive"); this.capacityFactor = capacityFactor; return this; }
Source:
public RepositoryGroups() { List<String> groups = split( preferences.get(PREFS_GROUPS, EMPTY_STRING)); for (String groupIdString : groups) { UUID groupId = UUID.fromString(groupIdString); String name = preferences .get(PREFS_GROUP_NAME_PREFIX + groupIdString, EMPTY_STRING); List<String> repos = split(preferences .get(PREFS_GROUP_PREFIX + groupIdString, EMPTY_STRING)); RepositoryGroup group = new RepositoryGroup(groupId, name, repos); groupMap.put(groupId, group); } }

Target:
private RepositoryGroups() { List<String> groups = split( preferences.get(PREFS_GROUPS, EMPTY_STRING)); for (String groupIdString : groups) { UUID groupId = UUID.fromString(groupIdString); String name = preferences .get(PREFS_GROUP_NAME_PREFIX + groupIdString, EMPTY_STRING); List<File> repos = split(preferences .get(PREFS_GROUP_PREFIX + groupIdString, EMPTY_STRING)) .stream().map(File::new) .collect(Collectors.toList()); RepositoryGroup group = new RepositoryGroup(groupId, name, repos); groupMap.put(groupId, group); } }
Source:
static PatchListEntry readFrom(final InputStream in) throws IOException { final ChangeType changeType = readEnum(in, ChangeType.values()); final PatchType patchType = readEnum(in, PatchType.values()); final String oldName = readString(in); final String newName = readString(in); final byte[] hdr = readBytes(in); final int editCount = readVarInt32(in); final LineEdit[] editArray = new LineEdit[editCount]; for (int i = 0; i < editCount; i++) { editArray[i] = readEdit(in); int innerCount = readVarInt32(in); if (0 < innerCount) { LineEdit[] inner = new LineEdit[innerCount]; for (int innerIdx = 0; innerIdx < innerCount; innerIdx++) { inner[innerIdx] = readEdit(in); } editArray[i] = new LineEdit(editArray[i], toList(inner)); } } return new PatchListEntry(changeType, patchType, oldName, newName, hdr, toList(editArray)); }

Target:
static PatchListEntry readFrom(final InputStream in) throws IOException { final ChangeType changeType = readEnum(in, ChangeType.values()); final PatchType patchType = readEnum(in, PatchType.values()); final String oldName = readString(in); final String newName = readString(in); final byte[] hdr = readBytes(in); final int editCount = readVarInt32(in); final LineEdit[] editArray = new LineEdit[editCount]; for (int i = 0; i < editCount; i++) { editArray[i] = readEdit(in); int innerCount = readVarInt32(in); if (0 < innerCount) { BaseEdit[] inner = new BaseEdit[innerCount]; for (int innerIdx = 0; innerIdx < innerCount; innerIdx++) { inner[innerIdx] = readEdit(in); } editArray[i] = new LineEdit(editArray[i], Collections.unmodifiableList(Arrays .asList((inner)))); } } return new PatchListEntry(changeType, patchType, oldName, newName, hdr, Collections.unmodifiableList(Arrays.asList(editArray))); }
Source:
private static XmlSuite extractTestNames(XmlSuite s, List<String> testNames) { List<XmlSuite> childSuites = s.getChildSuites(); for (int i = 0; i < childSuites.size(); i++) { XmlSuite child = childSuites.get(0); XmlSuite extracted = extractTestNames(child, testNames); if (extracted != child) { childSuites.set(i, extracted); } } List<XmlTest> tests = Lists.newArrayList(); for (XmlTest xt : s.getTests()) { for (String tn : testNames) { if (xt.getName().equals(tn)) { tests.add(xt); } } } if (tests.size() == 0) { return s; } else { XmlSuite result = (XmlSuite) s.clone(); result.getTests().clear(); result.getTests().addAll(tests); return result; } }

Target:
private static XmlSuite extractTestNames(XmlSuite s, List<String> testNames) { extractTestNamesFromChildSuites(s, testNames); List<XmlTest> tests = Lists.newArrayList(); for (XmlTest xt : s.getTests()) { for (String tn : testNames) { if (xt.getName().equals(tn)) { tests.add(xt); } } } if (tests.size() == 0) { return s; } else { XmlSuite result = (XmlSuite) s.clone(); result.getTests().clear(); result.getTests().addAll(tests); return result; } }
Source:
public AbstractContainerRequestValueFactory<?> createValueFactory(Parameter parameter) { final boolean isOptionalPrincipal = parameter.getRawType().equals(Optional.class) && ParameterizedType.class.isAssignableFrom(parameter.getType().getClass()) && principalClassSet.contains(((ParameterizedType) parameter.getType()).getActualTypeArguments()[0]); if (!parameter.isAnnotationPresent(Auth.class) || !(principalClassSet.contains(parameter.getRawType()) || isOptionalPrincipal)) { return null; } else if (isOptionalPrincipal) { return new OptionalPrincipalContainerRequestValueFactory(); } else { return new PrincipalContainerRequestValueFactory(); } }

Target:
public AbstractContainerRequestValueFactory<?> createValueFactory(Parameter parameter) { if (!parameter.isAnnotationPresent(Auth.class)) { return null; } else if (principalClassSet.contains(parameter.getRawType())) { return new PrincipalContainerRequestValueFactory(); } else { final boolean isOptionalPrincipal = parameter.getRawType() == Optional.class && ParameterizedType.class.isAssignableFrom(parameter.getType().getClass()) && principalClassSet.contains(((ParameterizedType) parameter.getType()).getActualTypeArguments()[0]); return isOptionalPrincipal ? new OptionalPrincipalContainerRequestValueFactory() : null; } }
Source:
public void givenAChargeCapturedNotification_chargeNotificationProcessorInvokedWithNotificationAndCharge() throws EpdqNotification.EpdqParseException { final String payload = notificationPayloadForTransaction( payId, EPDQ_PAYMENT_REQUESTED); notificationService.handleNotificationFor(payload); verify(mockRefundNotificationProcessor, never()).invoke(any(), any(), any(), any()); verify(mockChargeNotificationProcessor).invoke(payId, mockCharge, CAPTURED, null); }

Target:
public void givenAChargeCapturedNotification_chargeNotificationProcessorInvokedWithNotificationAndCharge() { final String payload = notificationPayloadForTransaction( payId, EPDQ_PAYMENT_REQUESTED); notificationService.handleNotificationFor(payload); verify(mockRefundNotificationProcessor, never()).invoke(any(), any(), any(), any()); verify(mockChargeNotificationProcessor).invoke(payId, mockCharge, CAPTURED, null); }
Source:
protected void DetachVmFromUser() { VM vm = DbFacade.getInstance().getVmDao().get(getVmId()); if (getVmPoolId().equals(vm.getVmPoolId())) { permissions perm = DbFacade .getInstance() .getPermissionDao() .getForRoleAndAdElementAndObject( PredefinedRoles.ENGINE_USER.getId(), getAdUserId(), vm.getId()); if (perm != null) { DbFacade.getInstance().getPermissionDao().remove(perm.getId()); RestoreVmFromBaseSnapshot(vm); } } }

Target:
protected void DetachVmFromUser() { VM vm = DbFacade.getInstance().getVmDao().get(getParameters().getVmId()); if (vm != null && getVmPoolId().equals(vm.getVmPoolId())) { permissions perm = DbFacade .getInstance() .getPermissionDao() .getForRoleAndAdElementAndObject( PredefinedRoles.ENGINE_USER.getId(), getAdUserId(), vm.getId()); if (perm != null) { DbFacade.getInstance().getPermissionDao().remove(perm.getId()); RestoreVmFromBaseSnapshot(vm); } } }
Source:
protected URI getCreateAccountURI(final boolean getKeys, final String service) throws UnsupportedEncodingException, URISyntaxException { final StringBuilder sb = new StringBuilder(serverURI); sb.append("account/create"); if (getKeys || service != null) { sb.append("?"); if (getKeys) { sb.append("keys=true"); } if (service != null) { if (getKeys) { sb.append("&"); } sb.append("service=" + URLEncoder.encode(service, "UTF-8")); } } return new URI(sb.toString()); }

Target:
protected URI getCreateAccountURI(final boolean getKeys, final String service) throws UnsupportedEncodingException, URISyntaxException { if (service == null) { throw new IllegalArgumentException("service must not be null"); } final StringBuilder sb = new StringBuilder(serverURI); sb.append("account/create?service="); sb.append(URLEncoder.encode(service, "UTF-8")); if (getKeys) { sb.append("&keys=true"); } return new URI(sb.toString()); }
Source:
public List<Connection> addInternalLinks(EObject investigatedElement, List<String> selectedRelationshipTypes) { List<Connection> connections = new ArrayList<Connection>(); if (investigatedElement instanceof INamed) { INamed named = (INamed) investigatedElement; if (!named.eCrossReferences().isEmpty()) { List<EObject> refs = named.eCrossReferences(); for (EObject ref : refs) { if (selectedRelationshipTypes.size() == 0 || selectedRelationshipTypes.contains(ref.eClass().getName())) { connections.add(new Connection(investigatedElement, Arrays.asList(ref), ref)); } } } } return connections; }

Target:
public List<Connection> addInternalLinks(EObject investigatedElement, List<String> selectedRelationshipTypes) { List<Connection> connections = new ArrayList<Connection>(); if (investigatedElement instanceof INamed) { INamed named = (INamed) investigatedElement; if (named.eCrossReferences() != null) { List<EObject> refs = named.eCrossReferences(); for (EObject ref : refs) { if (selectedRelationshipTypes != null) { if (selectedRelationshipTypes.size() == 0 || selectedRelationshipTypes.contains(ref.eClass().getName())) { connections.add(new Connection(investigatedElement, Arrays.asList(ref), ref)); } } else { connections.add(new Connection(investigatedElement, Arrays.asList(ref), ref)); } } } } return connections; }
Source:
private String getHypervisor(String folder) { String[] validHypervisors = CDK3Server.getHypervisors(); String hyperV = validHypervisors[0]; File config = new File(folder, "config"); File configJson = new File(config, "config.json"); if (!configJson.exists() || !configJson.isFile()) { return hyperV; } String path = configJson.getAbsolutePath(); try { String content = new String(Files.readAllBytes(Paths.get(path))); ModelNode mn = ModelNode.fromJSONString(content); ModelNode o = mn.get("vm-driver"); String val = (o == null ? null : o.asString()); if (val != null && Arrays.asList(validHypervisors).contains(val)) { return val; } } catch (IOException e) { CDKCoreActivator.pluginLog().logError("Error parsing " + path, e); } return hyperV; }

Target:
private String getHypervisor(String folder) { String[] validHypervisors = CDK3Server.getHypervisors(); String hyperV = validHypervisors[0]; File config = new File(folder, CONFIG); File configJson = new File(config, CONFIG_JSON); if (!configJson.exists() || !configJson.isFile()) { return hyperV; } String path = configJson.getAbsolutePath(); try { String content = new String(Files.readAllBytes(Paths.get(path))); ModelNode mn = ModelNode.fromJSONString(content); ModelNode o = mn.get(VM_DRIVER); String val = (o == null ? null : o.asString()); if (val != null && Arrays.asList(validHypervisors).contains(val)) { return val; } } catch (IOException e) { CDKCoreActivator.pluginLog().logError("Error parsing " + path, e); } return hyperV; }
Source:
protected void postStop() { super.postStop(); ConfigBag stopParameters = BrooklynTaskTags.getCurrentEffectorParameters(); if (stopParameters == null || (StopMode.NEVER != stopParameters.get(StopSoftwareParameters.STOP_MACHINE_MODE) && Boolean.TRUE.equals(stopParameters.get(StopSoftwareParameters.STOP_MACHINE)))) { Task<?> stopEffectorTask = BrooklynTaskTags.getClosestEffectorTask(Tasks.current(), Startable.STOP); getManagementContext().getExecutionManager().submit(new UnmanageTask(stopEffectorTask, this)); } }

Target:
protected void postStop() { super.postStop(); if (isMachineStopped()) { Task<?> stopEffectorTask = BrooklynTaskTags.getClosestEffectorTask(Tasks.current(), Startable.STOP); getManagementContext().getExecutionManager().submit(new UnmanageTask(stopEffectorTask, this)); } }
Source:
public static void merge(Extensible<?> from, Extensible<?> to, boolean override) { if (from == null) { return; } if (to.getExtensions() == null) { to.setExtensions(createMap()); } if (!from.getExtensions().isEmpty()) { for (String extensionName : from.getExtensions().keySet()) { Object value = mergeProperty( to.getExtensions().get(extensionName), from.getExtensions().get(extensionName), override ); to.addExtension(extensionName, value); } } }

Target:
public static void merge(Extensible<?> from, Extensible<?> to, boolean override) { if (from == null) { return; } if (to.getExtensions() == null) { to.setExtensions(createMap()); } if (from.getExtensions().isEmpty()) { return; } for (String extensionName : from.getExtensions().keySet()) { Object value = mergeProperty( to.getExtensions().get(extensionName), from.getExtensions().get(extensionName), override ); to.addExtension(extensionName, value); } }
Source:
default Iterator<T> dropWhile(Predicate<? super T> predicate) { if (!hasNext()) { return empty(); } else { final Iterator<T> that = this; return new Iterator<T>() { private T next = null; @Override public boolean hasNext() { while (next == null && that.hasNext()) { final T value = that.next(); if(!predicate.test(value)) { next = value; } } return next != null; } @Override public T next() { if (!hasNext()) { EMPTY.next(); } final T result = next; next = null; return result; } }; } }

Target:
default Iterator<T> dropWhile(Predicate<? super T> predicate) { Objects.requireNonNull(predicate, "predicate is null"); if (!hasNext()) { return empty(); } else { final Iterator<T> that = this; return new Iterator<T>() { private T next = null; @Override public boolean hasNext() { while (next == null && that.hasNext()) { final T value = that.next(); if(!predicate.test(value)) { next = value; } } return next != null; } @Override public T next() { if (!hasNext()) { EMPTY.next(); } final T result = next; next = null; return result; } }; } }
Source:
private void downloadItem(TranslationRowData translationRowData) { if (!(translationRowData instanceof TranslationItem)) { return; } TranslationItem selectedItem = (TranslationItem) translationRowData; if (selectedItem.exists() && !selectedItem.needsUpgrade()) { return; } downloadingItem = selectedItem; if (mDownloadReceiver == null) { mDownloadReceiver = new DefaultDownloadReceiver(this, QuranDownloadService.DOWNLOAD_TYPE_TRANSLATION); LocalBroadcastManager.getInstance(this).registerReceiver( mDownloadReceiver, new IntentFilter( QuranDownloadNotifier.ProgressIntent.INTENT_NAME)); } mDownloadReceiver.setListener(this); String url = selectedItem.translation.fileUrl; if (selectedItem.translation.fileUrl == null) { return; } String destination = databaseDirectory; Timber.d("downloading %s to %s", url, destination); if (selectedItem.exists()) { try { File f = new File(destination, selectedItem.translation.filename); if (f.exists()) { File newPath = new File(destination, selectedItem.translation.filename + UPGRADING_EXTENSION); if (newPath.exists()) { newPath.delete(); } f.renameTo(newPath); } } catch (Exception e) { Timber.d(e, "error backing database file up"); } } String notificationTitle = selectedItem.name(); Intent intent = ServiceIntentHelper.getDownloadIntent(this, url, destination, notificationTitle, TRANSLATION_DOWNLOAD_KEY, QuranDownloadService.DOWNLOAD_TYPE_TRANSLATION); String filename = selectedItem.translation.filename; if (url.endsWith("zip")) { filename += ".zip"; } intent.putExtra(QuranDownloadService.EXTRA_OUTPUT_FILE_NAME, filename); startService(intent); }

Target:
private void downloadItem(TranslationRowData translationRowData) { TranslationItem selectedItem = (TranslationItem) translationRowData; if (selectedItem.exists() && !selectedItem.needsUpgrade()) { return; } downloadingItem = selectedItem; if (mDownloadReceiver == null) { mDownloadReceiver = new DefaultDownloadReceiver(this, QuranDownloadService.DOWNLOAD_TYPE_TRANSLATION); LocalBroadcastManager.getInstance(this).registerReceiver( mDownloadReceiver, new IntentFilter( QuranDownloadNotifier.ProgressIntent.INTENT_NAME)); } mDownloadReceiver.setListener(this); String url = selectedItem.translation.fileUrl; if (selectedItem.translation.fileUrl == null) { return; } String destination = databaseDirectory; Timber.d("downloading %s to %s", url, destination); if (selectedItem.exists()) { try { File f = new File(destination, selectedItem.translation.filename); if (f.exists()) { File newPath = new File(destination, selectedItem.translation.filename + UPGRADING_EXTENSION); if (newPath.exists()) { newPath.delete(); } f.renameTo(newPath); } } catch (Exception e) { Timber.d(e, "error backing database file up"); } } String notificationTitle = selectedItem.name(); Intent intent = ServiceIntentHelper.getDownloadIntent(this, url, destination, notificationTitle, TRANSLATION_DOWNLOAD_KEY, QuranDownloadService.DOWNLOAD_TYPE_TRANSLATION); String filename = selectedItem.translation.filename; if (url.endsWith("zip")) { filename += ".zip"; } intent.putExtra(QuranDownloadService.EXTRA_OUTPUT_FILE_NAME, filename); startService(intent); }
Source:
public Object evaluate(Object feature) { Object arg0; try { arg0 = getExpression(0).evaluate(feature); } catch (Exception e) { throw new IllegalArgumentException( "Filter Function problem for function equalTo argument #0 - expected type Object"); } return arg0.getClass().toString(); }

Target:
public Object evaluate(Object feature) { Object arg0; try { arg0 = getExpression(0).evaluate(feature); } catch (Exception e) { throw new IllegalArgumentException( "Filter Function problem for function \"mbTypeOf\" argument #0 - expected type Object"); } return arg0.getClass().toString(); }