auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean dispatchKeyEvent(KeyEvent event) { if (event.getAction() == KeyEvent.ACTION_DOWN) { switch (event.getKeyCode()) { case KeyEvent.KEYCODE_PAGE_UP: scroll(true, screenScrollingPercent, smoothScrolling); return true; case KeyEvent.KEYCODE_PAGE_DOWN: scroll(false, screenScrollingPercent, smoothScrolling); return true; case KeyEvent.KEYCODE_CAMERA: disableTouch = !disableTouch; if (disableTouch) { Toast.makeText(this, "Touch screen disabled", Toast.LENGTH_SHORT).show(); } else { Toast.makeText(this, "Touch screen enabled", Toast.LENGTH_SHORT).show(); } Log.d(TAG, "toggling touch screen, now disableTouch is " + disableTouch); return true; } if (volumeButtonsScrolling) { switch (event.getKeyCode()) { case KeyEvent.KEYCODE_VOLUME_UP: scroll(true, screenScrollingPercent, smoothScrolling); return true; case KeyEvent.KEYCODE_VOLUME_DOWN: scroll(false, screenScrollingPercent, smoothScrolling); return true; } } } return super.dispatchKeyEvent(event); }

Target:
public boolean dispatchKeyEvent(KeyEvent event) { if (event.getAction() == KeyEvent.ACTION_DOWN) { int code = event.getKeyCode(); if(code == disableTouchKeyCode && (disableTouch || disableTouchOptionEnabled)) { disableTouch = !disableTouch; settings.setDisableTouchLastState(disableTouch); Log.d(TAG, "toggling touch screen, now disableTouch is " + disableTouch); showDisableTouchToast(); return true; } switch (code) { case KeyEvent.KEYCODE_PAGE_UP: case KeyEvent.KEYCODE_PAGE_DOWN: scroll(code == KeyEvent.KEYCODE_PAGE_UP, screenScrollingPercent, smoothScrolling); return true; case KeyEvent.KEYCODE_VOLUME_UP: case KeyEvent.KEYCODE_VOLUME_DOWN: if (volumeButtonsScrolling) { scroll(code == KeyEvent.KEYCODE_VOLUME_UP, screenScrollingPercent, smoothScrolling); return true; } break; } } return super.dispatchKeyEvent(event); }
Source:
public void build() { for (final DTCellValue52 cell : row) { if (sourceColumnIndex == 1) { xlsRow.createCell(targetColumnIndex) .setCellValue(cell.getStringValue()); } else if (sourceColumnIndex > 1) { final BaseColumn baseColumn = dtable.getExpandedColumns().get(sourceColumnIndex); if (baseColumn instanceof ActionInsertFactCol52) { addActionInsertFirstColumn(); } if (baseColumn instanceof ConditionCol52 && isNullOrNotNull(((ConditionCol52) baseColumn).getOperator())) { xlsRow.createCell(targetColumnIndex) .setCellValue("null"); } else if (isWorkItemColumn()) { if (cell.getBooleanValue() != null && cell.getBooleanValue()) { xlsRow.createCell(targetColumnIndex) .setCellValue("X"); } } else if (dtable.getExpandedColumns().get(sourceColumnIndex) instanceof ActionRetractFactCol52) { if (isNullOrEmpty(cell.getStringValue())) { xlsRow.createCell(targetColumnIndex) .setCellValue(cell.getStringValue()); } } else { setValue(cell, getColumnDataType(sourceColumnIndex)); } } sourceColumnIndex++; targetColumnIndex++; } rowCount++; }

Target:
public void build() { for (final DTCellValue52 cell : row) { if (sourceColumnIndex == 1) { xlsRow.createCell(targetColumnIndex) .setCellValue(cell.getStringValue()); } else if (sourceColumnIndex > 1) { final BaseColumn baseColumn = dtable.getExpandedColumns().get(sourceColumnIndex); if (baseColumn instanceof ActionInsertFactCol52) { addActionInsertFirstColumn(); } if (isOperator("== null") || isOperator("!= null")) { xlsRow.createCell(targetColumnIndex) .setCellValue("null"); } else if (isWorkItemColumn()) { if (cell.getBooleanValue() != null && cell.getBooleanValue()) { xlsRow.createCell(targetColumnIndex) .setCellValue("X"); } } else if (dtable.getExpandedColumns().get(sourceColumnIndex) instanceof ActionRetractFactCol52) { if (!StringUtils.isEmpty(cell.getStringValue())) { xlsRow.createCell(targetColumnIndex) .setCellValue(cell.getStringValue()); } } else { setValue(cell, getColumnDataType(sourceColumnIndex)); } } sourceColumnIndex++; targetColumnIndex++; } rowCount++; }
Source:
protected MasterObjectAxisProvider getMasterObjectAxisProvider(final TableConfiguration configuration) { MasterObjectAxisProvider master = null; if (0 < configuration.getRowAxisProviders().size()) { final Iterator<AbstractAxisProvider> rowAxisProvidersIterator = configuration.getRowAxisProviders().iterator(); while (rowAxisProvidersIterator.hasNext() && null == master) { AbstractAxisProvider axisProvider = rowAxisProvidersIterator.next(); if (axisProvider instanceof MasterObjectAxisProvider) { master = (MasterObjectAxisProvider) axisProvider; } } } return master; }

Target:
protected MasterObjectAxisProvider getMasterObjectAxisProvider(final TableConfiguration configuration) { MasterObjectAxisProvider master = null; if (0 < configuration.getRowAxisProviders().size()) { final Iterator<AbstractAxisProvider> rowAxisProvidersIterator = configuration.getRowAxisProviders().iterator(); while (rowAxisProvidersIterator.hasNext() && null == master) { final AbstractAxisProvider axisProvider = rowAxisProvidersIterator.next(); if (axisProvider instanceof MasterObjectAxisProvider) { master = (MasterObjectAxisProvider) axisProvider; } } } return master; }
Source:
public void test_update_returning_with_asterisk_contains_all_columns_in_returning_clause() { AnalyzedUpdateStatement stmt = e.analyze( "UPDATE users SET name='noam' WHERE ID=1 RETURNING *"); assertThat( stmt.assignmentByTargetCol().keySet(), contains(isReference("name", DataTypes.STRING))); assertThat(stmt.returnValues().size(), is(17)); }

