auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static EventFiringWebDriver getChromeInstance() { String chromeBinaryName; String OSName = System.getProperty("os.name").toUpperCase(); if (OSName.contains("WINDOWS")) { chromeBinaryName = "chromedriver.exe"; File chromeBinary = new File ( "." + File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "ChromeDriver" + File.separator + chromeBinaryName ); System.setProperty("webdriver.chrome.driver", chromeBinary.getAbsolutePath()); } if (browserName.equals("CHROMEMOBILE")) { chromeOptions.addArguments( "--user-agent=" + userAgentRegistry.getUserAgent("iPhone") ); return new EventFiringWebDriver(new ChromeDriver(chromeOptions)); } LoggingPreferences loggingprefs = new LoggingPreferences(); loggingprefs.enable(LogType.BROWSER, Level.SEVERE); caps.setCapability(CapabilityType.LOGGING_PREFS, loggingprefs); return new EventFiringWebDriver(new ChromeDriver(caps)); }

Target:
private static EventFiringWebDriver getChromeInstance() { String chromeBinaryName; String OSName = System.getProperty("os.name").toUpperCase(); if (OSName.contains("WINDOWS")) { chromeBinaryName = "chromedriver.exe"; File chromeBinary = new File ( "." + File.separator + "src" + File.separator + "test" + File.separator + "resources" + File.separator + "ChromeDriver" + File.separator + chromeBinaryName ); System.setProperty("webdriver.chrome.driver", chromeBinary.getAbsolutePath()); } if (browserName.equals("CHROMEMOBILE")) { chromeOptions.addArguments( "--user-agent=" + userAgentRegistry.getUserAgent("iPhone") ); return new EventFiringWebDriver(new ChromeDriver(chromeOptions)); } setBrowserLogging(Level.SEVERE); return new EventFiringWebDriver(new ChromeDriver(caps)); }
Source:
private HTTPEndpointManager() { super(); internalInboundPort = ConfigurationLoader.getInternalInboundPort(); if (internalInboundPort != -1) { internalAPIList = ConfigurationLoader.loadInternalAPIs(Constants.INTERNAL_APIS_FILE); internalAPIDispatcher = new InternalAPIDispatcher(internalAPIList); } }

Target:
private HTTPEndpointManager() { super(); internalInboundPort = ConfigurationLoader.getInternalInboundPort(); if (internalInboundPort != -1) { List<InternalAPI> internalAPIList = ConfigurationLoader.loadInternalAPIs(Constants.INTERNAL_APIS_FILE); internalAPIDispatcher = new InternalAPIDispatcher(internalAPIList); internalApiEnabled = internalAPIList != null && internalAPIList.isEmpty(); } }
Source:
private String getServiceFromVolumesFrom(String volumesFrom) throws IllegalArgumentException { String service = volumesFrom; if (volumesFrom != null) { String[] split = service.split(":"); if (split.length != 1 && split.length != 2) { throw new IllegalArgumentException(format("Service volumes_from '%s' is invalid", volumesFrom)); } service = split[0]; } return service; }

Target:
private String getServiceFromVolumesFrom(String volumesFrom) throws IllegalArgumentException { String service = volumesFrom; if (volumesFrom != null) { String[] split = service.split(":"); if (split.length > 2) { throw new IllegalArgumentException(format("Service volumes_from '%s' is invalid", volumesFrom)); } service = split[0]; } return service; }
Source:
private ListBoxValues createDefaultListBoxValues() { return new ListBoxValues(ComboBoxWidgetView.CUSTOM_PROMPT, "Edit" + " ", null); }

Target:
private ListBoxValues createDefaultListBoxValues() { return new ListBoxValues(ComboBoxWidgetView.CUSTOM_PROMPT, translationService.getValue(StunnerBPMNConstants.EDIT) + " ", null); }
Source:
private void renderDrafts(JsArray<CommentInfo> drafts) { List<CommentInfo> sorted = sortComment(drafts); for (CommentInfo info : sorted) { DisplaySide side; if (info.side() == Side.PARENT) { if (base != null) { continue; } side = DisplaySide.A; } else { side = drafts == draftsBase ? DisplaySide.A : DisplaySide.B; } DraftBox box = new DraftBox( this, getCmFromSide(side), side, commentLinkProcessor, getPatchSetIdFromSide(side), info); if (getPrefs().get().isExpandAllComments()) { box.setOpen(true); } if (publishedBase != null || publishedRevision != null) { PublishedBox replyToBox = publishedMap.get(info.in_reply_to()); if (replyToBox != null) { replyToBox.registerReplyBox(box); } } if (!info.has_line()) { diffTable.addFileCommentBox(box); continue; } lineActiveBoxMap.put( getCmFromSide(side).getLineHandle(info.line() - 1), box); addCommentBox(info, box); } }

Target:
private void renderDrafts(JsArray<CommentInfo> drafts) { List<CommentInfo> sorted = sortComment(drafts); for (CommentInfo info : sorted) { DisplaySide side; if (info.side() == Side.PARENT) { if (base != null) { continue; } side = DisplaySide.A; } else { side = drafts == draftsBase ? DisplaySide.A : DisplaySide.B; } DraftBox box = new DraftBox( this, getCmFromSide(side), side, commentLinkProcessor, getPatchSetIdFromSide(side), info); if (prefs.get().isExpandAllComments()) { box.setOpen(true); } if (publishedBase != null || publishedRevision != null) { PublishedBox replyToBox = publishedMap.get(info.in_reply_to()); if (replyToBox != null) { replyToBox.registerReplyBox(box); } } if (!info.has_line()) { diffTable.addFileCommentBox(box); continue; } lineActiveBoxMap.put( getCmFromSide(side).getLineHandle(info.line() - 1), box); addCommentBox(info, box); } }
Source:
public void prepare(KubernetesEnvironment k8sEnv, String workspaceId, long timeoutMillis) throws InfrastructureException { TracingTags.WORKSPACE_ID.set(workspaceId); if (EphemeralWorkspaceUtility.isEphemeral(k8sEnv.getAttributes())) { return; } if (k8sEnv.getPersistentVolumeClaims().isEmpty()) { return; } final KubernetesPersistentVolumeClaims k8sClaims = factory.create(workspaceId).persistentVolumeClaims(); LOG.debug("Creating PVCs for workspace '{}'", workspaceId); k8sClaims.createIfNotExist(k8sEnv.getPersistentVolumeClaims().values()); if (waitBound) { LOG.debug("Waiting PVCs for workspace '{}' to be bound", workspaceId); for (PersistentVolumeClaim pvc : k8sEnv.getPersistentVolumeClaims().values()) { k8sClaims.waitBound(pvc.getMetadata().getName(), timeoutMillis); } } LOG.debug("Preparing PVCs done for workspace '{}'", workspaceId); }

