auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private Model createModel(){ Model model = new Model(); model.setArtifactId("temp-project"); model.setVersion("1.0"); model.setGroupId("org.temp"); model.setPackaging("pom"); model.setModelVersion("4.0.0"); return model; }

Target:
private Model createModel(){ Model model = new Model(); model.setArtifactId(String.format("openmrs-sdk-server-%s", serverId)); model.setVersion("1.0.0-SNAPSHOT"); model.setGroupId("org.openmrs"); model.setPackaging("pom"); model.setModelVersion("4.0.0"); return model; }
Source:
private void validateDuplicateAgents(ValidationContext validationContext) { ArrayList<String> allAgents = new ArrayList<>(); for (EnvironmentConfig part : this) { for (EnvironmentAgentConfig agent : part.getAgents()) { if (allAgents.contains(agent.getUuid())) { String message = String.format("Environment agent '%s' is defined more than once.", agent.getUuid()); configErrors.add("pipeline", message); } else { allAgents.add(agent.getUuid()); } } } }

Target:
private void validateDuplicateAgents(ValidationContext validationContext) { ArrayList<String> allAgents = new ArrayList<>(); for (EnvironmentConfig part : this) { for (EnvironmentAgentConfig agent : part.getAgents()) { if (allAgents.contains(agent.getUuid())) { String message = String.format("Environment agent '%s' is defined more than once.", agent.getUuid()); configErrors.add("agent", message); } else { allAgents.add(agent.getUuid()); } } } }
Source:
private ValidationResult validateHostIsReadyToRun(final VDS vds, StringBuilder sb, boolean isMigrate) { sb.append(" VDS ").append(vds.getvds_name()).append(" ").append(vds.getId()).append(" "); if (!AttestationCacheManager.exists(vds.gethost_name())){ AttestationValue newValue = new AttestationValue(); newValue.setHostName(vds.gethost_name()); newValue.setTrustLevel(AttestationResult.UNKNOWN); AttestationCacheManager.addToCache(newValue); } for(HostValidator validator : this.hostValidators) { VdcBllMessages result = validator.validate(vds, sb, isMigrate); if(result != null) { return new ValidationResult(result); } } return ValidationResult.VALID; }

Target:
private ValidationResult validateHostIsReadyToRun(final VDS vds, StringBuilder sb, boolean isMigrate) { sb.append(" VDS ").append(vds.getvds_name()).append(" ").append(vds.getId()).append(" "); if (!AttestationCacheManager.exists(vds.gethost_name())) { AttestationValue newValue = new AttestationValue(); newValue.setHostName(vds.gethost_name()); newValue.setTrustLevel(AttestationResult.UNKNOWN); AttestationCacheManager.addToCache(newValue); } if (privateVm.isTrustedHostFlag() == true) { hostValidators.add(new HostValidator() { @Override public VdcBllMessages validate(VDS vds, StringBuilder sb, boolean isMigrate) { if (AttestationService.getInstance().validateHostIsTrusted(vds) != AttestationResultEnum.TRUSTED) { sb.append("have failed running this VM in a trusted host"); return VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CLUSTER; } return null; } }); } for(HostValidator validator : this.hostValidators) { VdcBllMessages result = validator.validate(vds, sb, isMigrate); if(result != null) { return new ValidationResult(result); } } return ValidationResult.VALID; }
Source:
public static byte[] serializeAuthorizerRoleMap(ObjectMapper objectMapper, Map<String, BasicAuthorizerRole> roleMap) { try { return objectMapper.writeValueAsBytes(roleMap); } catch (IOException ioe) { throw new ISE("WTF? Couldn't serialize roleMap!"); } }

Target:
public static byte[] serializeAuthorizerRoleMap(ObjectMapper objectMapper, Map<String, BasicAuthorizerRole> roleMap) { try { return objectMapper.writeValueAsBytes(roleMap); } catch (IOException ioe) { throw new ISE(ioe, "WTF? Couldn't serialize roleMap!"); } }
Source:
protected boolean checkAndInitializeSdk(@NonNull Activity launcherActivity, @NonNull Map<String, Object> localExtras, @NonNull Map<String, String> serverExtras) throws Exception { if (serverExtras.get("applicationKey") != null) { applicationKey = serverExtras.get("applicationKey"); } else if (serverExtras.get("appKey") != null) { applicationKey = serverExtras.get("appKey"); } if (serverExtras.get("placementName") != null) { placementName = serverExtras.get("placementName"); } if (serverExtras.get("isTestEnabled") != null) { isTestEnabled = Boolean.valueOf(serverExtras.get("isTestEnabled")); } onLog("server extras: " + Arrays.toString(serverExtras.entrySet().toArray())); IronSource.setRewardedVideoListener(sIronSrcRvListener); initIronSourceSDK(launcherActivity); return true; }

Target:
protected boolean checkAndInitializeSdk(@NonNull Activity launcherActivity, @NonNull Map<String, Object> localExtras, @NonNull Map<String, String> serverExtras) throws Exception { try { String applicationKey = ""; mInstanceId = "0"; if (serverExtras != null) { if (serverExtras.get(APPLICATION_KEY) != null) { applicationKey = serverExtras.get(APPLICATION_KEY); } else if (serverExtras.get(APP_KEY) != null) { applicationKey = serverExtras.get(APP_KEY); } if (serverExtras.get(PLACEMENT_KEY) != null) { mPlacementName = serverExtras.get(PLACEMENT_KEY); } if (serverExtras.get(TEST_ENABLED_KEY) != null) { mIsTestEnabled = Boolean.valueOf(serverExtras.get(TEST_ENABLED_KEY)); } if (serverExtras.get(INSTANCE_ID_KEY) != null) { mInstanceId = serverExtras.get(INSTANCE_ID_KEY); } } if (mInitRewardedVideoSuccessfully) return true; if (!TextUtils.isEmpty(applicationKey)) { onLog("server extras: " + Arrays.toString(serverExtras.entrySet().toArray())); initIronSourceSDK(launcherActivity, applicationKey); } else { onLog("Initialization Failed, make sure that 'applicationKey' server parameter is added"); return false; } return true; } catch (Exception e) { onLog(e.toString()); return false; } }
Source:
protected @Nullable String getOutputFromCommand(List<String> command) { Activator.instance().logInfo(LOG_RUNNING_MESSAGE + ' ' + command.toString()); try { ProcessBuilder builder = new ProcessBuilder(command); builder.redirectErrorStream(true); Process p = builder.start(); try (BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));) { int ret = p.waitFor(); String output = br.lines().collect(Collectors.joining()); return (ret == 0 ? output : null); } } catch (IOException | InterruptedException e) { return null; } }