Target:
public void test_update_returning_with_asterisk_contains_all_columns_in_returning_clause() { AnalyzedUpdateStatement stmt = e.analyze( "UPDATE users SET name='noam' RETURNING *"); assertThat( stmt.assignmentByTargetCol().keySet(), contains(isReference("name", DataTypes.STRING))); assertThat(stmt.returnValues().size(), is(17)); }
Source:
public void testSetupLayout() { MarkLogicInputProperties properties = new MarkLogicInputProperties("root"); properties.schema.init(); properties.setupLayout(); Form main = properties.getForm(Form.MAIN); assertThat(main, notNullValue()); Collection<Widget> mainWidgets = main.getWidgets(); assertThat(mainWidgets, hasSize(6)); Widget schemaWidget = main.getWidget("schema"); assertThat(schemaWidget, notNullValue()); Widget fileWidget = main.getWidget("filename"); assertThat(fileWidget, notNullValue()); Widget useCustomDelimiterWidget = main.getWidget("useCustomDelimiter"); assertThat(useCustomDelimiterWidget, notNullValue()); Widget delimiterWidget = main.getWidget("delimiter"); assertThat(delimiterWidget, notNullValue()); Widget customDelimiterWidget = main.getWidget("customDelimiter"); assertThat(customDelimiterWidget, notNullValue()); Widget guessSchemaWidget = main.getWidget("guessSchema"); assertThat(guessSchemaWidget, notNullValue()); }

Target:
public void testSetupLayout() { testInputProperties.connection.init(); testInputProperties.schema.init(); testInputProperties.setupLayout(); Form main = testInputProperties.getForm(Form.MAIN); assertNotNull(main.getWidget(testInputProperties.connection)); assertNotNull(main.getWidget(testInputProperties.criteria)); assertNull(main.getWidget(testInputProperties.maxRetrieve)); assertNull(main.getWidget(testInputProperties.pageSize)); assertNull(main.getWidget(testInputProperties.useQueryOption)); assertNull(main.getWidget(testInputProperties.queryLiteralType)); assertNull(main.getWidget(testInputProperties.queryOptionName)); assertNull(main.getWidget(testInputProperties.queryOptionLiterals)); Form advanced = testInputProperties.getForm(Form.ADVANCED); assertNotNull(advanced.getWidget(testInputProperties.maxRetrieve)); assertNotNull(advanced.getWidget(testInputProperties.pageSize)); assertNotNull(advanced.getWidget(testInputProperties.useQueryOption)); assertNotNull(advanced.getWidget(testInputProperties.queryLiteralType)); assertNotNull(advanced.getWidget(testInputProperties.queryOptionName)); assertNotNull(advanced.getWidget(testInputProperties.queryOptionLiterals)); }
Source:
public void createAssertion_correct() throws IOException { PrivateKey privateKey = ServiceAccountCredentials.privateKeyFromPkcs8(SA_PRIVATE_KEY_PKCS8); List<String> scopes = Arrays.asList("scope1", "scope2"); ServiceAccountCredentials credentials = new ServiceAccountCredentials( SA_CLIENT_ID, SA_CLIENT_EMAIL, privateKey, SA_PRIVATE_KEY_ID, scopes, null, null, SERVICE_ACCOUNT_USER); JsonFactory jsonFactory = OAuth2Utils.JSON_FACTORY; long currentTime = Clock.SYSTEM.currentTimeMillis(); String assertion = credentials.createAssertion(jsonFactory, currentTime); JsonWebSignature signature = JsonWebSignature.parse(jsonFactory, assertion); JsonWebToken.Payload payload = signature.getPayload(); assertEquals(SA_CLIENT_EMAIL, payload.getIssuer()); assertEquals(OAuth2Utils.TOKEN_SERVER_URI.toString(), payload.getAudience()); assertEquals(currentTime / 1000, (long) payload.getIssuedAtTimeSeconds()); assertEquals(currentTime / 1000 + 3600, (long) payload.getExpirationTimeSeconds()); assertEquals(SERVICE_ACCOUNT_USER, payload.getSubject()); assertEquals(Joiner.on(' ').join(scopes), payload.get("scope")); }

Target:
public void createAssertion_correct() throws IOException { PrivateKey privateKey = ServiceAccountCredentials.privateKeyFromPkcs8(SA_PRIVATE_KEY_PKCS8); List<String> scopes = Arrays.asList("scope1", "scope2"); ServiceAccountCredentials credentials = new ServiceAccountCredentials( SA_CLIENT_ID, SA_CLIENT_EMAIL, privateKey, SA_PRIVATE_KEY_ID, scopes, null, null, SERVICE_ACCOUNT_USER); JsonFactory jsonFactory = OAuth2Utils.JSON_FACTORY; long currentTimeMillis = Clock.SYSTEM.currentTimeMillis(); String assertion = credentials.createAssertion(jsonFactory, currentTimeMillis); JsonWebSignature signature = JsonWebSignature.parse(jsonFactory, assertion); JsonWebToken.Payload payload = signature.getPayload(); assertEquals(SA_CLIENT_EMAIL, payload.getIssuer()); assertEquals(OAuth2Utils.TOKEN_SERVER_URI.toString(), payload.getAudience()); assertEquals(currentTimeMillis / 1000, (long) payload.getIssuedAtTimeSeconds()); assertEquals(currentTimeMillis / 1000 + 3600, (long) payload.getExpirationTimeSeconds()); assertEquals(SERVICE_ACCOUNT_USER, payload.getSubject()); assertEquals(Joiner.on(' ').join(scopes), payload.get("scope")); }
Source:
public Loader<AsyncTaskResult<CourseComponent>> onCreateLoader(int id, Bundle args) { return new CourseOutlineAsyncLoader(getActivity().getApplicationContext(), courseData.getCourse().getId()); }

Target:
public Loader<AsyncTaskResult<CourseComponent>> onCreateLoader(int id, Bundle args) { return new CourseOutlineAsyncLoader(getContext(), courseData.getCourse().getId()); }
Source:
public void writeData(ObjectDataOutput out) throws IOException { IOUtil.writeObject(out, key); IOUtil.writeObject(out, value); out.writeLong(cost); out.writeLong(creationTime); out.writeLong(expirationTime); out.writeLong(hits); out.writeLong(lastAccessTime); out.writeLong(lastStoredTime); out.writeLong(lastUpdateTime); out.writeLong(version); out.writeLong(ttl); out.writeBoolean(maxIdle != null); if (maxIdle != null) { out.writeLong(maxIdle); } }