Target:
public void prepare(KubernetesEnvironment k8sEnv, String workspaceId, long timeoutMillis) throws InfrastructureException { TracingTags.WORKSPACE_ID.set(workspaceId); if (EphemeralWorkspaceUtility.isEphemeral(k8sEnv.getAttributes())) { return; } if (k8sEnv.getPersistentVolumeClaims().isEmpty()) { return; } final KubernetesPersistentVolumeClaims k8sClaims = factory.create(workspaceId).persistentVolumeClaims(); LOG.debug("Creating PVCs for workspace '{}'", workspaceId); k8sClaims.createIfNotExist(k8sEnv.getPersistentVolumeClaims().values()); if (waitBound) { LOG.debug("Waiting for PVC(s) of workspace '{}' to be bound", workspaceId); for (PersistentVolumeClaim pvc : k8sEnv.getPersistentVolumeClaims().values()) { k8sClaims.waitBound(pvc.getMetadata().getName(), timeoutMillis); } } LOG.debug("Preparing PVCs done for workspace '{}'", workspaceId); }
Source:
protected Comparator<Object[]> createSortComparator( final QueryContext context, final Columns columns ) { assert context != null; final Comparator<Location> typeComparator = Location.getComparator(); return new Comparator<Object[]>() { @Override public int compare( Object[] tuple1, Object[] tuple2 ) { int result = 0; for (String selectorName : columns.getSelectorNames()) { int locationIndex = columns.getLocationIndex(selectorName); Location value1 = (Location)tuple1[locationIndex]; Location value2 = (Location)tuple2[locationIndex]; result = typeComparator.compare(value1, value2); if (result != 0) return result; } return result; } }; }

Target:
protected Comparator<Object[]> createSortComparator( final QueryContext context, final Columns columns ) { assert context != null; final Comparator<Location> typeComparator = Location.getComparator(); final int[] locationIndexes = getLocationIndexes(columns); return new Comparator<Object[]>() { @Override public int compare( Object[] tuple1, Object[] tuple2 ) { int result = 0; for (int locationIndex : locationIndexes) { Location value1 = (Location)tuple1[locationIndex]; Location value2 = (Location)tuple2[locationIndex]; result = typeComparator.compare(value1, value2); if (result != 0) return result; } return result; } }; }
Source:
protected Stream<URL> listBundleComponents(Bundle bundle) { String list = OSGiRuntimeService.getComponentsList(bundle); String name = bundle.getSymbolicName(); log.debug("PartialBundle: " + name + " components: " + list); if (list == null) { return Stream.empty(); } else { return Arrays.stream(list.split("[, \t\n\r\f]")).map(bundle::getEntry).filter(Objects::nonNull); } }

Target:
protected Stream<URL> listBundleComponents(Bundle bundle) { String list = OSGiRuntimeService.getComponentsList(bundle); String name = bundle.getSymbolicName(); log.debug("PartialBundle: " + name + " components: " + list); if (list == null) { return Stream.empty(); } else { return Stream.of(list.split("[, \t\n\r\f]")).map(bundle::getEntry).filter(Objects::nonNull); } }
Source:
public void testIndependentZKConnections() throws IOException { try (ReadOnlyZKClient zk1 = REGISTRY.getZKClient()) { Configuration otherConf = new Configuration(TEST_UTIL.getConfiguration()); otherConf.set(HConstants.ZOOKEEPER_QUORUM, MiniZooKeeperCluster.HOST); try (ZKConnectionRegistry otherRegistry = new ZKConnectionRegistry(otherConf)) { ReadOnlyZKClient zk2 = otherRegistry.getZKClient(); assertNotSame("Using a different configuration / quorum should result in different " + "backing zk connection.", zk1, zk2); assertNotEquals( "Using a different configrution / quorum should be reflected in the zk connection.", zk1.getConnectString(), zk2.getConnectString()); } } finally { LOG.info("DONE!"); } }

Target:
public void testIndependentZKConnections() throws IOException { try (ReadOnlyZKClient zk1 = REGISTRY.getZKClient()) { Configuration otherConf = new Configuration(TEST_UTIL.getConfiguration()); otherConf.set(HConstants.ZOOKEEPER_QUORUM, MiniZooKeeperCluster.HOST); try (ZKConnectionRegistry otherRegistry = new ZKConnectionRegistry(otherConf)) { ReadOnlyZKClient zk2 = otherRegistry.getZKClient(); assertNotSame("Using a different configuration / quorum should result in " + "different backing zk connection.", zk1, zk2); assertNotEquals( "Using a different configrution / quorum should be reflected in the zk connection.", zk1.getConnectString(), zk2.getConnectString()); } } finally { LOG.info("DONE!"); } }
Source:
public void execute(Version version) { logger.info("Executing Mica upgrade to version 3.3.0"); setupDatasetOrders(); republishStudiesWithInvalidContent(); }

Target:
public void execute(Version version) { logger.info("Executing Mica upgrade to version 3.1.0"); setupDatasetOrders(); republishStudiesWithInvalidContent(); }
Source:
public void setUp() { MockitoAnnotations.initMocks(this); fakeTransport = new MockHttpTransport() { @Override public LowLevelHttpRequest buildRequest(String method, String url) throws IOException { return mockLowLevelRequest; } }; initializer = new RetryHttpInitializer(mockCredential, "foo-user-agent", HttpRequest.DEFAULT_NUMBER_OF_RETRIES, 20 * 1000, 20 * 1000, ImmutableMap .of("headerkey", "headervalue")); initializer.setSleeperOverride(mockSleeper); requestFactory = fakeTransport.createRequestFactory(initializer); }