Target:
protected @Nullable String getOutputFromCommand(List<String> command) { LOGGER.info(() -> LOG_RUNNING_MESSAGE + ' ' + command.toString()); try { ProcessBuilder builder = new ProcessBuilder(command); builder.redirectErrorStream(true); Process p = builder.start(); try (BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));) { int ret = p.waitFor(); String output = br.lines().collect(Collectors.joining()); return (ret == 0 ? output : null); } } catch (IOException | InterruptedException e) { return null; } }
Source:
private String getSwaggerResource() { if (swaggerResource == null) { try (InputStream is = this.getClass().getResourceAsStream("/mvn.properties")) { Properties p = new Properties(); p.load(is); if (StringUtils.isNotEmpty(p.getProperty("swagger.ui.path"))) { swaggerResource = p.getProperty("swagger.ui.path"); } else { log.log(Level.WARN, "swagger.ui.path is not configured correctly"); swaggerResource = DEFAULT_LIB; } } catch (Exception e) { log.log(Level.WARN, e.getMessage()); swaggerResource = DEFAULT_LIB; } } return swaggerResource; }

Target:
private String getSwaggerResource() { if (swaggerResource == null) { try (InputStream is = this.getClass().getResourceAsStream("/mvn.properties")) { Properties p = new Properties(); p.load(is); if (StringUtils.isNotEmpty(p.getProperty("swagger.ui.path"))) { swaggerResource = p.getProperty("swagger.ui.path"); } else { log.warn("swagger.ui.path is not configured correctly"); swaggerResource = DEFAULT_LIB; } } catch (Exception e) { log.warn(e.getMessage()); swaggerResource = DEFAULT_LIB; } } return swaggerResource; }
Source:
private void provisionVolumes( ComponentImpl component, Container container, MachineConfigImpl config) throws DevfileException { for (org.eclipse.che.api.workspace.server.model.impl.devfile.VolumeImpl v : component.getVolumes()) { Optional<VolumeMount> sameNameMount = container .getVolumeMounts() .stream() .filter(volume -> volume.getName().equals(v.getName())) .findFirst(); if (sameNameMount.isPresent() && sameNameMount.get().getMountPath().equals(v.getContainerPath())) { continue; } else if (sameNameMount.isPresent()) { throw new DevfileException( format( "Conflicting volume with same name ('%s') but different path ('%s') found for component '%s' and its container '%s'.", v.getName(), v.getContainerPath(), getIdentifiableComponentName(component), container.getName())); } if (container .getVolumeMounts() .stream() .anyMatch(volume -> volume.getMountPath().equals(v.getContainerPath()))) { throw new DevfileException( format( "Conflicting volume with same path ('%s') but different name ('%s') found for component '%s' and its container '%s'.", v.getContainerPath(), v.getName(), getIdentifiableComponentName(component), container.getName())); } config.getVolumes().put(v.getName(), new VolumeImpl().withPath(v.getContainerPath())); } }

Target:
private void provisionVolumes( ComponentImpl component, Container container, MachineConfigImpl config) throws DevfileException { for (org.eclipse.che.api.workspace.server.model.impl.devfile.VolumeImpl componentVolume : component.getVolumes()) { Optional<VolumeMount> sameNameMount = container .getVolumeMounts() .stream() .filter(vm -> vm.getName().equals(componentVolume.getName())) .findFirst(); if (sameNameMount.isPresent() && sameNameMount.get().getMountPath().equals(componentVolume.getContainerPath())) { continue; } else if (sameNameMount.isPresent()) { throw new DevfileException( format( "Conflicting volume with same name ('%s') but different path ('%s') found for component '%s' and its container '%s'.", componentVolume.getName(), componentVolume.getContainerPath(), getIdentifiableComponentName(component), container.getName())); } if (container .getVolumeMounts() .stream() .anyMatch(vm -> vm.getMountPath().equals(componentVolume.getContainerPath()))) { throw new DevfileException( format( "Conflicting volume with same path ('%s') but different name ('%s') found for component '%s' and its container '%s'.", componentVolume.getContainerPath(), componentVolume.getName(), getIdentifiableComponentName(component), container.getName())); } config .getVolumes() .put( componentVolume.getName(), new VolumeImpl().withPath(componentVolume.getContainerPath())); } }
Source:
void sendSessionMessageToNonSessionEntity(MessagingEntityType entityType) { setSenderAndReceiver(entityType, false); final String messageId = UUID.randomUUID().toString(); final String contents = "Some-contents"; final ServiceBusMessage message = TestUtils.getServiceBusMessage(contents, messageId); message.setSessionId("test-session-id1"); StepVerifier.create(sender.send(message).doOnSuccess(aVoid -> messagesPending.incrementAndGet())) .verifyComplete(); }

Target:
void sendSessionMessageToNonSessionEntity(MessagingEntityType entityType) { setSenderAndReceiver(entityType, false, false); final String messageId = UUID.randomUUID().toString(); final String contents = "Some-contents"; final ServiceBusMessage message = TestUtils.getServiceBusMessage(contents, messageId); message.setSessionId(sessionId); StepVerifier.create(sender.send(message).doOnSuccess(aVoid -> messagesPending.incrementAndGet())) .verifyComplete(); }
Source:
private List<TestFunctionality> getAvailableTestFunctionalities(final CertificationResult cr, final CertifiedProductSearchDetails cp) { String edition = cp.getCertificationEdition().get("name").toString(); Long practiceTypeId = null; if (cp.getPracticeType().containsKey("id")) { if (cp.getPracticeType().get("id") instanceof String) { practiceTypeId = Long.valueOf(cp.getPracticeType().get("id").toString()); } } String criteriaNumber = cr.getNumber(); return testFunctionalityManager.getTestFunctionalities(criteriaNumber, edition, practiceTypeId); }

Target:
private List<TestFunctionality> getAvailableTestFunctionalities(final CertificationResult cr, final CertifiedProductSearchDetails cp) { String edition = cp.getCertificationEdition().get("name").toString(); Long practiceTypeId = null; if (cp.getPracticeType().containsKey("id")) { if (cp.getPracticeType().get("id") != null) { practiceTypeId = Long.valueOf(cp.getPracticeType().get("id").toString()); } } String criteriaNumber = cr.getNumber(); return testFunctionalityManager.getTestFunctionalities(criteriaNumber, edition, practiceTypeId); }
Source:
public static String getString(String key) { String value = System.getProperty(key); if (value != null) { if (LOGGER.isLoggable(Level.CONFIG)) { LOGGER.log(Level.CONFIG, "Property (system): {0} => {1}", new Object[] {key, value}); } return value; } value = handler.getString(key); if (value != null) { if (LOGGER.isLoggable(Level.CONFIG)) { LOGGER.log(Level.CONFIG, "Property (context): {0} => {1}", new Object[]{key, value}); } return value; } if (LOGGER.isLoggable(Level.CONFIG)) { LOGGER.log(Level.CONFIG, "Property (not found): {0} => {1}", new Object[] {key, null}); } return null; }