Target:
public void writeData(ObjectDataOutput out) throws IOException { IOUtil.writeObject(out, key); IOUtil.writeObject(out, value); out.writeLong(cost); out.writeLong(creationTime); out.writeLong(expirationTime); out.writeLong(hits); out.writeLong(lastAccessTime); out.writeLong(lastStoredTime); out.writeLong(lastUpdateTime); out.writeLong(version); out.writeLong(ttl); out.writeLong(maxIdle); }
Source:
public static int getDrawableIDFor(FormEntryPrompt fep){ switch(fep.getDataType()){ case Constants.DATATYPE_TEXT: return R.drawable.avatar_vellum_text; case Constants.DATATYPE_INTEGER: return R.drawable.avatar_vellum_integer; case Constants.DATATYPE_DECIMAL: return R.drawable.avatar_vellum_decimal; case Constants.DATATYPE_DATE: return R.drawable.avatar_vellum_date; case Constants.DATATYPE_DATE_TIME: return R.drawable.avatar_vellum_datetime; case Constants.DATATYPE_CHOICE: return R.drawable.avatar_vellum_single_answer; case Constants.DATATYPE_CHOICE_LIST: return R.drawable.avatar_vellum_multi_answer; case Constants.DATATYPE_GEOPOINT: return R.drawable.avatar_vellum_gps; case Constants.DATATYPE_BARCODE: return R.drawable.avatar_vellum_barcode; } return -1; }

Target:
private static int getDrawableIDFor(FormEntryPrompt fep){ switch(fep.getDataType()){ case Constants.DATATYPE_TEXT: return R.drawable.avatar_vellum_text; case Constants.DATATYPE_INTEGER: return R.drawable.avatar_vellum_integer; case Constants.DATATYPE_DECIMAL: return R.drawable.avatar_vellum_decimal; case Constants.DATATYPE_DATE: return R.drawable.avatar_vellum_date; case Constants.DATATYPE_DATE_TIME: return R.drawable.avatar_vellum_datetime; case Constants.DATATYPE_CHOICE: return R.drawable.avatar_vellum_single_answer; case Constants.DATATYPE_CHOICE_LIST: return R.drawable.avatar_vellum_multi_answer; case Constants.DATATYPE_GEOPOINT: return R.drawable.avatar_vellum_gps; case Constants.DATATYPE_BARCODE: return R.drawable.avatar_vellum_barcode; } return -1; }
Source:
public void clearSurveys() { for (File file : surveyFiles) { file.delete(); } adapter.open(); adapter.deleteAllSurveys(); adapter.close(); }

Target:
public void clearSurveys() { for (File file : surveyFiles) { file.delete(); } adapter.open(); adapter.deleteAllSurveys(); adapter.clearCollectedData(); adapter.close(); }
Source:
public void update() throws Exception { Object operatorID = operatorRepository.create(new NewOperator("name", OperatorState.ACTIVE, "description", "dName", "fName", "emergency")); Object roamingGroupID = roamingRepository.create(new NewRoamingGroup("name", "description", RoamingGroupType.REGIONAL)); roamingRepository.assignOperators(new ID(roamingGroupID), Lists.newArrayList(new ID(operatorID))); RoamingGroupRequest newRoamingGroup = new RoamingGroupRequest(new ID(roamingGroupID), "newName", "newDescription", RoamingGroupType.INTERNATIONAL); roamingRepository.update(newRoamingGroup); RoamingGroup got = roamingRepository.findById(new ID(roamingGroupID)).get(); RoamingGroup want = new RoamingGroup( new ID(roamingGroupID), "newName", "newDescription", RoamingGroupType.INTERNATIONAL, Lists.newArrayList(new Operator(new ID(operatorID), "name", OperatorState.ACTIVE, "description", "dName", "fName", "emergency")) ); assertThat(got, deepEquals(want)); }

Target:
public void update() throws Exception { Object operID = operatorRepository.create(new NewOperator("name", OperatorState.ACTIVE, "description", "dName", "fName", "emergency")); Object groupID = roamingRepository.create(new NewRoamingGroup("name", "description", RoamingGroupType.REGIONAL)); roamingRepository.assignOperators(new ID(groupID), Lists.newArrayList(new ID(operID))); RoamingGroupRequest newRoamingGroup = new RoamingGroupRequest(new ID(groupID), "newName", "newDescription", RoamingGroupType.INTERNATIONAL); roamingRepository.update(newRoamingGroup); RoamingGroup got = roamingRepository.findById(new ID(groupID)).get(); RoamingGroup want = new RoamingGroup( new ID(groupID), "newName", "newDescription", RoamingGroupType.INTERNATIONAL, Lists.newArrayList(new Operator(new ID(operID), "name", OperatorState.ACTIVE, "description", "dName", "fName", "emergency")) ); assertThat(got, deepEquals(want)); }
Source:
public void before() { processorListenerState = new HashMap<String, Boolean>() { { put(ON_START, false); put(ON_FAILURE, false); put(ON_SHUTDOWN, false); } }; }

Target:
public void before() { processorListenerState = new ConcurrentHashMap<ListenerCallback, Boolean>() { { put(ListenerCallback.ON_START, false); put(ListenerCallback.ON_FAILURE, false); put(ListenerCallback.ON_SHUTDOWN, false); } }; }
Source:
public String generateAppKeys() throws APIManagerIntegrationTestException { APPKeyRequestGenerator appKeyRequestGenerator = new APPKeyRequestGenerator(TEST_APPLICATION_NAME); HttpResponse keyGenerationResponse = null; try { keyGenerationResponse = apiStore.generateApplicationKey(appKeyRequestGenerator); } catch (APIManagerIntegrationTestException e) { String error = "Error in generating Application Keys"; throw new APIManagerIntegrationTestException(error, e); } log.info("Key generation response for application \'" + TEST_APPLICATION_NAME + "\' response data :" + keyGenerationResponse.getData()); verifyResponse(keyGenerationResponse); JSONObject keyGenerationRespData = new JSONObject(keyGenerationResponse.getData()); accessToken = (keyGenerationRespData.getJSONObject("data").getJSONObject("key")) .get("accessToken").toString(); return accessToken; }

Target:
public String generateAppKeys() throws Exception { APPKeyRequestGenerator appKeyRequestGenerator = new APPKeyRequestGenerator(TEST_APPLICATION_NAME); HttpResponse keyGenerationResponse = null; keyGenerationResponse = apiStore.generateApplicationKey(appKeyRequestGenerator); log.info("Key generation response for application \'" + TEST_APPLICATION_NAME + "\' response data :" + keyGenerationResponse.getData()); verifyResponse(keyGenerationResponse); JSONObject keyGenerationRespData = new JSONObject(keyGenerationResponse.getData()); accessToken = (keyGenerationRespData.getJSONObject("data").getJSONObject("key")) .get("accessToken").toString(); return accessToken; }
Source:
public void testCreate() { CreateStorageServiceParams storage = api().create(NAME, LOCATION, ImmutableMap.of("property_name", "property_value"), ImmutableMap.of("accountType", StorageService.AccountType.Standard_ZRS.toString())); while (storage == null) { try { Thread.sleep(25 * 1000); } catch (InterruptedException e) { e.printStackTrace(); } storage = api().create(NAME, LOCATION, ImmutableMap.of("property_name", "property_value"), ImmutableMap.of("accountType", StorageService.AccountType.Standard_ZRS.toString())); } assertEquals(storage.location(), LOCATION); assertTrue(!storage.properties().isEmpty()); }