Target:
public void setUp() { MockitoAnnotations.initMocks(this); fakeTransport = new MockHttpTransport() { @Override public LowLevelHttpRequest buildRequest(String method, String url) throws IOException { return mockLowLevelRequest; } }; initializer = new RetryHttpInitializer( mockCredential, "foo-user-agent", HttpRequest.DEFAULT_NUMBER_OF_RETRIES, 20_000, 20_000, ImmutableMap.of("header-key", "header=value")); initializer.setSleeperOverride(mockSleeper); requestFactory = fakeTransport.createRequestFactory(initializer); }
Source:
public Visitable defaultVisit(Visitable node) throws StandardException { DMLStatementNode rsn; if ((explain || LOG.isDebugEnabled()) && node instanceof DMLStatementNode && (((DMLStatementNode) node).getResultSetNode()) != null) { rsn = (DMLStatementNode) node; List<QueryTreeNode> orderedNodes = new ArrayList<>(); rsn.buildTree(orderedNodes,0); Map<String, Collection<QueryTreeNode>> m=planMap.get(); m.put(query,orderedNodes); if (LOG.isDebugEnabled()){ DataSetProcessorType currentType = rsn.getLanguageConnectionContext().getDataSetProcessorType(); currentType = currentType.combine(rsn.getCompilerContext().getDataSetProcessorType()); currentType = currentType.combine(determineSpark(orderedNodes)); Iterator<String> nodes = planToIterator(orderedNodes, currentType); StringBuilder sb = new StringBuilder(); while (nodes.hasNext()) sb.append(nodes.next()).append("\n"); LOG.info(String.format("Plan nodes for query <<\n\t%s\n>>%s\n", query,sb.toString())); } } explain = false; return node; }

Target:
public Visitable defaultVisit(Visitable node) throws StandardException { DMLStatementNode rsn; if ((explain || LOG.isDebugEnabled()) && node instanceof DMLStatementNode && (((DMLStatementNode) node).getResultSetNode()) != null) { rsn = (DMLStatementNode) node; List<QueryTreeNode> orderedNodes = new ArrayList<>(); rsn.buildTree(orderedNodes,0); Map<String, Collection<QueryTreeNode>> m=planMap.get(); m.put(query,orderedNodes); if (LOG.isDebugEnabled()){ DataSetProcessorType currentType = rsn.getCompilerContext().getDataSetProcessorType(); Iterator<String> nodes = planToIterator(orderedNodes, currentType); StringBuilder sb = new StringBuilder(); while (nodes.hasNext()) sb.append(nodes.next()).append("\n"); LOG.info(String.format("Plan nodes for query <<\n\t%s\n>>%s\n", query,sb.toString())); } } explain = false; return node; }
Source:
Optional<MetricPusher> create(MetricPusherCreator metricPusherCreator, Map<String, String> parameters) { Supplier<MetricPusher> metricPusherSupplier = () -> { try { return metricPusherCreator.create(parameters.get(METRIC_PUSHER_ADDRESS)); } catch (Exception e) { logger.error("MetricPusher creation failed."); e.printStackTrace(); return null; } }; return create(metricPusherSupplier); }

Target:
Optional<MetricPusher> create(MetricPusherCreator metricPusherCreator, Map<String, String> parameters) { Supplier<MetricPusher> metricPusherSupplier = () -> { try { return metricPusherCreator.create(parameters.get(METRIC_PUSHER_ADDRESS)); } catch (Exception e) { logger.error("MetricPusher creation failed.", e); return null; } }; return create(metricPusherSupplier); }
Source:
public JSONObject toJSONObject() { JSONObject mainObj = new JSONObject(); try { mainObj.put("androidNotificationId", androidNotificationId); if (groupedNotifications != null) { JSONArray payloadJsonArray = new JSONArray(); for (OSNotification notification : groupedNotifications) payloadJsonArray.put(notification.toJSONObject()); mainObj.put("groupedNotifications", payloadJsonArray); } JSONObject payload = new JSONObject(); payload.put("notificationID", notificationId); payload.put("title", title); payload.put("body", body); payload.put("smallIcon", smallIcon); payload.put("largeIcon", largeIcon); payload.put("bigPicture", bigPicture); payload.put("smallIconAccentColor", smallIconAccentColor); payload.put("launchURL", launchURL); payload.put("sound", sound); payload.put("ledColor", ledColor); payload.put("lockScreenVisibility", lockScreenVisibility); payload.put("groupKey", groupKey); payload.put("groupMessage", groupMessage); payload.put("fromProjectNumber", fromProjectNumber); payload.put("collapseId", collapseId); payload.put("priority", priority); if (additionalData != null) payload.put("additionalData", additionalData); if (actionButtons != null) { JSONArray actionButtonJsonArray = new JSONArray(); for (ActionButton actionButton : actionButtons) { actionButtonJsonArray.put(actionButton.toJSONObject()); } payload.put("actionButtons", actionButtonJsonArray); } payload.put("rawPayload", rawPayload); mainObj.put("payload", payload); } catch(JSONException e) { e.printStackTrace(); } return mainObj; }

Target:
public JSONObject toJSONObject() { JSONObject mainObj = new JSONObject(); try { mainObj.put("androidNotificationId", androidNotificationId); if (groupedNotifications != null) { JSONArray payloadJsonArray = new JSONArray(); for (OSNotification notification : groupedNotifications) payloadJsonArray.put(notification.toJSONObject()); mainObj.put("groupedNotifications", payloadJsonArray); } mainObj.put("notificationId", notificationId); mainObj.put("title", title); mainObj.put("body", body); mainObj.put("smallIcon", smallIcon); mainObj.put("largeIcon", largeIcon); mainObj.put("bigPicture", bigPicture); mainObj.put("smallIconAccentColor", smallIconAccentColor); mainObj.put("launchURL", launchURL); mainObj.put("sound", sound); mainObj.put("ledColor", ledColor); mainObj.put("lockScreenVisibility", lockScreenVisibility); mainObj.put("groupKey", groupKey); mainObj.put("groupMessage", groupMessage); mainObj.put("fromProjectNumber", fromProjectNumber); mainObj.put("collapseId", collapseId); mainObj.put("priority", priority); if (additionalData != null) mainObj.put("additionalData", additionalData); if (actionButtons != null) { JSONArray actionButtonJsonArray = new JSONArray(); for (ActionButton actionButton : actionButtons) { actionButtonJsonArray.put(actionButton.toJSONObject()); } mainObj.put("actionButtons", actionButtonJsonArray); } mainObj.put("rawPayload", rawPayload); } catch(JSONException e) { e.printStackTrace(); } return mainObj; }
Source:
private String readBlob(RevCommit commit, String string) throws MissingObjectException, IncorrectObjectTypeException, CorruptObjectException, IOException { TreeWalk tw = TreeWalk.forPath(db, string, commit.getTree()); if (tw == null) return null; ObjectReader or = db.getObjectDatabase().newReader(); ObjectId bId = tw.getObjectId(0); if (bId == null) return null; ObjectLoader ol = or.open(bId); ByteArrayOutputStream bos = new ByteArrayOutputStream(); ol.copyTo(bos); or.release(); return new String(bos.toByteArray(), "UTF-8"); }