Target:
public static String getString(String key) { String value = System.getProperty(key); if (value != null) { if (LOGGER.isLoggable(Level.CONFIG)) { LOGGER.log(Level.CONFIG, "Property (system): {0} => {1}", new Object[] {key, value}); } return value; } value = handler.getString(key); if (value != null) { if (LOGGER.isLoggable(Level.CONFIG)) { LOGGER.log(Level.CONFIG, "Property (context): {0} => {1}", new Object[]{key, value}); } return value; } if (LOGGER.isLoggable(Level.CONFIG)) { LOGGER.log(Level.CONFIG, "Property (not found): {0}", key); } return null; }
Source:
public DatabaseOperatorImpl(QueryRunner queryRunner){ this.queryRunner = queryRunner; requireNonNull(queryRunner.getDataSource(), "data source must not be null."); }

Target:
public DatabaseOperatorImpl(QueryRunner queryRunner){ requireNonNull(queryRunner.getDataSource(), "data source must not be null."); this.queryRunner = queryRunner; }
Source:
public void addItem() { String newList = newListInput.getText().toString().trim(); if (newList.isEmpty()) { UIUtils.showSnackbar(parent, getString(R.string.blank_list_name)); } else if (preferencesManager.getNameLists().contains(newList)) { String dupeMessage = String.format(listDuplicate, newList); UIUtils.showSnackbar(parent, dupeMessage); } else { newListInput.setText(""); nameListsAdapter.addList(newList); Intent intent = new Intent(this, ListActivity.class); intent.putExtra(LIST_NAME_KEY, newList); intent.putExtra(LIST_TYPE, START_ON_EDIT_PAGE); startActivity(intent); } }

Target:
public void addItem() { String newList = newListInput.getText().toString().trim(); if (newList.isEmpty()) { UIUtils.showSnackbar(parent, getString(R.string.blank_list_name)); } else if (preferencesManager.getNameLists().contains(newList)) { String dupeMessage = String.format(listDuplicate, newList); UIUtils.showSnackbar(parent, dupeMessage); } else { newListInput.setText(""); nameListsAdapter.addList(newList); Intent intent = new Intent(this, ListActivity.class); intent.putExtra(LIST_NAME_KEY, newList); intent.putExtra(START_ON_EDIT_PAGE, true); startActivity(intent); } }
Source:
public void processVerification(String column, RoughArtifact roughArtifact) throws OseeCoreException { String[] keywords = {"Effectivity:", "Verf Method:", "Verf Level:", "Verf Location:", "Verf Type:", "Verified By:", "Criteria:"}; IAttributeType[] FieldType = { null, CoreAttributeTypes.QualificationMethod, CoreAttributeTypes.VerificationLevel, CoreAttributeTypes.VerificationEvent, null, null, null}; String trimmed = clearHTML(column); if (trimmed.trim().isEmpty()) { return; } for (int i = 0; i < keywords.length; i++) { if ((FieldType[i] == null) && (!keywords[i].equals("Criteria:"))) { continue; } int iStart = trimmed.indexOf(keywords[i]); if (iStart != -1) { boolean dataFound = true; String rest = trimmed.substring(iStart + keywords[i].length()); rest = rest.trim(); dataFound = !rest.isEmpty(); for (int j = 0; (j < keywords.length) && dataFound; j++) { dataFound = !rest.startsWith(keywords[j]); } if (dataFound) { int colon = rest.indexOf(':'); if (colon == -1) { if (keywords[i].equals("Criteria:")) { roughArtifact.addAttribute("Verification Acceptance Criteria", rest); } else { roughArtifact.addAttribute(FieldType[i], rest); } } else { boolean foundKeyword = false; for (int j = 0; (j < keywords.length); j++) { if (rest.indexOf(keywords[j]) == (colon - keywords[j].length() + 1)) { roughArtifact.addAttribute(FieldType[i], rest.substring(0, rest.indexOf(keywords[j]) - 1)); foundKeyword = true; break; } } if (!foundKeyword) { roughArtifact.addAttribute(FieldType[i], rest); } } } } } }

Target:
public void processVerification(String column, RoughArtifact roughArtifact) throws OseeCoreException { String trimmed = clearHTML(column); if (trimmed.trim().isEmpty()) { return; } for (int i = 0; i < VERIFICATION_KEYWORDS.length; i++) { if ((FIELD_TYPE[i] == null) && (!VERIFICATION_KEYWORDS[i].equals("Criteria:"))) { continue; } int iStart = trimmed.indexOf(VERIFICATION_KEYWORDS[i]); if (iStart != -1) { boolean dataFound = true; String rest = trimmed.substring(iStart + VERIFICATION_KEYWORDS[i].length()); rest = rest.trim(); dataFound = !rest.isEmpty(); for (int j = 0; (j < VERIFICATION_KEYWORDS.length) && dataFound; j++) { dataFound = !rest.startsWith(VERIFICATION_KEYWORDS[j]); } if (dataFound) { int colon = rest.indexOf(':'); if (colon == -1) { if (VERIFICATION_KEYWORDS[i].equals("Criteria:")) { roughArtifact.addAttribute("Verification Acceptance Criteria", rest); } else { roughArtifact.addAttribute(FIELD_TYPE[i], rest); } } else { boolean foundKeyword = false; for (int j = 0; (j < VERIFICATION_KEYWORDS.length); j++) { if (rest.indexOf(VERIFICATION_KEYWORDS[j]) == (colon - VERIFICATION_KEYWORDS[j].length() + 1)) { roughArtifact.addAttribute(FIELD_TYPE[i], rest.substring(0, rest.indexOf(VERIFICATION_KEYWORDS[j]) - 1)); foundKeyword = true; break; } } if (!foundKeyword) { roughArtifact.addAttribute(FIELD_TYPE[i], rest); } } } } } }
Source:
synchronized void saveInAppMessage(OSInAppMessage inAppMessage) { SQLiteDatabase writableDb = dbHelper.getWritableDbWithRetries(); ContentValues values = new ContentValues(); values.put(OneSignalDbContract.InAppMessageTable.COLUMN_NAME_MESSAGE_ID, inAppMessage.messageId); values.put(OneSignalDbContract.InAppMessageTable.COLUMN_NAME_DISPLAY_QUANTITY, inAppMessage.getDisplayStats().getDisplayQuantity()); values.put(OneSignalDbContract.InAppMessageTable.COLUMN_NAME_LAST_DISPLAY, inAppMessage.getDisplayStats().getLastDisplayTime()); values.put(OneSignalDbContract.InAppMessageTable.COLUMN_CLICK_IDS, inAppMessage.getClickedClickIds().toString()); values.put(OneSignalDbContract.InAppMessageTable.COLUMN_DISPLAYED, inAppMessage.isDisplayed() ? 1 : 0); int rowsUpdated = writableDb.update(OneSignalDbContract.InAppMessageTable.TABLE_NAME, values, OneSignalDbContract.InAppMessageTable.COLUMN_NAME_MESSAGE_ID + " = ?", new String[]{inAppMessage.messageId}); if (rowsUpdated == 0) writableDb.insert(OneSignalDbContract.InAppMessageTable.TABLE_NAME, null, values); writableDb.close(); }