Target:
public void testCreate() { URI uri = api().create(NAME, LOCATION, ImmutableMap.of("property_name", "property_value"), ImmutableMap.of("accountType", StorageService.AccountType.Standard_LRS.toString())); if (uri != null){ assertTrue(uri.toString().contains("api-version")); boolean jobDone = Predicates2.retry(new Predicate<URI>() { @Override public boolean apply(URI uri) { return ParseJobStatus.JobStatus.DONE == api.getJobApi().jobStatus(uri); } }, 60 * 1 * 1000 ).apply(uri); assertTrue(jobDone, "create operation did not complete in the configured timeout"); } final StorageService service = api().get(NAME); assertNotNull(service); assertEquals(service.location(), LOCATION); assertNotNull(service.storageServiceProperties().creationTime()); }
Source:
private boolean performSecondaryAction() { if (UploadService.hasInProgressMediaUploadsForPost(mEditPostRepository.getPost())) { ToastUtils.showToast(EditPostActivity.this, getString(R.string.editor_toast_uploading_please_wait), Duration.SHORT); return false; } if (isDiscardable()) { showEmptyPostErrorForSecondaryAction(); return false; } switch (getSecondaryAction()) { case SAVE_AS_DRAFT: saveAsDraft(); return true; case SAVE: uploadPost(false); return true; case PUBLISH_NOW: showPrepublishingNudgeBottomSheetBeforePostUpload(); return true; case NONE: throw new IllegalStateException("Switch in `secondaryAction` shouldn't go through the NONE case"); } return false; }

Target:
private boolean performSecondaryAction() { if (UploadService.hasInProgressMediaUploadsForPost(mEditPostRepository.getPost())) { ToastUtils.showToast(EditPostActivity.this, getString(R.string.editor_toast_uploading_please_wait), Duration.SHORT); return false; } if (isDiscardable()) { showEmptyPostErrorForSecondaryAction(); return false; } switch (getSecondaryAction()) { case SAVE_AS_DRAFT: saveAsDraft(); return true; case SAVE: uploadPost(false); return true; case PUBLISH_NOW: showPrepublishingNudgeBottomSheet(); return true; case NONE: throw new IllegalStateException("Switch in `secondaryAction` shouldn't go through the NONE case"); } return false; }
Source:
public void showPleaseRateDialog() { new MaterialDialog.Builder(this) .content(R.string.please_rate) .negativeText(R.string.no_im_good) .positiveText(R.string.will_rate) .onPositive((dialog, which) -> { Uri uri = Uri.parse("market://details?id=" + getApplicationContext().getPackageName()); Intent intent = new Intent(Intent.ACTION_VIEW, uri); if (!(getPackageManager().queryIntentActivities(intent, 0).size() > 0)) { UIUtils.showSnackbar(parent, getString(R.string.play_store_error)); return; } startActivity(intent); }) .show(); }

Target:
public void showPleaseRateDialog() { new MaterialDialog.Builder(this) .content(R.string.please_rate) .negativeText(R.string.no_im_good) .positiveText(R.string.will_rate) .onPositive((dialog, which) -> { Uri uri = Uri.parse("market://details?id=" + getPackageName()); Intent intent = new Intent(Intent.ACTION_VIEW, uri); if (!(getPackageManager().queryIntentActivities(intent, 0).size() > 0)) { UIUtils.showSnackbar(parent, getString(R.string.play_store_error)); return; } startActivity(intent); }) .show(); }
Source:
void handleApplyTransactionFailure(RaftGroupId groupId, RaftProtos.RaftPeerRole role) { UUID dnId = RatisHelper.toDatanodeId(getServer().getId()); String msg = "Ratis Transaction failure in datanode" + dnId + " with role " + role + " Triggering pipeline close action."; triggerPipelineClose(groupId, msg, ClosePipelineInfo.Reason.PIPELINE_FAILED, false); stop(); }

Target:
void handleApplyTransactionFailure(RaftGroupId groupId, RaftProtos.RaftPeerRole role) { UUID dnId = RatisHelper.toDatanodeId(getServer().getId()); String msg = "Ratis Transaction failure in datanode " + dnId + " with role " + role + " .Triggering pipeline close action."; triggerPipelineClose(groupId, msg, ClosePipelineInfo.Reason.STATEMACHINE_TRANSACTION_FAILED, true); }
Source:
private Unloaded<?> make(TypePool typePool, DynamicType.Builder<?> builder) { classRewriter.installReflectionMethodVisitors( builder ); Unloaded<?> unloadedClass; if ( typePool != null ) { unloadedClass = builder.make( typePool ); } else { unloadedClass = builder.make(); } if ( DEBUG ) { try { unloadedClass.saveIn( new File( System.getProperty( "java.io.tmpdir" ) + "/bytebuddy/" ) ); } catch (IOException e) { LOG.warn( "Unable to save generated class %1$s", unloadedClass.getTypeDescription().getName(), e ); } } classRewriter.registerAuthorizedClass( unloadedClass.getTypeDescription().getName() ); return unloadedClass; }

Target:
private Unloaded<?> make(TypePool typePool, DynamicType.Builder<?> builder) { classRewriter.installReflectionMethodVisitors( builder ); Unloaded<?> unloadedClass; if ( typePool != null ) { unloadedClass = builder.make( typePool ); } else { unloadedClass = builder.make(); } if ( DEBUG ) { try { unloadedClass.saveIn( new File( System.getProperty( "java.io.tmpdir" ) + "/bytebuddy/" ) ); } catch (IOException e) { LOG.warn( "Unable to save generated class %1$s", unloadedClass.getTypeDescription().getName(), e ); } } classRewriter.registerAuthorizedClass( unloadedClass ); return unloadedClass; }
Source:
public static String deleteFileList(final Iterable<Path> files) { if (Iterables.isEmpty(files)) { return "No matching recovery files found."; } final StringBuffer fileList = new StringBuffer("Deleted:\n"); try { for (Path file : files) { final RecoveryJob job = getRecoveryJobByName(file.getFileName().toString()); Files.delete(file); fileList.append(job.toString()); fileList.append("\n"); } return fileList.toString(); } catch (final IOException e) { return e.getMessage(); } }