Target:
private String readBlob(RevCommit commit, String string) throws MissingObjectException, IncorrectObjectTypeException, CorruptObjectException, IOException { TreeWalk tw = TreeWalk.forPath(db, string, commit.getTree()); if (tw == null) return null; ObjectId bId = tw.getObjectId(0); if (bId == null) return null; ObjectReader or = db.getObjectDatabase().newReader(); ObjectLoader ol = or.open(bId); ByteArrayOutputStream bos = new ByteArrayOutputStream(); ol.copyTo(bos); or.release(); return new String(bos.toByteArray(), "UTF-8"); }
Source:
public Trace getTrace(String tenantId, String id) { Trace ret = null; List<Trace> fragments = getFragmentsForTraceId(tenantId, id); if (!fragments.isEmpty()) { ret = fragments.stream().filter(f -> f.getTraceId().equals(id)).findFirst().get(); for (int i=0; ret != null && i < ret.getNodes().size(); i++) { Node node = ret.getNodes().get(i); processConnectedNode(fragments, ret, node, new StringBuilder(ret.getFragmentId()).append(':').append(i)); } } if (msgLog.isTraceEnabled()) { msgLog.tracef("Get trace with id[%s] is: %s", id, ret); } if (ret == null && spanService != null) { ret = spanService.getTrace(tenantId, id); } return ret; }

Target:
public Trace getTrace(String tenantId, String id) { List<Trace> fragments = getFragmentsForTraceId(tenantId, id); Trace ret = fragments.stream().filter(f -> f.getTraceId().equals(id)).findFirst().orElse(null); if (ret != null) { for (int i=0; i < ret.getNodes().size(); i++) { Node node = ret.getNodes().get(i); processConnectedNode(fragments, ret, node, new StringBuilder(ret.getFragmentId()).append(':').append(i)); } } else if (spanService != null) { ret = spanService.getTrace(tenantId, id); } if (msgLog.isTraceEnabled()) { msgLog.tracef("Get trace with id[%s] is: %s", id, ret); } return ret; }
Source:
static CqlClient create( TaggedMetricRegistry taggedMetricRegistry, Supplier<CqlSession> cqlSessionSupplier, int preparedStatementCacheSize) { CqlSession cqlSession = cqlSessionSupplier.get(); CachingStatementPreparer cachingStatementPreparer = CachingStatementPreparer.create( key -> cqlSession.prepare(key.formatQueryString()), taggedMetricRegistry, preparedStatementCacheSize); return new CqlClientImpl(cqlSession, cachingStatementPreparer); }

Target:
private static CqlClient create( TaggedMetricRegistry taggedMetricRegistry, Supplier<CqlSession> cqlSessionSupplier, int preparedStatementCacheSize) { CqlSession cqlSession = cqlSessionSupplier.get(); CachingStatementPreparer cachingStatementPreparer = CachingStatementPreparer.create( key -> cqlSession.prepare(key.formatQueryString()), taggedMetricRegistry, preparedStatementCacheSize); return new CqlClientImpl(cqlSession, cachingStatementPreparer); }
Source:
protected boolean shouldUpdateBroadcast(Broadcast broadcast) { return broadcast.getTransmissionEndTime() .isAfter(DateTime.now().minusDays(MAX_BROADCAST_AGE_IN_DAYS_TO_UPDATE)); }

Target:
protected boolean shouldUpdateBroadcast(Broadcast broadcast) { return broadcast.getTransmissionEndTime() .isAfter(clock.now().minus(MAX_BROADCAST_AGE_TO_UPDATE)); }
Source:
public void sendJobCompletionEvent(final JobCompletionEventArgs args) throws IOException { final QueryString qs = new QueryString( API_VERSION, "3.0-preview.1", "publisherId", "jenkins", "channelId", args.getServerKey()); final URI requestUri = UriHelper.join( collectionUri, "_apis", "public", "hooks", "externalEvents", qs); final JSONObject json = JSONObject.fromObject(args.getPayload()); final NameValuePair[] headers = new NameValuePair[3]; headers[0] = new NameValuePair("X-Event-Key", "job:completion"); headers[1] = new NameValuePair("X-Jenkins-Signature", args.getPayloadSignature()); headers[2] = new NameValuePair("X-Jenkins-ServerKey", args.getServerKey()); request(Void.class, HttpMethod.POST, requestUri, json, headers); }

Target:
public void sendJobCompletionEvent(final JobCompletionEventArgs args) throws IOException { final QueryString qs = new QueryString( API_VERSION, "3.2", "publisherId", "jenkins", "channelId", args.getServerKey()); final URI requestUri = UriHelper.join( collectionUri, "_apis", "public", "hooks", "externalEvents", qs); final JSONObject json = JSONObject.fromObject(args.getPayload()); final NameValuePair[] headers = new NameValuePair[3]; headers[0] = new NameValuePair("X-Event-Key", "job:completion"); headers[1] = new NameValuePair("X-Jenkins-Signature", args.getPayloadSignature()); headers[2] = new NameValuePair("X-Jenkins-ServerKey", args.getServerKey()); request(Void.class, HttpMethod.POST, requestUri, json, headers); }
Source:
public void run() { while (execute) { try { long startTs = System.currentTimeMillis(); if ((isPollable && !isPolled) || !isPollable) { pollRecords(ps); } long endTs = System.currentTimeMillis(); long ioTime = endTs - startTs; long sleepTime = pollInterval - ioTime; LOG.debug("pollInterval = " + pollInterval + " I/O time = " + ioTime + " sleepTime = " + sleepTime); Thread.sleep(sleepTime > 0 ? sleepTime : 0); } catch (Exception ex) { cause.set(ex); execute = false; } } }

Target:
public void run() { while (execute) { try { long startTs = System.currentTimeMillis(); if ((isPollable && !isPolled) || !isPollable) { pollRecords(ps); } long endTs = System.currentTimeMillis(); long ioTime = endTs - startTs; long sleepTime = pollInterval - ioTime; LOG.debug("pollInterval = , I/O time = , sleepTime = {}", pollInterval, ioTime, sleepTime); Thread.sleep(sleepTime > 0 ? sleepTime : 0); } catch (Exception ex) { cause.set(ex); execute = false; } } }
Source:
public Optional<PatchLineComment> get(ReviewDb db, ChangeNotes notes, PatchLineComment.Key key) throws OrmException { if (!migration.readComments()) { return Optional.of(db.patchComments().get(key)); } for (PatchLineComment c : byChange(db, notes)) { if (key.equals(c.getKey())) { return Optional.of(c); } } return Optional.absent(); }