Target:
synchronized void saveInAppMessage(OSInAppMessage inAppMessage) { SQLiteDatabase writableDb = dbHelper.getWritableDbWithRetries(); ContentValues values = new ContentValues(); values.put(OneSignalDbContract.InAppMessageTable.COLUMN_NAME_MESSAGE_ID, inAppMessage.messageId); values.put(OneSignalDbContract.InAppMessageTable.COLUMN_NAME_DISPLAY_QUANTITY, inAppMessage.getDisplayStats().getDisplayQuantity()); values.put(OneSignalDbContract.InAppMessageTable.COLUMN_NAME_LAST_DISPLAY, inAppMessage.getDisplayStats().getLastDisplayTime()); values.put(OneSignalDbContract.InAppMessageTable.COLUMN_CLICK_IDS, inAppMessage.getClickedClickIds().toString()); values.put(OneSignalDbContract.InAppMessageTable.COLUMN_DISPLAYED_IN_SESSION, inAppMessage.isDisplayedInSession()); int rowsUpdated = writableDb.update(OneSignalDbContract.InAppMessageTable.TABLE_NAME, values, OneSignalDbContract.InAppMessageTable.COLUMN_NAME_MESSAGE_ID + " = ?", new String[]{inAppMessage.messageId}); if (rowsUpdated == 0) writableDb.insert(OneSignalDbContract.InAppMessageTable.TABLE_NAME, null, values); writableDb.close(); }
Source:
public void updatesWaitingSlotsToReady() throws Exception { WorkflowID wfID1 = new WorkflowID("wf1"); Schedule sch1 = new HourlySchedule(); SchedulingStrategy str1 = new SerialSchedulingStrategy(); Trigger tr1 = new AlwaysTrigger(); ExternalService srv1 = new MockExternalService(new MockExternalService.MockExternalStatusRunning()); Workflow wf1 = new Workflow(wfID1, sch1, str1, tr1, srv1); Set<Workflow> workflows = new HashSet<Workflow>(); workflows.add(wf1); WorkflowConfiguration cfg = new WorkflowConfiguration(workflows); MemoryStateDatabase db = new MemoryStateDatabase(); int slidingWindowHours = 24; DateTime current = DateTime.parse("2013-11-27T15:01Z"); DateTime currentFullHour = Util.toFullHour(current); Scheduler sched = new Scheduler(slidingWindowHours); sched.step(new ScheduledTime(current), cfg, db); Assert.assertEquals(slidingWindowHours, db.size()); for (int i = 0; i < slidingWindowHours; i++) { SlotID id = new SlotID(wfID1, new ScheduledTime(currentFullHour.minusHours(i))); SlotState state = db.getSlotState(id); if (state == null) { throw new AssertionError("Slot " + id + " not found."); } Assert.assertEquals(SlotState.Status.READY, state.getStatus()); } }

Target:
public void updatesWaitingSlotsToReady() throws Exception { WorkflowID wfID1 = new WorkflowID("wf1"); Schedule sch1 = new HourlySchedule(); SchedulingStrategy str1 = new SerialSchedulingStrategy(); Trigger tr1 = new AlwaysTrigger(); ExternalService srv1 = new MockExternalService(new MockExternalService.MockExternalStatusRunning()); Workflow wf1 = new Workflow(wfID1, sch1, str1, tr1, srv1); Set<Workflow> workflows = new HashSet<Workflow>(); workflows.add(wf1); WorkflowConfiguration cfg = new WorkflowConfiguration(workflows); MemoryStateDatabase db = new MemoryStateDatabase(); int slidingWindowHours = 24; DateTime current = DateTime.parse("2013-11-27T15:01Z"); DateTime currentFullHour = Util.toFullHour(current); Scheduler sched = new Scheduler(cfg, db, slidingWindowHours); sched.step(new ScheduledTime(current)); Assert.assertEquals(slidingWindowHours, db.size()); for (int i = 0; i < slidingWindowHours; i++) { SlotID id = new SlotID(wfID1, new ScheduledTime(currentFullHour.minusHours(i))); SlotState state = db.getSlotState(id); if (state == null) { throw new AssertionError("Slot " + id + " not found."); } Assert.assertEquals(SlotState.Status.READY, state.getStatus()); } }
Source:
public String getEventString(int index) { List<ITmfEventField> fields = Lists.newArrayList(getContent().getFields()); if (index < 0 || index >= fields.size()) { return ""; } return nullToEmptyString(fields.get(index).getValue()); }

Target:
public String getEventString(int index) { Collection<? extends ITmfEventField> fields = getContent().getFields(); if (index < 0 || index >= fields.size()) { return ""; } return nullToEmptyString(checkNotNull(Iterables.get(fields, index)).getValue()); }
Source:
private void writeEvents(EventsValue eventsValue, final JsonGenerator json) throws IOException { json.writeArrayFieldStart("Event"); json.writeStringField("namespace", eventsValue.namespace()); json.writeStringField("source", eventsValue.source()); json.writeStringField("title", eventsValue.title()); json.writeStringField("message", eventsValue.message()); json.writeStringField("priority", eventsValue.priority()); json.writeStringField("status", eventsValue.status()); json.writeStringField("timestamp", Long.toString(eventsValue.timestamp().epoch())); json.writeStringField("endTimestamp", Long.toString(eventsValue.endTimestamp().epoch())); json.writeStringField("userId", eventsValue.userId()); json.writeBooleanField("ongoing", eventsValue.ongoing()); json.writeStringField("eventId", eventsValue.eventId()); if (eventsValue.parentId() != null) { json.writeArrayFieldStart("parentId"); for (String p : eventsValue.parentId()) { json.writeString(p); } } if (eventsValue.childId() != null) { json.writeArrayFieldStart("childId"); for (String c : eventsValue.childId()) { json.writeString(c); } } if (eventsValue.additionalProps() != null) { for (Map.Entry<String, Object> e : eventsValue.additionalProps().entrySet()) { json.writeStringField(e.getKey(), String.valueOf(e.getValue())); } } json.writeEndArray(); }