Target:
public static String deleteFileList(final Iterable<Path> files) { if (Iterables.isEmpty(files)) { return "No matching recovery files found."; } final StringBuffer fileList = new StringBuffer("Deleted:\n"); try { for (final Path file : files) { final RecoveryJob job = getRecoveryJobByName(file.getFileName().toString()); Files.delete(file); fileList.append(job.toString()); fileList.append("\n"); } return fileList.toString(); } catch (final IOException e) { return e.getMessage(); } }
Source:
BlockOutputStreamEntry allocateBlockIfNeeded() throws IOException { BlockOutputStreamEntry streamEntry = getCurrentStreamEntry(); if (streamEntry != null && streamEntry.isClosed()) { currentStreamIndex++; } if (streamEntries.size() <= currentStreamIndex) { Preconditions.checkNotNull(omClient); int succeededAllocates = 0; try { allocateNewBlock(); succeededAllocates += 1; } catch (IOException ioe) { LOG.error("Try to allocate more blocks for write failed, already " + "allocated " + succeededAllocates + " blocks for this write.", ioe); throw ioe; } } Preconditions.checkArgument(currentStreamIndex < streamEntries.size()); BlockOutputStreamEntry current = streamEntries.get(currentStreamIndex); return current; }

Target:
BlockOutputStreamEntry allocateBlockIfNeeded() throws IOException { BlockOutputStreamEntry streamEntry = getCurrentStreamEntry(); if (streamEntry != null && streamEntry.isClosed()) { currentStreamIndex++; } if (streamEntries.size() <= currentStreamIndex) { Preconditions.checkNotNull(omClient); int succeededAllocates = 0; try { allocateNewBlock(); succeededAllocates += 1; } catch (IOException ioe) { LOG.error("Try to allocate more blocks for write failed, already " + "allocated blocks for this write.", succeededAllocates, ioe); throw ioe; } } Preconditions.checkArgument(currentStreamIndex < streamEntries.size()); BlockOutputStreamEntry current = streamEntries.get(currentStreamIndex); return current; }
Source:
public Class<?>[] getParameterTypes() { return SuspendMethod.trimSuspendParameterTypes(method.getParameterTypes()); }

Target:
public Class<?>[] getParameterTypes() { return parameterTypes; }
Source:
public void addChangeListener(ChangeListener listener, IdentifiedUser user) { ChangeListenerHolder holder = new ChangeListenerHolder(listener, user); listeners.put(listener, holder); }

Target:
public void addChangeListener(ChangeListener listener, IdentifiedUser user) { listeners.put(listener, new ChangeListenerHolder(listener, user)); }
Source:
UsageCapacityInArrearDetail computeToBeBilledCapacityInArrear(final List<RolledUpUnit> roUnits) throws CatalogApiException { Preconditions.checkState(isBuilt.get()); final List<Tier> tiers = getCapacityInArrearTier(usage); final Set<String> perUnitTypeDetailTierLevel = new HashSet<String>(); int tierNum = 0; final List<UsageInArrearTierUnitDetail> toBeBilledDetails = Lists.newLinkedList(); for (final Tier cur : tiers) { tierNum++; boolean complies = true; for (final RolledUpUnit ro : roUnits) { final Limit tierLimit = getTierLimit(cur, ro.getUnitType()); if (tierLimit.getMax() != (double) -1 && ro.getAmount().doubleValue() > tierLimit.getMax()) { complies = false; } else { if (!perUnitTypeDetailTierLevel.contains(ro.getUnitType())) { toBeBilledDetails.add(new UsageConsumableInArrearTierUnitDetail(tierNum, ro.getUnitType(), cur.getRecurringPrice().getPrice(getCurrency()), 1, ro.getAmount().intValue(), BigDecimal.ZERO)); perUnitTypeDetailTierLevel.add(ro.getUnitType()); } } } if (complies) { return new UsageCapacityInArrearDetail(toBeBilledDetails, cur.getRecurringPrice().getPrice(getCurrency())); } } final Joiner joiner = Joiner.on(", "); joiner.join(roUnits); Preconditions.checkState(false, "Could not find tier for usage " + usage.getName() + "matching with data = " + joiner.join(roUnits)); return null; }

Target:
UsageCapacityInArrearDetail computeToBeBilledCapacityInArrear(final List<RolledUpUnit> roUnits) throws CatalogApiException { Preconditions.checkState(isBuilt.get()); final List<Tier> tiers = getCapacityInArrearTier(usage); final Set<String> perUnitTypeDetailTierLevel = new HashSet<String>(); int tierNum = 0; final List<UsageInArrearTierUnitDetail> toBeBilledDetails = Lists.newLinkedList(); for (final Tier cur : tiers) { tierNum++; boolean complies = true; for (final RolledUpUnit ro : roUnits) { final Limit tierLimit = getTierLimit(cur, ro.getUnitType()); if (tierLimit.getMax() != (double) -1 && ro.getAmount().doubleValue() > tierLimit.getMax()) { complies = false; } else { if (!perUnitTypeDetailTierLevel.contains(ro.getUnitType())) { toBeBilledDetails.add(new UsageInArrearTierUnitDetail(tierNum, ro.getUnitType(), cur.getRecurringPrice().getPrice(getCurrency()), ro.getAmount().intValue())); perUnitTypeDetailTierLevel.add(ro.getUnitType()); } } } if (complies) { return new UsageCapacityInArrearDetail(toBeBilledDetails, cur.getRecurringPrice().getPrice(getCurrency())); } } joiner.join(roUnits); Preconditions.checkState(false, "Could not find tier for usage " + usage.getName() + "matching with data = " + joiner.join(roUnits)); return null; }
Source:
public int compare(String a, String b) { boolean aDigits = isAllDigits(a); boolean bDigits = isAllDigits(b); if (aDigits && bDigits) { return Integer.compare(Integer.parseInt(a), Integer.parseInt(b)); } else if (aDigits) { return -1; } else if (bDigits) { return 1; } else { return a.compareTo(b); } }

Target:
public int compare(String a, String b) { boolean aDigits = isAllDigits(a); boolean bDigits = isAllDigits(b); if (aDigits && bDigits) { return new BigInteger(a).compareTo(new BigInteger(b)); } else if (aDigits) { return -1; } else if (bDigits) { return 1; } else { return a.compareTo(b); } }
Source:
public FeedRegistryHandler() { try { registry = ServiceReferenceHolder.getInstance().getRegistry(); } catch (RegistryException e) { log.error(e.getMessage()); } }

Target:
public FeedRegistryHandler() { try { registry = ServiceReferenceHolder.getInstance().getRegistry(); } catch (RegistryException e) { log.error("error while handle with registry", e); } }
Source:
private static Proxy defaultProxy() { return new Proxy( Proxy.Type.HTTP, new InetSocketAddress( System.getProperties().getProperty("https.proxyHost"), Integer.parseInt(System.getProperties().getProperty("https.proxyPort")))); }