Target:
public Optional<PatchLineComment> get(ReviewDb db, ChangeNotes notes, PatchLineComment.Key key) throws OrmException { if (!migration.readComments()) { return Optional.fromNullable(db.patchComments().get(key)); } for (PatchLineComment c : byChange(db, notes)) { if (key.equals(c.getKey())) { return Optional.of(c); } } return Optional.absent(); }
Source:
public void updateSearchResultSet( String outputName, DimensionSelector selector, SearchQuerySpec searchQuerySpec, int limit, final Object2IntRBTreeMap<SearchHit> set ) { if (selector == null) { return; } if (selector.nameLookupPossibleInAdvance() && selector.getValueCardinality() == 1 && selector.lookupName(0) == null) { return; } final IndexedInts vals = selector.getRow(); for (int i = 0; i < vals.size(); ++i) { final String dimVal = selector.lookupName(vals.get(i)); if (searchQuerySpec.accept(dimVal)) { set.addTo(new SearchHit(outputName, Strings.nullToEmpty(dimVal)), 1); if (set.size() >= limit) { return; } } } }

Target:
public void updateSearchResultSet( String outputName, DimensionSelector selector, SearchQuerySpec searchQuerySpec, int limit, final Object2IntRBTreeMap<SearchHit> set ) { if (selector != null && !isNilSelector(selector)) { final IndexedInts vals = selector.getRow(); for (int i = 0; i < vals.size(); ++i) { final String dimVal = selector.lookupName(vals.get(i)); if (searchQuerySpec.accept(dimVal)) { set.addTo(new SearchHit(outputName, Strings.nullToEmpty(dimVal)), 1); if (set.size() >= limit) { return; } } } } }
Source:
public static void main(String[] args) { KeyVaultBackupClient backupClient = new KeyVaultBackupClientBuilder() .vaultUrl("https://{YOUR_VAULT_NAME}.vault.azure.net") .credential(new DefaultAzureCredentialBuilder().build()) .buildClient(); String keyName = "<key-name>"; String blobStorageUrl = "<blob-storage-url>"; String sasToken = "<sas-token>"; String folderName = "<folder-name>"; SyncPoller<KeyVaultRestoreOperation, Void> restorePoller = backupClient.beginSelectiveRestore(keyName, blobStorageUrl, sasToken, folderName); }

Target:
public static void main(String[] args) { KeyVaultBackupClient backupClient = new KeyVaultBackupClientBuilder() .vaultUrl("https://{YOUR_VAULT_NAME}.vault.azure.net") .credential(new DefaultAzureCredentialBuilder().build()) .buildClient(); String keyName = "<key-name>"; String backupFolderUrl = "<backup-folder-url>"; String sasToken = "<sas-token>"; SyncPoller<KeyVaultRestoreOperation, Void> restorePoller = backupClient.beginSelectiveRestore(keyName, backupFolderUrl, sasToken); restorePoller.waitForCompletion(); }
Source:
public Set<Guid> getDisksNotInPreviousCheckpoint() { List<DiskImage> checkpointDisks = vmCheckpointDao.getDisksByCheckpointId(getParameters().getVmBackup().getFromCheckpointId()); Set<Guid> vmCheckpointDisksIds = checkpointDisks .stream() .map(DiskImage::getId) .collect(Collectors.toCollection(HashSet::new)); return getDiskIds().stream() .distinct() .filter(diskId -> !vmCheckpointDisksIds.contains(diskId)) .collect(Collectors.toSet()); }

Target:
public Set<Guid> getDisksNotInPreviousCheckpoint() { List<DiskImage> checkpointDisks = vmCheckpointDao.getDisksByCheckpointId(getParameters().getVmBackup().getFromCheckpointId()); Set<Guid> vmCheckpointDisksIds = checkpointDisks .stream() .map(DiskImage::getId) .collect(Collectors.toCollection(HashSet::new)); return getDiskIds().stream() .filter(diskId -> !vmCheckpointDisksIds.contains(diskId)) .collect(Collectors.toSet()); }
Source:
public void handle(Long minToken, Long maxToken, CObjectTokenVisitor visitor, Integer partitionId) { visitor.setUp(); List<Map<String, Object>> results = executeStatement(objectType, minToken, maxToken, batchSize); while(results != null && results.size() > 0) { visitResults(results, visitor); String minUuid = String.valueOf(results.get(results.size() - 1).get("id")); results = executeStatement(objectType, minUuid, maxToken, batchSize); } if (this.savepointWriters != null) { this.savepointWriters[partitionId].append(maxToken.toString()); this.savepointWriters[partitionId].append("\n"); } visitor.cleanUp(); shutdownLatch.countDown(); }

Target:
public void handle(Long minToken, Long maxToken, CObjectTokenVisitor visitor, Integer partitionId) { visitor.setUp(); List<Map<String, Object>> results = executeStatement(objectType, minToken, maxToken, batchSize); while(results != null && results.size() > 0) { visitResults(results, visitor); String minUuid = String.valueOf(results.get(results.size() - 1).get("id")); results = executeStatement(objectType, minUuid, maxToken, batchSize); if (this.savepointWriters != null) { this.savepointWriters[partitionId].append(minUuid); this.savepointWriters[partitionId].append("\n"); } } visitor.cleanUp(); shutdownLatch.countDown(); }
Source:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_login, container, false); textView = (TextView)view.findViewById(R.id.textView1); final Button button = (Button)view.findViewById(R.id.buttonLogin); button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { buttonClicked(v); } }); if (mResult != null && mResult.getUserInfo() != null && mResult.getUserInfo().getDisplayableId() != null) { textView.setText(mResult.getUserInfo().getDisplayableId()); button.setText("LogOut"); } return view; }

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_login, container, false); textView = (TextView)view.findViewById(R.id.textView1); final Button button = (Button)view.findViewById(R.id.buttonLogin); button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { buttonClicked(v); } }); if (mResult != null && mResult.getUserInfo() != null && mResult.getUserInfo().getDisplayableId() != null) { textView.setText(mResult.getUserInfo().getDisplayableId()); } return view; }
Source:
public void releaseWhenCompositeCumulateThrows() { final Error error = new Error(); ByteBuf cumulation = new CompositeByteBuf(UnpooledByteBufAllocator.DEFAULT, false, 64) { @Override public CompositeByteBuf addComponent(boolean increaseWriterIndex, ByteBuf buffer) { throw error; } }; cumulation.writeByte(1); ByteBuf in = Unpooled.buffer().writeZero(12); try { ByteToMessageDecoder.COMPOSITE_CUMULATOR.cumulate(UnpooledByteBufAllocator.DEFAULT, cumulation, in); fail(); } catch (Error expected) { assertSame(error, expected); assertEquals(0, in.refCnt()); } }