Target:
private void writeEvents(EventsValue eventsValue, final JsonGenerator json) throws IOException { json.writeArrayFieldStart("Event"); json.writeStringField("namespace", eventsValue.namespace()); json.writeStringField("source", eventsValue.source()); json.writeStringField("title", eventsValue.title()); json.writeStringField("message", eventsValue.message()); json.writeStringField("priority", eventsValue.priority()); json.writeStringField("timestamp", Long.toString(eventsValue.timestamp().epoch())); json.writeStringField("endTimestamp", Long.toString(eventsValue.endTimestamp().epoch())); json.writeStringField("userId", eventsValue.userId()); json.writeBooleanField("ongoing", eventsValue.ongoing()); json.writeStringField("eventId", eventsValue.eventId()); if (eventsValue.parentId() != null) { json.writeArrayFieldStart("parentId"); for (String p : eventsValue.parentId()) { json.writeString(p); } } if (eventsValue.childId() != null) { json.writeArrayFieldStart("childId"); for (String c : eventsValue.childId()) { json.writeString(c); } } if (eventsValue.additionalProps() != null) { for (Map.Entry<String, Object> e : eventsValue.additionalProps().entrySet()) { json.writeStringField(e.getKey(), String.valueOf(e.getValue())); } } json.writeEndArray(); }
Source:
public void onUberfireDocksInteractionEvent(@Observes final UberfireDocksInteractionEvent uberfireDocksInteractionEvent) { if (isUberfireDocksInteractionEventToManage(uberfireDocksInteractionEvent) && !uberfireDocksInteractionEvent.getTargetDock().getIdentifier().equals(TestToolsPresenter.IDENTIFIER)) { populateRightDocks(uberfireDocksInteractionEvent.getTargetDock().getIdentifier()); } }

Target:
public void onUberfireDocksInteractionEvent(@Observes final UberfireDocksInteractionEvent uberfireDocksInteractionEvent) { if (isUberfireDocksInteractionEventToManage(uberfireDocksInteractionEvent) && !TestToolsPresenter.IDENTIFIER.equals(uberfireDocksInteractionEvent.getTargetDock().getIdentifier())) { populateRightDocks(uberfireDocksInteractionEvent.getTargetDock().getIdentifier()); } }
Source:
public io.druid.java.util.common.FileUtils.FileCopyResult getSegmentFiles( final String containerName, final String blobPath, final File outDir ) throws SegmentLoadingException { try { prepareOutDir(outDir); log.info("Loading container: " + containerName + " - " + "blobPath:" + blobPath + " - outdir: " + outDir); Boolean blobPathIsHadoop = blobPath.contains(HADOOP_BLOB_PATH_IDENTIFIER); final String actualBlobPath; if (blobPathIsHadoop) { actualBlobPath = blobPath.substring(blobPath.indexOf(HADOOP_BLOB_PATH_IDENTIFIER) + HADOOP_BLOB_PATH_IDENTIFIER.length() + 1); } else { actualBlobPath = blobPath; } final ByteSource byteSource = new AzureByteSource(azureStorage, containerName, actualBlobPath); final io.druid.java.util.common.FileUtils.FileCopyResult result = CompressionUtils.unzip( byteSource, outDir, AzureUtils.AZURE_RETRY, false ); log.info("Loaded %d bytes from [%s] to [%s]", result.size(), actualBlobPath, outDir.getAbsolutePath()); return result; } catch (IOException e) { try { FileUtils.deleteDirectory(outDir); } catch (IOException ioe) { log.warn( ioe, "Failed to remove output directory [%s] for segment pulled from [%s]", outDir.getAbsolutePath(), blobPath ); } throw new SegmentLoadingException(e, e.getMessage()); } }

Target:
public io.druid.java.util.common.FileUtils.FileCopyResult getSegmentFiles( final String containerName, final String blobPath, final File outDir ) throws SegmentLoadingException { try { prepareOutDir(outDir); log.info( "Loading container: [%s], with blobPath: [%s] and outDir: [%s]", containerName, blobPath, outDir ); boolean blobPathIsHadoop = blobPath.contains(AZURE_STORAGE_HOST_ADDRESS); final String actualBlobPath; if (blobPathIsHadoop) { actualBlobPath = blobPath.substring( blobPath.indexOf(AZURE_STORAGE_HOST_ADDRESS) + AZURE_STORAGE_HOST_ADDRESS.length() + 1); } else { actualBlobPath = blobPath; } final ByteSource byteSource = new AzureByteSource(azureStorage, containerName, actualBlobPath); final io.druid.java.util.common.FileUtils.FileCopyResult result = CompressionUtils.unzip( byteSource, outDir, AzureUtils.AZURE_RETRY, false ); log.info("Loaded %d bytes from [%s] to [%s]", result.size(), actualBlobPath, outDir.getAbsolutePath()); return result; } catch (IOException e) { try { FileUtils.deleteDirectory(outDir); } catch (IOException ioe) { log.warn( ioe, "Failed to remove output directory [%s] for segment pulled from [%s]", outDir.getAbsolutePath(), blobPath ); } throw new SegmentLoadingException(e, e.getMessage()); } }
Source:
public View getView(final String name) throws CmdLineException { ViewGroup group = Jenkins.getInstance(); View view = null; if (group == null) throw new CmdLineException(owner, "The Jenkins instance has not been started, or was already shut down!"); final StringTokenizer tok = new StringTokenizer(name, "/"); while(tok.hasMoreTokens()) { String viewName = tok.nextToken(); view = group.getView(viewName); if (view == null) throw new CmdLineException(owner, String.format( "No view named %s inside view %s", viewName, group.getDisplayName() )); view.checkPermission(View.READ); if (view instanceof ViewGroup) { group = (ViewGroup) view; } else if (tok.hasMoreTokens()) { throw new CmdLineException( owner, view.getViewName() + " view can not contain views" ); } } return view; }