Target:
private static Proxy defaultProxy() { return new Proxy( Proxy.Type.HTTP, new InetSocketAddress( System.getProperty("https.proxyHost"), Integer.parseInt(System.getProperty("https.proxyPort")))); }
Source:
public static int getConsumerAddressNum(String serviceUniqueName) { int count = 0; Set<ConsumerInvokerWrapper> providerInvokerWrapperSet = ProviderConsumerRegTable.getConsumerInvoker(serviceUniqueName); for (ConsumerInvokerWrapper consumerInvokerWrapper : providerInvokerWrapperSet) { int addNum = 0; if (consumerInvokerWrapper.getRegistryDirectory().getUrlInvokerMap() != null) { addNum = consumerInvokerWrapper.getRegistryDirectory().getUrlInvokerMap().size(); } count += addNum; } return count; }

Target:
public static int getConsumerAddressNum(String serviceUniqueName) { Set<ConsumerInvokerWrapper> providerInvokerWrapperSet = ProviderConsumerRegTable.getConsumerInvoker(serviceUniqueName); return providerInvokerWrapperSet.stream() .map(w -> w.getRegistryDirectory().getUrlInvokerMap()) .filter(Objects::nonNull) .mapToInt(Map::size).sum(); }
Source:
public void testSyncWithPOSTAndURLEncoded(){ syncUrl.setSyncScheme(new SyncScheme()); MessageSyncHttpClient client = new MessageSyncHttpClient( getContext(), syncUrl, msg, "777777777", "21" ); HttpUriRequest req = null; try { req = client.getRequest(); } catch (Exception e) assertNotNull(req); assertEquals(HttpPost.class.getCanonicalName(),req.getClass().getCanonicalName()); HttpEntity entity = ((HttpPost) req).getEntity(); assertNotNull(entity); assertEquals(UrlEncodedFormEntity.class.getCanonicalName(),entity.getClass().getCanonicalName()); }

Target:
public void testSyncWithPOSTAndURLEncoded(){ syncUrl.setSyncScheme(new SyncScheme()); MessageSyncHttpClient client = new MessageSyncHttpClient( getContext(), syncUrl, msg, toNumber, deviceId ); HttpUriRequest req = null; try { req = client.getRequest(); } catch (Exception e) assertNotNull(req); assertEquals(HttpPost.class.getCanonicalName(),req.getClass().getCanonicalName()); HttpEntity entity = ((HttpPost) req).getEntity(); assertNotNull(entity); assertEquals(UrlEncodedFormEntity.class.getCanonicalName(),entity.getClass().getCanonicalName()); }
Source:
public boolean isOpeningQuote(HighlighterIterator iterator, int offset) { if(iterator.getTokenType() == ErlangTypes.ERL_SINGLE_QUOTE) { iterator.retreat(); boolean isAtomBefore = !iterator.atEnd() && iterator.getTokenType().equals(ErlangTypes.ERL_ATOM_NAME); iterator.retreat(); boolean atomStartsFromQuote = !iterator.atEnd() && iterator.getTokenType().equals(ErlangTypes.ERL_SINGLE_QUOTE); iterator.advance(); iterator.advance(); return !isAtomBefore || !atomStartsFromQuote; } return super.isOpeningQuote(iterator, offset); }

Target:
public boolean isOpeningQuote(HighlighterIterator iterator, int offset) { if(iterator.getTokenType() == ErlangTypes.ERL_SINGLE_QUOTE) { iterator.retreat(); boolean isAtomBefore = !iterator.atEnd() && iterator.getTokenType() == ErlangTypes.ERL_ATOM_NAME; iterator.retreat(); boolean atomStartsFromQuote = !iterator.atEnd() && iterator.getTokenType() == ErlangTypes.ERL_SINGLE_QUOTE; iterator.advance(); iterator.advance(); return !isAtomBefore || !atomStartsFromQuote; } return super.isOpeningQuote(iterator, offset); }
Source:
protected synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException { Class<?> result = loadedClasses.get(name); if (result==null) throw new ClassNotFoundException(""+name+" not known here"); return result; }

Target:
protected synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException { Class<?> result = loadedClasses.get(name); if (result==null) throw new ClassNotFoundException(""+name+" not known here"); if (resolve) resolveClass(result); return result; }
Source:
public void testCreateLongVarChar() throws Exception { SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder(); builder.setName(tname("ft2")); builder.setNamespaceURI(dataStore.getNamespaceURI()); builder.setCRS(DefaultGeographicCRS.WGS84); builder.add(aname("geometry_one_two_three_four"), Geometry.class); builder.add(aname("longvar"), String.class); SimpleFeatureType featureType = builder.buildFeatureType(); dataStore.createSchema(featureType); SimpleFeatureBuilder fBuilder = new SimpleFeatureBuilder(featureType); fBuilder.add(null); StringBuffer vBuffer = new StringBuffer(4000); for(int i=0;i<3999;i++) { vBuffer.append("x"); } fBuilder.add(vBuffer.toString()); }

Target:
public void testCreateLongVarChar() throws Exception { SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder(); builder.setName(tname("ft3")); builder.setNamespaceURI(dataStore.getNamespaceURI()); builder.setCRS(DefaultGeographicCRS.WGS84); builder.add(aname("geometry_one_two_three_four"), Geometry.class); builder.add(aname("longvar"), String.class); SimpleFeatureType featureType = builder.buildFeatureType(); dataStore.createSchema(featureType); SimpleFeatureBuilder fBuilder = new SimpleFeatureBuilder(featureType); fBuilder.add(null); StringBuffer vBuffer = new StringBuffer(4000); for (int i = 0; i < 3999; i++) { vBuffer.append("x"); } fBuilder.add(vBuffer.toString()); SimpleFeature f = fBuilder.buildFeature(null); Transaction transaction = new DefaultTransaction("create"); SimpleFeatureSource featureSource = dataStore.getFeatureSource(featureType.getName().getLocalPart()); SimpleFeatureCollection collection = DataUtilities.collection(f); SimpleFeatureStore outStore = (SimpleFeatureStore) featureSource; outStore.setTransaction(transaction); try { List<FeatureId> ids = outStore.addFeatures(collection); transaction.commit(); } catch (Exception problem) { problem.printStackTrace(); transaction.rollback(); } finally { transaction.close(); } }
Source:
public void testGetRegionServers() throws Exception { List<ServerName> serverNames = new ArrayList<>(ADMIN.getRegionServers(true)); Assert.assertEquals(3, serverNames.size()); List<ServerName> serversToDecom = new ArrayList<>(); ServerName serverToDecommission = serverNames.get(0); serversToDecom.add(serverToDecommission); ADMIN.decommissionRegionServers(serversToDecom, false); waitForServerDecom(serverToDecommission, true); Assert.assertEquals(2, ADMIN.getRegionServers(true).size()); ADMIN.recommissionRegionServer(serverToDecommission, Collections.emptyList()); Assert.assertEquals(3, ADMIN.getRegionServers(true).size()); waitForServerDecom(serverToDecommission, false); }