Target:
public void releaseWhenCompositeCumulateThrows() { final Error error = new Error(); ByteBuf cumulation = new CompositeByteBuf(UnpooledByteBufAllocator.DEFAULT, false, 64) { @Override public CompositeByteBuf addComponent(boolean increaseWriterIndex, ByteBuf buffer) { throw error; } }; cumulation.writeByte(1); ByteBuf in = Unpooled.buffer().writeZero(12); try { COMPOSITE_CUMULATOR.cumulate(UnpooledByteBufAllocator.DEFAULT, cumulation, in); fail(); } catch (Error expected) { assertSame(error, expected); assertEquals(0, in.refCnt()); } }
Source:
public void closesPullRequestForRebaseMode() throws Exception { final Repo repo = new MkGithub().randomRepo(); final Issue issue = repo.issues().create("", ""); final Profile profile = new Profile.Fixed( new XMLDocument( StringUtils.join( "<p><entry key='merge'>", "<entry key='rebase'>true</entry>", "</entry></p>" ) ) ); final Agent agent = new ClosePullRequest(profile, repo.github()); final Talk talk = ClosePullRequestTest.createTalk(repo, issue); agent.execute(talk); MatcherAssert.assertThat( new Issue.Smart(issue).state(), Matchers.is("closed") ); }

Target:
public void closesPullRequestForRebaseMode() throws Exception { final Repo repo = new MkGithub().randomRepo(); final Issue issue = repo.issues().create("", ""); final Profile profile = new Profile.Fixed( new XMLDocument( StringUtils.join( "<p><entry key='merge'>", "<entry key='rebase'>true</entry>", "</entry></p>" ) ) ); final Talk talk = ClosePullRequestTest.talk(repo, issue); new ClosePullRequest(profile, repo.github()).execute(talk); final Issue.Smart smart = new Issue.Smart(issue); MatcherAssert.assertThat( smart.state(), Matchers.is("closed") ); MatcherAssert.assertThat( new Comment.Smart(smart.comments().get(1)).body(), Matchers.containsString( StringUtils.join( "Rultor closed this pull request for you because your ", ".rultor.yml specified the use of rebasing before ", "merging. GitHub does not mark rebased pull requests as ", "merged, because rebasing entails a change in commit ", "hashes. Nevertheless all your files have been merged ", "exactly as they would have been merged without the ", "rebase option set." ) ) ); }
Source:
public void deleteVNFRecord(String idNsr, String idVnf, String projectId) throws NotFoundException { NetworkServiceRecord nsr = nsrRepository.findFirstById(idNsr); if (nsr == null) throw new NotFoundException("No NSR found with ID: " + idNsr); if (!nsr.getProjectId().equals(projectId)) { throw new UnauthorizedUserException( "NSR not under the project chosen, are you trying to hack us? Just kidding, it's a bug :)"); } VirtualNetworkFunctionRecord vnfr = vnfrRepository.findOne(idVnf); if (vnfr == null) throw new NotFoundException("No VNFR found with ID: " + idVnf); if (!vnfr.getProjectId().equals(projectId)) throw new UnauthorizedUserException("VNFR not contained in the chosen project."); nsrRepository.deleteVNFRecord(idNsr, idVnf); }

Target:
public void deleteVNFRecord(String idNsr, String idVnf, String projectId) throws NotFoundException { NetworkServiceRecord nsr = nsrRepository.findFirstById(idNsr); if (nsr == null) throw new NotFoundException("No NSR found with ID: " + idNsr); if (!nsr.getProjectId().equals(projectId)) { throw new UnauthorizedUserException( "NSR not under the project chosen, are you trying to hack us? Just kidding, it's a bug :)"); } VirtualNetworkFunctionRecord vnfr = vnfrRepository.findOne(idVnf); if (vnfr == null) throw new NotFoundException("No VNFR found with ID: " + idVnf); if (!vnfr.getParent_ns_id().equals(idNsr)) throw new NotFoundException("Not found VNFR " + idVnf + " in the given NSR " + idNsr); if (!vnfr.getProjectId().equals(projectId)) throw new UnauthorizedUserException("VNFR not contained in the chosen project."); nsrRepository.deleteVNFRecord(idNsr, idVnf); }
Source:
private static List<Type> listSupertypes(Type... types) { List<Type> supertypes = new ArrayList<Type>(); List<Type> next = new ArrayList<Type>(); Collections.addAll(next, types); while (!next.isEmpty()) { Type type = next.remove(0); for (Type sType : Type.byName.values()) { if (type.subTypes.contains(type)) { supertypes.add(sType); next.add(sType); } } } return supertypes; }

Target:
private static Collection<Type> listSupertypes(Type... types) { Set<Type> supertypes = new HashSet<Type>(); Deque<Type> next = new ArrayDeque<Type>(); Collections.addAll(next, types); while (!next.isEmpty()) { Type type = next.remove(); for (Type sType : Type.byName.values()) { if (type.subTypes.contains(type) && supertypes.add(sType)) next.add(sType); } } return supertypes; }
Source:
public void testUpdateTag(){ ArrayList<TagObject> tagList = mProductBacklogMapper.getTagList(); for(int listIndex = 0; listIndex < tagList.size(); listIndex++){ assertEquals(listIndex+1, tagList.get(listIndex).getId()); assertEquals(TEST_TAG_NAME+Integer.toString(listIndex+1), tagList.get(listIndex).getName()); } for(int listIndex = 0; listIndex < tagList.size(); listIndex++){ mMantisTagService.updateTag(tagList.get(listIndex).getId(), "TEST_UPDATE_TAG_"+Integer.toString(listIndex+1),mCP.getProjectList().get(0).getName()); } tagList = mProductBacklogMapper.getTagList(); for(int listIndex = 0; listIndex < tagList.size(); listIndex++){ assertEquals("TEST_UPDATE_TAG_"+Integer.toString(listIndex+1), tagList.get(listIndex).getName()); } }