Target:
public View getView(final String name) throws CmdLineException { ViewGroup group = Jenkins.getInstance(); View view = null; if (group == null) throw new CmdLineException(owner, "The Jenkins instance has not been started, or was already shut down!"); final StringTokenizer tok = new StringTokenizer(name, "/"); while(tok.hasMoreTokens()) { String viewName = tok.nextToken(); view = group.getView(viewName); if (view == null) throw new CmdLineException(owner, String.format( "No view named %s inside view %s", viewName, group.getDisplayName() )); try { view.checkPermission(View.READ); } catch (Exception e) { throw new CmdLineException(owner, e.getMessage()); } if (view instanceof ViewGroup) { group = (ViewGroup) view; } else if (tok.hasMoreTokens()) { throw new CmdLineException( owner, view.getViewName() + " view can not contain views" ); } } return view; }
Source:
public void export_system_credentials() throws Exception { CredentialsRootConfigurator root = Jenkins.getInstance() .getExtensionList(CredentialsRootConfigurator.class).get(0); ConfiguratorRegistry registry = ConfiguratorRegistry.get(); ConfigurationContext context = new ConfigurationContext(registry); Mapping configNode = Objects .requireNonNull(root.describe(root.getTargetComponent(context), context)).asMapping(); Mapping domainCredentials = configNode .get("system").asMapping().get("domainCredentials") .asSequence() .get(0).asMapping(); Mapping domain = domainCredentials.get("domain").asMapping(); Sequence credentials = domainCredentials.get("credentials").asSequence(); Mapping usernamePassword = credentials.get(0).asMapping().get("usernamePassword") .asMapping(); Mapping hostnameSpecification = domain.get("specifications").asSequence().get(0).asMapping() .get("hostnameSpecification").asMapping(); assertThat(usernamePassword.getScalarValue("scope"), is("SYSTEM")); assertThat(usernamePassword.getScalarValue("username"), is("root")); assertThat(usernamePassword.getScalarValue("password"), is(not("password"))); assertThat(domain.getScalarValue("name"), is("test.com")); assertThat(domain.getScalarValue("description"), is("test.com domain")); assertThat(hostnameSpecification.getScalarValue("includes"), is("*.test.com")); }

Target:
public void export_system_credentials() throws Exception { CredentialsRootConfigurator root = Jenkins.getInstance() .getExtensionList(CredentialsRootConfigurator.class).get(0); ConfiguratorRegistry registry = ConfiguratorRegistry.get(); ConfigurationContext context = new ConfigurationContext(registry); Mapping configNode = Objects .requireNonNull(root.describe(root.getTargetComponent(context), context)).asMapping(); Mapping domainCredentials = configNode .get("system").asMapping().get("domainCredentials") .asSequence() .get(0).asMapping(); Mapping domain = domainCredentials.get("domain").asMapping(); Sequence credentials = domainCredentials.get("credentials").asSequence(); Mapping usernamePassword = credentials.get(0).asMapping().get("usernamePassword") .asMapping(); Mapping hostnameSpecification = domain.get("specifications").asSequence().get(0).asMapping() .get("hostnameSpecification").asMapping(); String password = usernamePassword.getScalarValue("password"); Secret decryptedPassword = Secret.decrypt(password); assertNotNull(decryptedPassword); assertThat(usernamePassword.getScalarValue("scope"), is("SYSTEM")); assertThat(usernamePassword.getScalarValue("username"), is("root")); assertThat(password, is(not("password"))); assertThat(decryptedPassword.getPlainText(), is("password")); assertThat(domain.getScalarValue("name"), is("test.com")); assertThat(domain.getScalarValue("description"), is("test.com domain")); assertThat(hostnameSpecification.getScalarValue("includes"), is("*.test.com")); }
Source:
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Credentials credentials = getUserCredentials(request); if (credentials != null) { request.getSession(true).setAttribute(SSOUtils.USER_CREDENTIALS, credentials); response.sendRedirect(request.getContextPath() + SSOUtils.LOGIN_PHASE3_URI); } else { response.sendRedirect(request.getContextPath() + SSOUtils.LOGIN_PHASE2_URI); } }

Target:
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { SSOConfig config = (SSOConfig) request.getServletContext().getAttribute(SSOUtils.SSO_CONFIG); Credentials credentials = null; if (config.isAcceptBasicAuthHeaders()) { credentials = SSOUtils.getUserCredentialsFromHeader(request); } if (credentials != null) { request.getSession(true).setAttribute(SSOUtils.USER_CREDENTIALS, credentials); response.sendRedirect(request.getContextPath() + SSOUtils.LOGIN_PHASE3_URI); } else { response.sendRedirect(request.getContextPath() + SSOUtils.LOGIN_PHASE2_URI); } }
Source:
public boolean hasPrevious() { return cursor != 0; }

Target:
public boolean hasPrevious() { return cursor > 0; }
Source:
private WatermarkConfiguration getDefaultWatermarkConf() { return PeriodicWatermarkConfiguration.newBuilder() .setWatermarkPeriod(DEFAULT_WATERMARK_PERIOD) .setCheckpointPeriod(DEFAULT_CHECKPOINT_PERIOD) .setExpectedDelay(DEFAULT_EXPECTED_DELAY) .build(); }

Target:
private WatermarkConfiguration getDefaultWatermarkConf() { return PeriodicWatermarkConfiguration.newBuilder() .setWatermarkPeriod(DEFAULT_WATERMARK_PERIOD) .setExpectedDelay(DEFAULT_EXPECTED_DELAY) .build(); }
Source:
private short getPosition() { lock.lock(); try { serial.write(new byte[] {START_BYTE, maestro, COMMAND_GET_POSITION, channel}); final ByteBuffer response = ByteBuffer.allocate(4).put(serial.read(), 0, 4); return ByteBuffer.allocate(2).order(ByteOrder.LITTLE_ENDIAN).put( new byte[]{response.get(1), response.get(3)}).getShort(0); } catch (final IOException e) { Logger.error(e); return 0; } finally { lock.unlock(); } }

Target:
private short getPosition() { lock.lock(); try { serial.write(new byte[] {START_BYTE, maestro, COMMAND_GET_POSITION, channel}); final ByteBuffer response = ByteBuffer.allocate(4).put(serial.read(4)); return ByteBuffer.allocate(2).order(ByteOrder.LITTLE_ENDIAN).put( new byte[]{response.get(1), response.get(3)}).getShort(0); } catch (final IOException e) { Logger.error(e); return 0; } finally { lock.unlock(); } }
Source:
void setup(View view, TriggerType triggerType, int position, long rowId) { if (triggerType == TriggerType.CLICK_LIST_ITEM) { view.setOnClickListener(this); view.setTag(LIST_POSITION_TAG.hashCode(), position); view.setTag(LIST_ROW_ID_TAG.hashCode(), rowId); } else if (triggerType == TriggerType.LONG_CLICK_LIST_ITEM) { view.setOnLongClickListener(this); view.setTag(LIST_POSITION_TAG.hashCode(), position); view.setTag(LIST_ROW_ID_TAG.hashCode(), rowId); } }