Target:
public void testGetRegionServers() throws Exception { List<ServerName> serverNames = new ArrayList<>(ADMIN.getRegionServers(true)); Assert.assertEquals(3, serverNames.size()); List<ServerName> serversToDecom = new ArrayList<>(); ServerName serverToDecommission = serverNames.get(0); serversToDecom.add(serverToDecommission); ADMIN.decommissionRegionServers(serversToDecom, false); waitForServerCommissioned(serverToDecommission, true); Assert.assertEquals(2, ADMIN.getRegionServers(true).size()); Assert.assertEquals(3, ADMIN.getRegionServers(false).size()); ADMIN.recommissionRegionServer(serverToDecommission, Collections.emptyList()); waitForServerCommissioned(null, false); Assert.assertEquals(3, ADMIN.getRegionServers(true).size()); Assert.assertEquals(3, ADMIN.getRegionServers(false).size()); }
Source:
public void pressKeyCodeWithMetastateTest() { try { driver.pressKey(new KeyEvent(AndroidKey.SPACE) .withMetaModifier(KeyEventMetaModifier.SHIFT_ON)); } catch (WebDriverException e) { fail(e.getMessage()); } }

Target:
public void pressKeyCodeWithMetastateTest() { driver.pressKey(new KeyEvent(AndroidKey.SPACE) .withMetaModifier(KeyEventMetaModifier.SHIFT_ON)); final String state = driver.findElement(PRESS_RESULT_VIEW).getText(); assertThat(state, containsString(String.format("KEYCODE_%s", AndroidKey.SPACE.name()))); assertThat(state, containsString(String.format("META_%s", KeyEventMetaModifier.SHIFT_ON.name()))); }
Source:
private void doOperationComplete(Channel channel) { if (!channel.isActive()) { this.fail(CHANNEL_CLOSED_ON_ACQUIRE); return; } final ChannelPipeline pipeline = channel.pipeline(); checkState(pipeline != null, "expected non-null channel pipeline"); final RntbdRequestManager requestManager = pipeline.get(RntbdRequestManager.class); checkState(requestManager != null, "expected non-null request manager"); if (requestManager.hasRequestedRntbdContext()) { this.originalPromise.setSuccess(channel); } else { channel.writeAndFlush(RntbdHealthCheckRequest.MESSAGE).addListener(completed -> { if (completed.isSuccess()) { reportIssueUnless( logger, this.acquired && requestManager.hasRntbdContext(), this, "acquired: {}, rntbdContext: {}", this.acquired, requestManager.rntbdContext()); this.originalPromise.setSuccess(channel); } else { final Throwable cause = completed.cause(); logger.warn("Channel({}) health check request failed due to:", channel, cause); this.fail(cause); } }); } }

Target:
private void doOperationComplete(Channel channel) { checkState(channel.eventLoop().inEventLoop()); if (!channel.isActive()) { this.fail(CHANNEL_CLOSED_ON_ACQUIRE); return; } final ChannelPipeline pipeline = channel.pipeline(); checkState(pipeline != null, "expected non-null channel pipeline"); final RntbdRequestManager requestManager = pipeline.get(RntbdRequestManager.class); checkState(requestManager != null, "expected non-null request manager"); if (requestManager.hasRequestedRntbdContext()) { this.originalPromise.setSuccess(channel); } else { channel.writeAndFlush(RntbdHealthCheckRequest.MESSAGE).addListener(completed -> { if (completed.isSuccess()) { reportIssueUnless( logger, this.acquired && requestManager.hasRntbdContext(), this, "acquired: {}, rntbdContext: {}", this.acquired, requestManager.rntbdContext()); this.originalPromise.setSuccess(channel); } else { final Throwable cause = completed.cause(); logger.warn("Channel({}) health check request failed due to:", channel, cause); this.fail(cause); } }); } }
Source:
private void checkTokenResult(TenantOrDomainAndCredentials<?> credentials, String json) throws InterruptedException { server.enqueue(jsonResponse("/v3/token.json")); AuthInfo authInfo = null; if (credentials.credentials() instanceof PasswordCredentials) { authInfo = authenticationApi .authenticatePassword((TenantOrDomainAndCredentials<PasswordCredentials>) credentials); } else if (credentials.credentials() instanceof TokenCredentials) { authInfo = authenticationApi.authenticateToken((TenantOrDomainAndCredentials<TokenCredentials>) credentials); } else if (credentials.credentials() instanceof ApiAccessKeyCredentials) { authInfo = authenticationApi .authenticateAccessKey((TenantOrDomainAndCredentials<ApiAccessKeyCredentials>) credentials); } else { throw new InterruptedException(String.format("Unsupported authentication method with class: %s", credentials.credentials().getClass().getName())); } assertTrue(authInfo instanceof Token); assertEquals(authInfo, tokenFromResource("/v3/token.json")); assertEquals(server.getRequestCount(), 1); assertSent(server, "POST", "/auth/tokens", stringFromResource(json)); }

Target:
private void checkTokenResult(TenantOrDomainAndCredentials<?> credentials, String json) throws InterruptedException { server.enqueue(jsonResponse("/v3/token.json")); AuthInfo authInfo = null; if (credentials.credentials() instanceof PasswordCredentials) { authInfo = authenticationApi .authenticatePassword((TenantOrDomainAndCredentials<PasswordCredentials>) credentials); } else if (credentials.credentials() instanceof TokenCredentials) { authInfo = authenticationApi.authenticateToken((TenantOrDomainAndCredentials<TokenCredentials>) credentials); } else if (credentials.credentials() instanceof ApiAccessKeyCredentials) { authInfo = authenticationApi .authenticateAccessKey((TenantOrDomainAndCredentials<ApiAccessKeyCredentials>) credentials); } else { throw new IllegalArgumentException(String.format("Unsupported authentication method with class: %s", credentials.credentials().getClass().getName())); } assertTrue(authInfo instanceof Token); assertEquals(authInfo, tokenFromResource("/v3/token.json")); assertEquals(server.getRequestCount(), 1); assertSent(server, "POST", "/auth/tokens", stringFromResource(json)); }
Source:
public Collection<BeanArchiveBuilder> scan() { URLHandler handler = null; int idCounter = 0; boolean jandexEnabled = isJandexEnabled(); for (String resourceName : resources) { for (URL url : resourceLoader.getResources(resourceName)) { if (jandexEnabled) { Class<?> clazz = Reflections.loadClass(JANDEX_ENABLED_FS_URL_HANDLER_CLASS_STRING, resourceLoader); try { handler = (URLHandler) clazz.getConstructor(String.class, Bootstrap.class).newInstance(String.valueOf(idCounter++), bootstrap); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } catch (NoSuchMethodException e) { e.printStackTrace(); } catch (SecurityException e) { e.printStackTrace(); } } else { handler = new FileSystemURLHandler(String.valueOf(idCounter++), bootstrap); } try { BeanArchiveBuilder builder = handler.handle(getUrlPath(resourceName, url)); builders.add(builder); } catch (URISyntaxException e) { log.warn("could not read: " + resourceName, e); } } } return builders; }