Target:
public void testUpdateTag(){ ArrayList<TagObject> tags = mProductBacklogMapper.getTagList(); for(int listIndex = 0; listIndex < tags.size(); listIndex++){ assertEquals(listIndex+1, tags.get(listIndex).getId()); assertEquals(TEST_TAG_NAME+Integer.toString(listIndex+1), tags.get(listIndex).getName()); } for(int listIndex = 0; listIndex < tags.size(); listIndex++){ mMantisTagService.updateTag(tags.get(listIndex).getId(), "TEST_UPDATE_TAG_"+Integer.toString(listIndex+1),mCP.getProjectList().get(0).getName()); } tags = mProductBacklogMapper.getTagList(); for(int listIndex = 0; listIndex < tags.size(); listIndex++){ assertEquals("TEST_UPDATE_TAG_"+Integer.toString(listIndex+1), tags.get(listIndex).getName()); } }
Source:
public void selectCellIfRequired(final int uiRowIndex, final int uiColumnIndex, final GridWidget gridWidget, final boolean isShiftKeyDown, final boolean isControlKeyDown) { GridWidget _gridWidget = gridWidget; int _uiRowIndex = uiRowIndex; int _uiColumnIndex = uiColumnIndex; if (_gridWidget instanceof LiteralExpressionGrid) { final LiteralExpressionGrid grid = (LiteralExpressionGrid) _gridWidget; _gridWidget = grid.getParentInformation().getGridWidget(); _uiRowIndex = grid.getParentInformation().getRowIndex(); _uiColumnIndex = grid.getParentInformation().getColumnIndex(); } else if (_gridWidget instanceof UndefinedExpressionGrid) { final UndefinedExpressionGrid grid = (UndefinedExpressionGrid) _gridWidget; _gridWidget = grid.getParentInformation().getGridWidget(); _uiRowIndex = grid.getParentInformation().getRowIndex(); _uiColumnIndex = grid.getParentInformation().getColumnIndex(); } final int rowIndex = _uiRowIndex; final GridData gridData = _gridWidget.getModel(); final GridColumn<?> column = gridData.getColumns().get(_uiColumnIndex); final Stream<SelectedCell> modelColumnSelectedCells = gridData.getSelectedCells().stream().filter(sc -> sc.getColumnIndex() == column.getIndex()); final boolean isContextMenuCellSelectedCell = modelColumnSelectedCells.map(SelectedCell::getRowIndex).anyMatch(ri -> ri == rowIndex); if (!isContextMenuCellSelectedCell) { selectCell(_uiRowIndex, _uiColumnIndex, _gridWidget, isShiftKeyDown, isControlKeyDown); } }

Target:
public void selectCellIfRequired(final int uiRowIndex, final int uiColumnIndex, final GridWidget gridWidget, final boolean isShiftKeyDown, final boolean isControlKeyDown) { GridWidget _gridWidget = gridWidget; int _uiRowIndex = uiRowIndex; int _uiColumnIndex = uiColumnIndex; if (_gridWidget instanceof LiteralExpressionGrid || _gridWidget instanceof UndefinedExpressionGrid) { final BaseExpressionGrid grid = (BaseExpressionGrid) _gridWidget; _gridWidget = grid.getParentInformation().getGridWidget(); _uiRowIndex = grid.getParentInformation().getRowIndex(); _uiColumnIndex = grid.getParentInformation().getColumnIndex(); } final int rowIndex = _uiRowIndex; final GridData gridData = _gridWidget.getModel(); final GridColumn<?> column = gridData.getColumns().get(_uiColumnIndex); final Stream<SelectedCell> modelColumnSelectedCells = gridData.getSelectedCells().stream().filter(sc -> sc.getColumnIndex() == column.getIndex()); final boolean isContextMenuCellSelectedCell = modelColumnSelectedCells.map(SelectedCell::getRowIndex).anyMatch(ri -> ri == rowIndex); if (!isContextMenuCellSelectedCell) { selectCell(_uiRowIndex, _uiColumnIndex, _gridWidget, isShiftKeyDown, isControlKeyDown); } }
Source:
public void logCheckedExceptionAsError(LogLevel logLevelToConfigure, boolean logContainsMessage, boolean logContainsStackTrace) { String exceptionMessage = "An exception message"; IOException ioException = createIOException(exceptionMessage); String originalLogLevel = setupLogLevel(logLevelToConfigure.getLogLevel()); try { throw new ClientLogger(ClientLoggerTests.class).logCheckedExceptionAsError(ioException); } catch (Throwable throwable) { assertTrue(throwable instanceof IOException); } setPropertyToOriginalOrClear(originalLogLevel); String logValues = new String(logCaptureStream.toByteArray(), StandardCharsets.UTF_8); assertEquals(logContainsMessage, logValues.contains(exceptionMessage + System.lineSeparator())); assertEquals(logContainsStackTrace, logValues.contains(ioException.getStackTrace()[0].toString())); }

Target:
public void logCheckedExceptionAsError(LogLevel logLevelToConfigure, boolean logContainsMessage, boolean logContainsStackTrace) { String exceptionMessage = "An exception message"; IOException ioException = createIOException(exceptionMessage); String originalLogLevel = setupLogLevel(logLevelToConfigure.getLogLevel()); try { throw new ClientLogger(ClientLoggerTests.class).logThrowableAsError(ioException); } catch (Throwable throwable) { assertTrue(throwable instanceof IOException); } setPropertyToOriginalOrClear(originalLogLevel); String logValues = new String(logCaptureStream.toByteArray(), StandardCharsets.UTF_8); assertEquals(logContainsMessage, logValues.contains(exceptionMessage + System.lineSeparator())); assertEquals(logContainsStackTrace, logValues.contains(ioException.getStackTrace()[0].toString())); }
Source:
private boolean pingLeader() { Optional<PingableLeader> maybeLeader = getSuspectedLeader(true ); if (!maybeLeader.isPresent()) { return false; } final PingableLeader leader = maybeLeader.get(); final HostAndPort leaderName = potentialLeadersToHosts.get(leader); CompletionService<Boolean> pingCompletionService = new ExecutorCompletionService<Boolean>( executor); pingCompletionService.submit(new Callable<Boolean>() { @Override public Boolean call() throws Exception { leaderLog.trace("Pinging suspected leader " + leaderName); return leader.ping(); } }); try { Future<Boolean> pingFuture = pingCompletionService.poll( leaderPingResponseWaitMs, TimeUnit.MILLISECONDS); if (pingFuture != null) { if (pingFuture.get()) { leaderLog.trace("Successfully pinged " + leaderName); return true; } else { leaderLog.info("Pinged " + leaderName + " and it reported that it is no longer the leader"); return false; } } else { leaderLog.warn("Timed out pinging " + leaderName + " after " + leaderPingResponseWaitMs + "ms"); return false; } } catch (InterruptedException e) { leaderLog.warn("Interrupted while pinging " + leaderName); log.warn("Interrupted while pinging " + leaderName); return false; } catch (ExecutionException e) { log.warn("Cannot ping " + leaderName, e); leaderLog.warn("Cannot ping " + leaderName, e); return false; } }