Target:
void setup(View view, TriggerType triggerType, int position, long rowId) { if (triggerType == TriggerType.CLICK_LIST_ITEM) { view.setOnClickListener(this); view.setTag(tagIdDefinition.getRowPositionTagResource(), position); view.setTag(tagIdDefinition.getRowIdTagResource(), rowId); } else if (triggerType == TriggerType.LONG_CLICK_LIST_ITEM) { view.setOnLongClickListener(this); view.setTag(tagIdDefinition.getRowPositionTagResource(), position); view.setTag(tagIdDefinition.getRowIdTagResource(), rowId); } }
Source:
public void releaseCopier(Copier<?> copier) throws Exception { if (!(copier instanceof IdentityCopier) & !(copier instanceof SerializingCopier)) { releaseInstance(copier); } }

Target:
public void releaseCopier(Copier<?> copier) throws Exception { if (!(copier instanceof SerializingCopier)) { releaseInstance(copier); } }
Source:
private boolean possiblyPause(Set<Integer> assignment) throws InterruptedException { pauseLock.lockInterruptibly(); try { if (ioConfig.getPauseAfterRead() && assignment.isEmpty()) { pauseMillis = 0; pauseRequested = true; } if (pauseRequested) { log.info(pauseMillis == 0 ? "Pausing ingestion until resumed" : "Pausing ingestion for %d ms", pauseMillis); paused = true; shouldPause.signalAll(); while (pauseRequested) { if (pauseMillis == 0) { shouldResume.await(); } else if (!shouldResume.await(pauseMillis, TimeUnit.MILLISECONDS)) { pauseRequested = false; } } paused = false; shouldResume.signalAll(); log.info("Ingestion loop resumed"); return true; } } finally { pauseLock.unlock(); } return false; }

Target:
private boolean possiblyPause(Set<Integer> assignment) throws InterruptedException { pauseLock.lockInterruptibly(); try { if (ioConfig.isPauseAfterRead() && assignment.isEmpty()) { pauseMillis = PAUSE_FOREVER; pauseRequested = true; } if (pauseRequested) { status = Status.PAUSED; long nanos = 0; hasPaused.signalAll(); while (pauseRequested) { if (pauseMillis == PAUSE_FOREVER) { log.info("Pausing ingestion until resumed"); shouldResume.await(); } else { if (pauseMillis > 0) { log.info("Pausing ingestion for [%,d] ms", pauseMillis); nanos = TimeUnit.MILLISECONDS.toNanos(pauseMillis); pauseMillis = 0; } if (nanos <= 0L) { pauseRequested = false; } nanos = shouldResume.awaitNanos(nanos); } } status = Status.READING; shouldResume.signalAll(); log.info("Ingestion loop resumed"); return true; } } finally { pauseLock.unlock(); } return false; }
Source:
public FileSourceSplit updateWithCheckpointedPosition(@Nullable CheckpointedPosition position) { try { return new HiveSourceSplit(toMapRedSplit(), hiveTablePartition, position); } catch (IOException e) { throw new FlinkHiveException("Failed to update checkpoint position for split:" + toString(), e); } }

Target:
public FileSourceSplit updateWithCheckpointedPosition(@Nullable CheckpointedPosition position) { return new HiveSourceSplit(splitId(), path(), offset(), length(), hostnames(), position, hiveTablePartition); }
Source:
private void processScanResponse(ClientResponse response) { setState(State.WAITING); if (response.getStatus() != ClientResponse.SUCCESS) { logFailureResponse("Initial snapshot scan failed", response); return; } final VoltTable results[] = response.getResults(); if (results.length == 1) { final VoltTable result = results[0]; boolean advanced = result.advanceRow(); assert(advanced); assert(result.getColumnCount() == 1); assert(result.getColumnType(0) == VoltType.STRING); SNAP_LOG.warn("Initial snapshot scan failed with failure response: " + result.getString("ERR_MSG")); return; } assert(results.length == 3); final VoltTable snapshots = results[0]; assert(snapshots.getColumnCount() == 9); final File myPath = new File(m_path); while (snapshots.advanceRow()) { final String path = snapshots.getString("PATH"); final File pathFile = new File(path); if (pathFile.equals(myPath)) { final String nonce = snapshots.getString("NONCE"); if (nonce.startsWith(m_prefixAndSeparator)) { final Long txnId = snapshots.getLong("TXNID"); m_snapshots.add(new Snapshot(path, SnapthotPathType.SNAP_AUTO, nonce, txnId)); } } } java.util.Collections.sort(m_snapshots); deleteExtraSnapshots(); }

Target:
private void processScanResponse(ClientResponse response) { setState(State.WAITING); if (response.getStatus() != ClientResponse.SUCCESS) { logFailureResponse("Initial snapshot scan failed", response); return; } final VoltTable results[] = response.getResults(); if (results.length == 1) { final VoltTable result = results[0]; boolean advanced = result.advanceRow(); assert(advanced); assert(result.getColumnCount() == 1); assert(result.getColumnType(0) == VoltType.STRING); SNAP_LOG.warn("Initial snapshot scan failed with failure response: " + result.getString("ERR_MSG")); return; } assert(results.length == 3); final VoltTable snapshots = results[0]; assert(snapshots.getColumnCount() == 10); final File myPath = new File(m_path); while (snapshots.advanceRow()) { final String path = snapshots.getString("PATH"); final File pathFile = new File(path); if (pathFile.equals(myPath)) { final String nonce = snapshots.getString("NONCE"); if (nonce.startsWith(m_prefixAndSeparator)) { final Long txnId = snapshots.getLong("TXNID"); m_snapshots.add(new Snapshot(path, SnapshotPathType.SNAP_AUTO, nonce, txnId)); } } } java.util.Collections.sort(m_snapshots); deleteExtraSnapshots(); }
Source:
private void serialize(String nodeName, Node node, JsonGenerator generator) { requireNonNull(node); BaseNodeMetaModel nodeMetaModel = JavaParserMetaModel.getNodeMetaModel(node.getClass()).orElseThrow(() -> new IllegalStateException("Unknown Node: " + node.getClass())); if (nodeName == null) { generator.writeStartObject(); } else { generator.writeStartObject(nodeName); } generator.write("!", node.getClass().getName()); for (PropertyMetaModel propertyMetaModel : nodeMetaModel.getAllPropertyMetaModels()) { String name = propertyMetaModel.getName(); Object value = propertyMetaModel.getValue(node); if (value != null) { if (propertyMetaModel.isNodeList()) { NodeList<Node> list = (NodeList<Node>) value; generator.writeStartArray(name); for (Node n : list) { serialize(null, n, generator); } generator.writeEnd(); } else if (propertyMetaModel.isEnumSet()) { EnumSet<? extends Enum> set = (EnumSet<? extends Enum>) value; generator.writeStartArray(name); for (Enum n : set) { generator.write(n.name()); } generator.writeEnd(); } else if (propertyMetaModel.isNode()) { serialize(name, (Node) value, generator); } else { generator.write(name, value.toString()); } } } generator.writeEnd(); }