Target:
public Collection<BeanArchiveBuilder> scan() { URLHandler handler = null; for (String resourceName : resources) { for (URL url : resourceLoader.getResources(resourceName)) { if (Reflections.isClassLoadable(Weld.JANDEX_INDEX_CLASS, resourceLoader)) { Class<?> clazz = Reflections.loadClass(JANDEX_ENABLED_FS_URL_HANDLER_CLASS_STRING, resourceLoader); try { handler = (URLHandler) clazz.getConstructor(String.class, Bootstrap.class).newInstance(getUrlPath(resourceName, url).toString(), bootstrap); } catch (Exception ex) { throw new IllegalStateException(UNABLE_TO_CREATE_JANDEX_URL_HANDLER, ex); } } else { try { handler = new FileSystemURLHandler(getUrlPath(resourceName, url), bootstrap); } catch (URISyntaxException e) { throw new IllegalStateException(BAD_URI_SYNTAX_EXCEPTION_TEXT + resourceName, e); } } try { BeanArchiveBuilder builder = handler.handle(getUrlPath(resourceName, url)); builders.add(builder); } catch (URISyntaxException e) { throw new IllegalStateException(BAD_URI_SYNTAX_EXCEPTION_TEXT + resourceName, e); } } } return builders; }
Source:
public ModifyStandingOrderRequest(StandingOrder modifiedStandingOrder) { this.setStandingOrderId(modifiedStandingOrder.getStandingOrderId()); this.setAmount(modifiedStandingOrder.getAmount()); this.setName(modifiedStandingOrder.getName()); this.setPurpose(modifiedStandingOrder.getPurposeText()); this.setInterval(modifiedStandingOrder.getInterval()); this.setExecutionDay(modifiedStandingOrder.getExecutionDay()); this.setFirst_execution_date(modifiedStandingOrder.getFirst_execution_date()); this.setLast_execution_date(modifiedStandingOrder.getLast_execution_date()); }

Target:
public ModifyStandingOrderRequest(StandingOrder modifiedStandingOrder) { this.setStandingOrderId(modifiedStandingOrder.getStandingOrderId()); this.setAmount(modifiedStandingOrder.getAmount()); this.setName(modifiedStandingOrder.getName()); this.setPurpose(modifiedStandingOrder.getPurposeText()); this.setInterval(modifiedStandingOrder.getInterval()); this.setExecutionDay(modifiedStandingOrder.getExecutionDay()); this.setFirstExecutionDate(modifiedStandingOrder.getFirstExecutionDate()); this.setLastExecutionDate(modifiedStandingOrder.getLastExecutionDate()); }
Source:
public Fails(EngineMessage expected, String... variableReplacements) { matcher = allOf( not(isValid()), new WithMessages(expected), hasVariableReplacements(variableReplacements)); }

Target:
public Fails(EngineMessage expected, String... variableReplacements) { this(Collections.singletonList(expected), variableReplacements); }
Source:
public ServiceModel generateService(ApiService service, ApiServiceConfig serviceConfig, ApiRole role, ApiConfigList roleConfig) { String hostname = role.getHostRef().getHostname(); String scheme; String port = getRoleConfigValue(roleConfig, "phoenix_query_server_port"); scheme = "http"; return createServiceModel(String.format(Locale.getDefault(), "%s://%s:%s", scheme, hostname, port)); }

Target:
public ServiceModel generateService(ApiService service, ApiServiceConfig serviceConfig, ApiRole role, ApiConfigList roleConfig) { String hostname = role.getHostRef().getHostname(); String scheme = "http"; String port = getRoleConfigValue(roleConfig, "phoenix_query_server_port"); return createServiceModel(String.format(Locale.getDefault(), "%s://%s:%s", scheme, hostname, port)); }
Source:
private HttpURLConnection openConnection(URL url) throws IOException { return (HttpURLConnection) url.openConnection(); }

Target:
private static HttpURLConnection openConnection(URL url) throws IOException { return (HttpURLConnection) url.openConnection(); }
Source:
public void postStop() { if (!fsm.state().equals(uninitialized)) { if(logger.isInfoEnabled()) { logger.info("Conference: " + self().path() + "At the postStop() method."); } if(conferenceApiClient != null && !conferenceApiClient.isTerminated()) getContext().stop(conferenceApiClient); getContext().stop(self()); } super.postStop(); }

Target:
public void postStop() { if (!fsm.state().equals(uninitialized)) { if(logger.isInfoEnabled()) { logger.info("Conference: " + self().path() + "At the postStop() method."); } if(callApiClient != null && !callApiClient.isTerminated()) getContext().stop(callApiClient); getContext().stop(self()); } super.postStop(); }
Source:
protected final CreateImageUploadUrlAjaxPageData getCreateImageUploadUrlPageData() { verifyPrivileges(); CreateImageUploadUrlAjaxPageData data = new CreateImageUploadUrlAjaxPageData(account); try { data.nextUploadUrl = getUploadUrl(); data.ajaxStatus = "Image upload url created, proceed to uploading"; } catch (BlobstoreFailureException | IllegalArgumentException e) { data.nextUploadUrl = null; isError = true; data.ajaxStatus = "An error occurred when creating upload URL, please try again"; } return data; }

Target:
protected final CreateImageUploadUrlAjaxPageData getCreateImageUploadUrlPageData() { CreateImageUploadUrlAjaxPageData data = new CreateImageUploadUrlAjaxPageData(account); try { data.nextUploadUrl = getUploadUrl(); data.ajaxStatus = "Image upload url created, proceed to uploading"; } catch (BlobstoreFailureException | IllegalArgumentException e) { data.nextUploadUrl = null; isError = true; data.ajaxStatus = "An error occurred when creating upload URL, please try again"; } return data; }
Source:
public AtomicHashMap() { this(new FastCopyHashMap<>(), ProxyMode.NONE); }

Target:
public AtomicHashMap() { this(new FastCopyHashMap<>(), ProxyMode.COARSE); }