Target:
private boolean pingLeader() { Optional<PingableLeader> maybeLeader = getSuspectedLeader(true ); if (!maybeLeader.isPresent()) { return false; } final PingableLeader leader = maybeLeader.get(); final HostAndPort leaderName = potentialLeadersToHosts.get(leader); CompletionService<Boolean> pingCompletionService = new ExecutorCompletionService<Boolean>( executor); pingCompletionService.submit(new Callable<Boolean>() { @Override public Boolean call() throws Exception { leaderLog.trace("Pinging suspected leader " + leaderName); return leader.ping(); } }); try { Future<Boolean> pingFuture = pingCompletionService.poll( leaderPingResponseWaitMs, TimeUnit.MILLISECONDS); if (pingFuture == null) { leaderLog.warn("Timed out pinging after ms", leaderName, leaderPingResponseWaitMs); return false; } else if (pingFuture.get()) { leaderLog.trace("Successfully pinged {}", leaderName); return true; } else { leaderLog.info("Pinged and it reported that it is no longer the leader", leaderName); return false; } } catch (InterruptedException e) { log.warn("Interrupted while pinging {}", leaderName); leaderLog.warn("Interrupted while pinging {}", leaderName); return false; } catch (ExecutionException e) { log.warn("Cannot ping {}", leaderName, e); leaderLog.warn("Cannot ping {}", leaderName, e); return false; } }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Mapbox.getInstance(this, getString(R.string.access_token)); setContentView(R.layout.activity_javaservices_directions); mapView = findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(new OnMapReadyCallback() { @Override public void onMapReady(@NonNull MapboxMap mapboxMap) { DirectionsActivity.this.mapboxMap = mapboxMap; mapboxMap.setStyle(Style.MAPBOX_STREETS, new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { origin = Point.fromLngLat(-3.588098, 37.176164); destination = Point.fromLngLat(-3.601845, 37.184080); initSource(); initLayers(); getRoute(origin, destination); } }); } }); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Mapbox.getInstance(this, getString(R.string.access_token)); setContentView(R.layout.activity_javaservices_directions); mapView = findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(new OnMapReadyCallback() { @Override public void onMapReady(@NonNull MapboxMap mapboxMap) { DirectionsActivity.this.mapboxMap = mapboxMap; mapboxMap.setStyle(Style.MAPBOX_STREETS, new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { origin = Point.fromLngLat(-3.588098, 37.176164); destination = Point.fromLngLat(-3.601845, 37.184080); initSource(style); initLayers(style); getRoute(style, origin, destination); } }); } }); }
Source:
protected <E> Long remove( final E entity ) throws BackendlessException { if( entity == null ) throw new IllegalArgumentException( ExceptionMessage.NULL_ENTITY ); Map<String, Object> entityMap = BackendlessSerializer.serializeToMap( entity ); if( !entityMap.containsKey( "objectId" ) ) { String objectIdFromFootprints = FootprintsManager.getInstance().getObjectId( entity ); if( objectIdFromFootprints != null ) entityMap.put( "objectId", objectIdFromFootprints ); } Object result = Invoker.invokeSync( PERSISTENCE_MANAGER_SERVER_ALIAS, "remove", new Object[] { Backendless.getApplicationId(), Backendless.getVersion(), getSimpleName( entity.getClass() ), entityMap } ); FootprintsManager.getInstance().Inner.removeFootprintForObject( entityMap, entity ); return ((Number) result).longValue(); }

Target:
protected <E> Long remove( final E entity ) throws BackendlessException { if( entity == null ) throw new IllegalArgumentException( ExceptionMessage.NULL_ENTITY ); Map<String, Object> entityMap = BackendlessSerializer.serializeToMap( entity ); FootprintsManager.getInstance().Inner.putMissingPropsToEntityMap( entity, entityMap ); Object result = Invoker.invokeSync( PERSISTENCE_MANAGER_SERVER_ALIAS, "remove", new Object[] { Backendless.getApplicationId(), Backendless.getVersion(), getSimpleName( entity.getClass() ), entityMap } ); FootprintsManager.getInstance().Inner.removeFootprintForObject( entityMap, entity ); return ((Number) result).longValue(); }
Source:
public void setUp() { super.setUp(); Properties consumerDeserializerProperties = new Properties(); consumerDeserializerProperties.setProperty("key.deserializer", DEFAULT_DESERIALIZER); consumerDeserializerProperties.setProperty("value.deserializer", DEFAULT_DESERIALIZER); producer = TestUtils.createNewProducer( bootstrapServers(), 1, 60 * 1000L, 1024L * 1024L, 0, 0L, 5 * 1000L, SecurityProtocol.PLAINTEXT, null, Option$.MODULE$.<Properties>apply(new Properties()), new StringSerializer(), new StringSerializer(), Option$.MODULE$.<Properties>apply(new Properties())); consumer = TestUtils.createNewConsumer( bootstrapServers(), "group", "earliest", 4096L, "org.apache.kafka.clients.consumer.RangeAssignor", 30000, SecurityProtocol.PLAINTEXT, Option$.MODULE$.<File>empty(), Option$.MODULE$.<Properties>empty(), Option$.MODULE$.<Properties>apply(consumerDeserializerProperties)); }

Target:
public void setUp() { super.setUp(); Properties consumerDeserializerProperties = new Properties(); consumerDeserializerProperties.setProperty("key.deserializer", DEFAULT_DESERIALIZER); consumerDeserializerProperties.setProperty("value.deserializer", DEFAULT_DESERIALIZER); producer = TestUtils.createNewProducer( bootstrapServers(), 1, 60 * 1000L, 1024L * 1024L, 0, 0L, 5 * 1000L, SecurityProtocol.PLAINTEXT, null, Option.apply(new Properties()), new StringSerializer(), new StringSerializer(), Option.apply(new Properties())); consumer = TestUtils.createNewConsumer( bootstrapServers(), "group", "earliest", 4096L, "org.apache.kafka.clients.consumer.RangeAssignor", 30000, SecurityProtocol.PLAINTEXT, Option$.MODULE$.<File>empty(), Option$.MODULE$.<Properties>empty(), Option$.MODULE$.<Properties>apply(consumerDeserializerProperties)); }