Target:
private void serialize(String nodeName, Node node, JsonGenerator generator) { requireNonNull(node); BaseNodeMetaModel nodeMetaModel = JavaParserMetaModel.getNodeMetaModel(node.getClass()).orElseThrow(() -> new IllegalStateException("Unknown Node: " + node.getClass())); if (nodeName == null) { generator.writeStartObject(); } else { generator.writeStartObject(nodeName); } generator.write(SERIALIZED_CLASS_KEY, node.getClass().getName()); for (PropertyMetaModel propertyMetaModel : nodeMetaModel.getAllPropertyMetaModels()) { String name = propertyMetaModel.getName(); Object value = propertyMetaModel.getValue(node); if (value != null) { if (propertyMetaModel.isNodeList()) { NodeList<Node> list = (NodeList<Node>) value; generator.writeStartArray(name); for (Node n : list) { serialize(null, n, generator); } generator.writeEnd(); } else if (propertyMetaModel.isEnumSet()) { EnumSet<? extends Enum> set = (EnumSet<? extends Enum>) value; generator.writeStartArray(name); for (Enum n : set) { generator.write(n.name()); } generator.writeEnd(); } else if (propertyMetaModel.isNode()) { serialize(name, (Node) value, generator); } else { generator.write(name, value.toString()); } } } generator.writeEnd(); }
Source:
protected boolean replay(Exception e) { ExceptionRecorder<Result> exresult = exceptions.findByException(e); if (exresult == null) { return false; } reportException(e); logger.debug("handling exception {}", e); exresult.replay(result); return true; }

Target:
protected boolean replay(Exception e) { ExceptionRecorder<Result> exresult = exceptions.findByException(e); if (exresult == null) { return false; } reportException(e); logger.debug("handling exception {}", e.getClass(), e); exresult.replay(result); return true; }
Source:
public static Sensor activeProcessRatioSensor(final String threadId, final String taskId, final StreamsMetricsImpl streamsMetrics) { final String name = ACTIVE_TASK_PREFIX + PROCESS + RATIO_SUFFIX; final Sensor sensor = streamsMetrics.taskLevelSensor(threadId, taskId, name, Sensor.RecordingLevel.INFO); sensor.add( new MetricName( name, TASK_LEVEL_GROUP, PROCESS_RATIO_DESCRIPTION, streamsMetrics.taskLevelTagMap(threadId, taskId)), new Value() ); return sensor; }

Target:
public static Sensor activeProcessRatioSensor(final String threadId, final String taskId, final StreamsMetricsImpl streamsMetrics) { final String name = ACTIVE_TASK_PREFIX + PROCESS + RATIO_SUFFIX; final Sensor sensor = streamsMetrics.taskLevelSensor(threadId, taskId, name, Sensor.RecordingLevel.INFO); addValueMetricToSensor( sensor, TASK_LEVEL_GROUP, streamsMetrics.taskLevelTagMap(threadId, taskId), name, PROCESS_RATIO_DESCRIPTION ); return sensor; }
Source:
public String render(String template, String port) { if (!this.initialized) { init(); this.initialized = true; } ST stringTemplate = new ST(template); globalPropertiesMap.forEach((key, value) -> stringTemplate.add(key, "isDevMachine".equals(key) ? Boolean.parseBoolean(value) : value)); stringTemplate.add("serverName", portsToRefName.get(port)); return stringTemplate.render(); }

Target:
public String render(String template, String port) { if (!this.initialized) { init(); this.initialized = true; } ST stringTemplate = new ST(template); globalPropertiesMap.forEach((key, value) -> stringTemplate.add(key, IS_DEV_MACHINE_MACRO.equals(key) ? Boolean.parseBoolean(value) : value)); stringTemplate.add("serverName", portsToRefName.get(port)); return stringTemplate.render(); }
Source:
protected ConsumerRecords<?, ?> consumerPoll(long pollInterval) { if (_enablePartitionAssignment) { if (!_consumerAssignment.isEmpty()) { return _consumer.poll(pollInterval); } else { return ConsumerRecords.EMPTY; } } else { return _consumer.poll(pollInterval); } }

Target:
protected ConsumerRecords<?, ?> consumerPoll(long pollInterval) { if (_enablePartitionAssignment && _consumerAssignment.isEmpty()) { return ConsumerRecords.EMPTY; } else { return _consumer.poll(pollInterval); } }
Source:
public void setup() { ModalFooterOKCancelButtons footer = createModalFooterOKCancelButtons(); footer.enableCancelButton(true); footer.enableOkButton(true); setBody(externalComponentEditor.asWidget()); add(footer); setTitle("Component Editor"); setWidth(1200 + "px"); }

Target:
public void setup() { ModalFooterOKCancelButtons footer = createModalFooterOKCancelButtons(); footer.enableCancelButton(true); footer.enableOkButton(true); setBody(externalComponentEditor.asWidget()); add(footer); setTitle(i18n.componentEditor()); setWidth(1200 + "px"); }
Source:
public void EditHub_001_dashboardSelectVertical(String hubDBName) { WikiBasePageObject base = new WikiBasePageObject(driver); base.logInCookie(credentials.userName, credentials.password, wikiURL); SpecialEditHubPageObject pageObject = base.openSpecialEditHub(urlBuilder.getUrlForWiki(hubDBName)); pageObject.verifyCalendarAppears(); }

Target:
public void EditHub_001_dashboardSelectVertical(String hubDBName) { WikiBasePageObject base = new WikiBasePageObject(driver); base.logInCookie(credentials.userNameStaff, credentials.passwordStaff, wikiURL); SpecialEditHubPageObject pageObject = base.openSpecialEditHub(urlBuilder.getUrlForWiki(hubDBName)); pageObject.verifyCalendarAppears(); }