auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public boolean performNextOperation(int completedChildCount) { if (getParameters().getStage() == CopyStage.DEST_CREATION) { updateStage(CopyStage.DATA_COPY); if (getParameters().isCollapse()) { CopyDataCommandParameters parameters = new CopyDataCommandParameters(getParameters().getStoragePoolId(), buildImageLocationInfo(getParameters().getDestDomain(), getParameters().getDestImageGroupId(), <START> getParameters().getDestinationImageId()), <END> buildImageLocationInfo(getParameters().getSrcDomain(), getParameters().getImageGroupID(), getParameters().getImageId()), true); parameters.setEndProcedure(EndProcedure.COMMAND_MANAGED); parameters.setParentCommand(getActionType()); parameters.setParentParameters(getParameters()); runInternalAction(VdcActionType.CopyData, parameters); } else { CopyImageGroupVolumesDataCommandParameters p = new CopyImageGroupVolumesDataCommandParameters( getParameters().getStoragePoolId(), getParameters().getSrcDomain(), getParameters().getImageGroupID(), getParameters().getDestDomain(), getActionType(), getParameters() ); p.setEndProcedure(EndProcedure.COMMAND_MANAGED); runInternalAction(VdcActionType.CopyImageGroupVolumesData, p); } return true; } return false; }</code><technical_language>change order in ctor source is dest :)</technical_language>

Target:
public boolean performNextOperation(int completedChildCount) { if (getParameters().getStage() == CopyStage.DEST_CREATION) { updateStage(CopyStage.DATA_COPY); if (getParameters().isCollapse()) { CopyDataCommandParameters parameters = new CopyDataCommandParameters(getParameters().getStoragePoolId(), buildImageLocationInfo(getParameters().getSrcDomain(), getParameters().getImageGroupID(), getParameters().getImageId()), buildImageLocationInfo(getParameters().getDestDomain(), getParameters().getDestImageGroupId(), getParameters().getDestinationImageId()), true); parameters.setEndProcedure(EndProcedure.COMMAND_MANAGED); parameters.setParentCommand(getActionType()); parameters.setParentParameters(getParameters()); runInternalAction(VdcActionType.CopyData, parameters); } else { CopyImageGroupVolumesDataCommandParameters p = new CopyImageGroupVolumesDataCommandParameters( getParameters().getStoragePoolId(), getParameters().getSrcDomain(), getParameters().getImageGroupID(), getParameters().getDestDomain(), getActionType(), getParameters() ); p.setEndProcedure(EndProcedure.COMMAND_MANAGED); runInternalAction(VdcActionType.CopyImageGroupVolumesData, p); } return true; } return false; }
Source:
<code>public void textBoxKeyPress(final TextBoxWidget tbwe) { if (getDataObject() != null) { _ignoreChanges = true; try { if (tbwe == getPosAngleTextBox()) { final double defaultPositionAngle = 0.0; getDataObject().setPosAngleDegrees(tbwe.getDoubleValue(defaultPositionAngle)); } else if (tbwe == getExposureTimeTextBox()) { final double expTime = tbwe.getDoubleValue(getDefaultExposureTime()); <START> final double expTimeAdj = isForceIntegerExposureTime() ? Math.floor(expTime) : expTime; <END> getDataObject().setExposureTime(expTimeAdj); } else if (tbwe == getCoaddsTextBox()) { final int defaultCoadds = 1; getDataObject().setCoadds(tbwe.getIntegerValue(defaultCoadds)); } } finally { _ignoreChanges = false; } } }</code><technical_language>do force exp time integer? For some instrument in particular</technical_language>

Target:
public void textBoxKeyPress(final TextBoxWidget tbwe) { if (getDataObject() != null) { _ignoreChanges = true; try { if (tbwe == getPosAngleTextBox()) { final double defaultPositionAngle = 0.0; getDataObject().setPosAngleDegrees(tbwe.getDoubleValue(defaultPositionAngle)); } else if (tbwe == getExposureTimeTextBox()) { final double expTime = tbwe.getDoubleValue(getDefaultExposureTime()); getDataObject().setExposureTime(expTime); } else if (tbwe == getCoaddsTextBox()) { final int defaultCoadds = 1; getDataObject().setCoadds(tbwe.getIntegerValue(defaultCoadds)); } } finally { _ignoreChanges = false; } } }
Source:
<code>public ValueMatcher makeValueMatcher(final LongColumnSelector selector, final String value) { Long matchVal = DimensionHandlerUtils.convertObjectToLong(value); if (matchVal == null) { <START> matchVal = DimensionHandlerUtils.getIntegralFromFloatString(value); <END> } if (matchVal == null) { return BooleanValueMatcher.of(false); } final long matchValLong = matchVal; return new ValueMatcher() { @Override public boolean matches() { return selector.get() == matchValLong; } }; }</code><technical_language>this method call check done DimensionHandlerUtils.convertObjectToLong()</technical_language>

Target:
public ValueMatcher makeValueMatcher(final LongColumnSelector selector, final String value) { final Long matchVal = DimensionHandlerUtils.convertObjectToLong(value); if (matchVal == null) { return BooleanValueMatcher.of(false); } final long matchValLong = matchVal; return new ValueMatcher() { @Override public boolean matches() { return selector.get() == matchValLong; } }; }
Source:
<code>protected List<String> getModules() { <START> return ImmutableList.of("+", "Data.List", "Data.Maybe", "Data.Either"); <END> }</code><technical_language>"+" a module. :stuck_out_tongue: I put CLaSH.Prelude there*, this is a list reload necessary modules (statelessly instead of relying ghci session) in future get adding deleting module nodes. *or enable a switch in ClambdaaSH implicitly loads Prelude GHCi does. *or move "+" ":module " command</technical_language>

Target:
protected List<String> getModules() { return ImmutableList.of("CLaSH.Prelude", "Data.List", "Data.Maybe", "Data.Either"); }
Source:
<code>public static void afterClass() throws IOException, OperationException, TimeoutException, InterruptedException { operations.removeIfExists(serviceAddress); Administration administration = new Administration(client); administration.restartIfRequired(); administration.reloadIfRequired(); <START> } <END></code><technical_language>closing client</technical_language>

Target:
public static void afterClass() throws IOException, OperationException, TimeoutException, InterruptedException { try { operations.removeIfExists(serviceAddress); Administration administration = new Administration(client); administration.reloadIfRequired(); } finally { client.close(); } }
Source:
<code>private void updateGtidSet(Event event) { EventHeader eventHeader = event.getHeader(); if (eventHeader.getEventType() == EventType.GTID) { GtidEventData gtidEventData = (GtidEventData) unwrapEventData(event.getData()); currentGtid = gtidEventData.getGtid(); <START> } else if ( gtidSet != null ) { <END> if (eventHeader.getEventType() == EventType.XID) { addGtidToSet(currentGtid); } else if ( eventHeader.getEventType() == EventType.QUERY) { QueryEventData qed = (QueryEventData) unwrapEventData(event.getData()); String sql = qed.getSql(); if ( sql != null && sql.toUpperCase().startsWith("COMMIT") ) { addGtidToSet(currentGtid); } } } }</code><technical_language>gtidSet is longer protected gtidSetAccessLock</technical_language>

Target:
private void updateGtidSet(Event event) { synchronized (gtidSetAccessLock) { if (gtidSet == null) { return; } } EventHeader eventHeader = event.getHeader(); if (eventHeader.getEventType() == EventType.GTID) { GtidEventData gtidEventData = (GtidEventData) unwrapEventData(event.getData()); currentGtid = gtidEventData.getGtid(); return; } switch(eventHeader.getEventType()) { case XID: addGtidToSet(currentGtid); inGTIDTransaction = false; break; case QUERY: QueryEventData qed = (QueryEventData) unwrapEventData(event.getData()); String sql = qed.getSql(); if (sql == null) { break; } sql = sql.toUpperCase(); if (sql.startsWith("BEGIN")) { inGTIDTransaction = true; } else if (sql.startsWith("COMMIT")) { addGtidToSet(currentGtid); inGTIDTransaction = false; } else if (!inGTIDTransaction) { addGtidToSet(currentGtid); } default: } }
Source:
<code>public void http_url_exist_and_is_modified() throws Exception { <START> stubFor(get(urlEqualTo("/exist.txt")).willReturn( <END> aResponse().withStatus(200).withHeader("Content-Type", "text/plain").withHeader("Last-Modified", "Mon, 11 Jun 2007 18:53:14 GMT").withBody("exists"))); String url = "<LINK_0>" + wireMockRule.port() + "/exist.txt"; UrlResource res = new UrlResource(url); assertThat(res.exists(), is(true)); assertThat(res.lastModified(), greaterThan(0L)); try { File file = res.getFile(); fail("File should not exist: " + file); } catch (FileNotFoundException e) { } InputStream in = res.getInputStream(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); IoUtils.copy(in, baos); String actual = new String(baos.toByteArray(), StandardCharsets.UTF_8); String expected = "exists"; assertThat(actual, is(expected)); }</code><technical_language>Nice! I this library before, for beatuiful tests</technical_language>

Target:
public void http_url_exist_and_is_modified() throws Exception { stubFor(get(urlEqualTo("/exist.txt")).willReturn( aResponse().withStatus(200).withHeader("Content-Type", "text/plain").withHeader("Last-Modified", "Mon, 11 Jun 2007 18:53:14 GMT").withBody("exists"))); String url = "<LINK_0>" + wireMockRule.port() + "/exist.txt"; UrlResource res = new UrlResource(url); assertThat(res.exists(), is(true)); assertThat(res.lastModified(), greaterThan(0L)); try { File file = res.getFile(); fail("File should not exist: " + file); } catch (FileNotFoundRuntimeException e) { } InputStream in = res.getInputStream(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); IoUtils.copy(in, baos); String actual = new String(baos.toByteArray(), StandardCharsets.UTF_8); String expected = "exists"; assertThat(actual, is(expected)); }
Source:
<code>public Response queryUserTasksByVariables(@Context HttpHeaders headers, String payload, @ApiParam(value = "optional pagination - at which page to start, defaults to 0 (meaning first)", required = false) @QueryParam("page") @DefaultValue("0") Integer page, @ApiParam(value = "optional pagination - size of the result, defaults to 10", required = false) @QueryParam("pageSize") @DefaultValue("10") Integer pageSize) { Header conversationIdHeader = buildConversationIdHeader("", context, headers); Variant v = getVariant(headers); try { String type = getContentType(headers); ProcessInstanceUserTaskWithVariablesList taskVariableSummaryList = runtimeDataServiceBase.queryUserTasksByVariables(payload, type, new QueryContext(page * pageSize, pageSize)); <START> logger.debug("Returning result of process instance search: {}", taskVariableSummaryList); <END> return createCorrectVariant(taskVariableSummaryList, headers, Response.Status.OK, conversationIdHeader); } catch (Exception e) { logger.error("Unexpected error during processing {}", e.getMessage(), e); return internalServerError(errorMessage(e), v, conversationIdHeader); } }</code><technical_language>log message more related "process tasks search" log message queryProcessesByVariables method? differentiate "queryProcessesByVariables" method</technical_language>

Target:
public Response queryUserTasksByVariables(@Context HttpHeaders headers, String payload, @ApiParam(value = "optional pagination - at which page to start, defaults to 0 (meaning first)", required = false) @QueryParam("page") @DefaultValue("0") Integer page, @ApiParam(value = "optional pagination - size of the result, defaults to 10", required = false) @QueryParam("pageSize") @DefaultValue("10") Integer pageSize) { Header conversationIdHeader = buildConversationIdHeader("", context, headers); Variant v = getVariant(headers); try { String type = getContentType(headers); ProcessInstanceUserTaskWithVariablesList taskVariableSummaryList = runtimeDataServiceBase.queryUserTasksByVariables(payload, type, new QueryContext(page * pageSize, pageSize)); logger.debug("Returning result of process tasks search: {}", taskVariableSummaryList); return createCorrectVariant(taskVariableSummaryList, headers, Response.Status.OK, conversationIdHeader); } catch (Exception e) { logger.error("Unexpected error during processing {}", e.getMessage(), e); return internalServerError(errorMessage(e), v, conversationIdHeader); } }
Source:
<code>public RunIdGenerator(CoordinationUtils coordinationUtils, MetadataStore metadataStore) { Preconditions.checkNotNull(coordinationUtils, "CoordinationUtils cannot be null"); Preconditions.checkNotNull(metadataStore, "MetadataStore cannot be null"); this.coordinationUtils = coordinationUtils; this.metadataStore = metadataStore; this.clusterMembership = coordinationUtils.getClusterMembership(); <START> if (clusterMembership == null) { <END> throw new SamzaException("Failed to create utils for run id generation"); } }</code><technical_language>prefer Preconditions.checkNotNull(...) throw a category of exception in event of invalid arguments</technical_language>

Target:
public RunIdGenerator(CoordinationUtils coordinationUtils, MetadataStore metadataStore) { Preconditions.checkNotNull(coordinationUtils, "CoordinationUtils cannot be null"); Preconditions.checkNotNull(metadataStore, "MetadataStore cannot be null"); this.coordinationUtils = coordinationUtils; this.metadataStore = metadataStore; this.clusterMembership = coordinationUtils.getClusterMembership(); Preconditions.checkNotNull(this.clusterMembership, "Failed to create utils for run id generation"); }
Source:
<code><START> public Folder getFolder() { <END> return this.folder; }</code><technical_language>purpose publicate</technical_language>

Target:
protected Folder getFolder() { return this.folder; }
Source:
<code>public BenchmarkSuite( BenchmarkSuiteInfo suiteInfo, List<BenchmarkQuery> queries) { this.suiteInfo = requireNonNull(suiteInfo, "SuiteInfo is null"); <START> this.queryMap = new HashMap(); for (BenchmarkQuery query : queries) { queryMap.put(query.getName(), query); } <END> }</code><technical_language>Java stream: this.queries = queries.stream() .collect(toImmutableMap(BenchmarkQuery::getName, identity()));</technical_language>

Target:
public BenchmarkSuite( BenchmarkSuiteInfo suiteInfo, List<BenchmarkQuery> queries) { this.suiteInfo = requireNonNull(suiteInfo, "SuiteInfo is null"); this.queries = queries.stream() .collect(toImmutableMap(BenchmarkQuery::getName, identity())); }
Source:
<code>public JSONObject toJSONObject() { JSONObject mainObj = new JSONObject(); try { <START> mainObj.put("notification_enabled", notificationEnabled); <END> mainObj.put("push_disabled", pushDisabled); mainObj.put("subscribed", subscribed); mainObj.put("user_id", userId); mainObj.put("push_token", pushToken); mainObj.put("email_user_id", emailUserId); mainObj.put("email_address", emailAddress); } catch (Throwable t) { t.printStackTrace(); } return mainObj; }</code><technical_language>are_notifications_enabled</technical_language>

Target:
public JSONObject toJSONObject() { JSONObject mainObj = new JSONObject(); try { mainObj.put("areNotificationsEnabled", areNotificationsEnabled); mainObj.put("isPushDisabled", pushDisabled); mainObj.put("isSubscribed", subscribed); mainObj.put("userId", userId); mainObj.put("pushToken", pushToken); mainObj.put("emailUserId", emailUserId); mainObj.put("emailAddress", emailAddress); } catch (Throwable t) { t.printStackTrace(); } return mainObj; }
Source:
<code>private void flushAndMakeCheckpoints() { synchronized (DatastreamEventProducerImpl.this) { <START> _transportProvider.flush(); <END> if (_checkpointPolicy == CheckpointPolicy.DATASTREAM) { _checkpointProvider.commit(_latestCheckpoints); } _safeCheckpoints.putAll(_latestCheckpoints); } }</code><technical_language>Do need a separate thread for event producer checkpointing thread coordinator work</technical_language>

Target:
private void flushAndMakeCheckpoints() throws DatastreamException { synchronized (DatastreamEventProducerImpl.this) { if (!_pendingCheckpoint) { return; } try { LOG.info(String.format("Flush started, tasks = [%s].", _taskDesc)); _transportProvider.flush(); LOG.info("Flush ended."); } catch (Throwable t) { throw new DatastreamException(String.format("Flush failed, tasks = [%s].", _taskDesc), t); } if (_checkpointPolicy == CheckpointPolicy.DATASTREAM) { try { LOG.info(String.format("Checkpoint commit started, tasks = [%s].", _taskDesc)); _checkpointProvider.commit(_latestCheckpoints); LOG.info("Commit ended."); } catch (Throwable t) { throw new DatastreamException(String.format("Checkpoint commit failed, tasks = [%s].", _taskDesc), t); } } _safeCheckpoints.putAll(_latestCheckpoints); _pendingCheckpoint = false; LOG.debug("Safe checkpoints: " + _latestCheckpoints); } }
Source:
<code>private VDSReturnValue handleVdsResult(VDSReturnValue result) { <START> if (!StringUtils.isEmpty(result.getExceptionString())) { <END> VdcBLLException exp; if (result.getVdsError() != null) { exp = new VdcBLLException(result.getVdsError().getCode(), result.getExceptionString()); } else { exp = new VdcBLLException(VdcBllErrors.ENGINE, result.getExceptionString()); } throw exp; } return result; }</code><technical_language>StringUtils.isNotEmpty() remove negation</technical_language>

Target:
private VDSReturnValue handleVdsResult(VDSReturnValue result) { if (StringUtils.isNotEmpty(result.getExceptionString())) { VdcBLLException exp; if (result.getVdsError() != null) { exp = new VdcBLLException(result.getVdsError().getCode(), result.getExceptionString()); } else { exp = new VdcBLLException(VdcBllErrors.ENGINE, result.getExceptionString()); } throw exp; } return result; }
Source:
<code>public List<Tree.Kind> nodesToVisit() { <START> ArrayList<Tree.Kind> nodesToVisit = new ArrayList<>(super.nodesToVisit()); <END> nodesToVisit.add(Tree.Kind.CLASS); nodesToVisit.add(Tree.Kind.ASSIGNMENT); nodesToVisit.add(Tree.Kind.STATIC_INITIALIZER); return nodesToVisit; }</code><technical_language>List<Tree.Kind> for variable declaration (always interface for declaration, implementation for instantiation.)</technical_language>

Target:
public List<Tree.Kind> nodesToVisit() { List<Tree.Kind> nodesToVisit = new ArrayList<>(super.nodesToVisit()); nodesToVisit.add(Tree.Kind.CLASS); nodesToVisit.add(Tree.Kind.ASSIGNMENT); nodesToVisit.add(Tree.Kind.STATIC_INITIALIZER); return nodesToVisit; }
Source:
<code>public ResultSummary process(Fixture fixture) throws IOException { SummarizingResultRecorder resultRecorder = new SummarizingResultRecorder(); resultRecorder.setSpecificationDescription(fixture.getSpecificationDescription()); <START> getSpecification(fixture).process(evaluatorFactory.createEvaluator(fixture.getFixtureObject()), resultRecorder, fixture); <END> return resultRecorder; }</code><technical_language>odd pass fixture calls line</technical_language>

Target:
public ResultSummary process(Fixture fixture) throws IOException { SummarizingResultRecorder resultRecorder = new SummarizingResultRecorder(); Evaluator evaluator = evaluatorFactory.createEvaluator(fixture); getSpecification().process(evaluator, resultRecorder, fixture); return resultRecorder; }
Source:
<code>public Aggregation toDruidAggregation( final String name, final RowSignature rowSignature, final List<Aggregation> existingAggregations, final Project project, final AggregateCall aggregateCall, final DimFilter filter ) { final RexNode rexNode = Expressions.fromFieldAccess( rowSignature, project, Iterables.getOnlyElement(aggregateCall.getArgList()) ); final RowExtraction rex = Expressions.toRowExtraction( rowSignature.getRowOrder(), rexNode ); if (rex == null) { return null; } final AggregatorFactory aggregatorFactory; if (rowSignature.getColumnType(rex.getColumn()) == ValueType.COMPLEX) { aggregatorFactory = new HyperUniquesAggregatorFactory(name, rex.getColumn()); } else { final SqlTypeName sqlTypeName = rexNode.getType().getSqlTypeName(); final ValueType outputType = RowSignature.getValueTypeForSqlTypeName(sqlTypeName); if (outputType == null) { throw new ISE("Cannot translate sqlTypeName[%s] to Druid type for field[%s]", sqlTypeName, name); } <START> final DimensionSpec dimensionSpec = rex.toDimensionSpec(rowSignature, null, null); <END> if (dimensionSpec == null) { return null; } aggregatorFactory = new CardinalityAggregatorFactory(name, ImmutableList.of(dimensionSpec), false); } return Aggregation.createFinalizable( ImmutableList.<AggregatorFactory>of(aggregatorFactory), null, new PostAggregatorFactory() { @Override public PostAggregator factorize(String outputName) { return new HyperUniqueFinalizingPostAggregator(outputName, name); } } ).filter(filter); }</code><technical_language>pass ValueType.STRING in explicitly check for non-null outputType in toDimensionSpec</technical_language>

Target:
public Aggregation toDruidAggregation( final String name, final RowSignature rowSignature, final List<Aggregation> existingAggregations, final Project project, final AggregateCall aggregateCall, final DimFilter filter ) { final RexNode rexNode = Expressions.fromFieldAccess( rowSignature, project, Iterables.getOnlyElement(aggregateCall.getArgList()) ); final RowExtraction rex = Expressions.toRowExtraction( rowSignature.getRowOrder(), rexNode ); if (rex == null) { return null; } final AggregatorFactory aggregatorFactory; if (rowSignature.getColumnType(rex.getColumn()) == ValueType.COMPLEX) { aggregatorFactory = new HyperUniquesAggregatorFactory(name, rex.getColumn()); } else { final SqlTypeName sqlTypeName = rexNode.getType().getSqlTypeName(); final ValueType outputType = Calcites.getValueTypeForSqlTypeName(sqlTypeName); if (outputType == null) { throw new ISE("Cannot translate sqlTypeName[%s] to Druid type for field[%s]", sqlTypeName, name); } final DimensionSpec dimensionSpec = rex.toDimensionSpec(rowSignature, null, ValueType.STRING); if (dimensionSpec == null) { return null; } aggregatorFactory = new CardinalityAggregatorFactory(name, ImmutableList.of(dimensionSpec), false); } return Aggregation.createFinalizable( ImmutableList.<AggregatorFactory>of(aggregatorFactory), null, new PostAggregatorFactory() { @Override public PostAggregator factorize(String outputName) { return new HyperUniqueFinalizingPostAggregator(outputName, name); } } ).filter(filter); }
Source:
<code>protected void setup( Mapper<ImmutableBytesWritable, Result, ImmutableBytesWritable, Put>.Context context) throws java.io.IOException, InterruptedException { Configuration myConf = context.getConfiguration(); jobHistoryByIdService = new JobHistoryByIdService(myConf); appVersionService = new AppVersionService(myConf); rawService = new JobHistoryRawService(myConf); keyCount = 0; String attemptid = context.getTaskAttemptID().toString(); if (attemptid != null) { <START> isThisAttemptTheFirst = (attemptid.endsWith("0") ? true : false); <END> } }</code><technical_language>Nit: this simply isThisAttemptTheFirst = attemptid.endsWith("0");</technical_language>

Target:
protected void setup( Mapper<ImmutableBytesWritable, Result, ImmutableBytesWritable, Put>.Context context) throws java.io.IOException, InterruptedException { Configuration myConf = context.getConfiguration(); jobHistoryByIdService = new JobHistoryByIdService(myConf); appVersionService = new AppVersionService(myConf); rawService = new JobHistoryRawService(myConf); keyCount = 0; String attemptid = context.getTaskAttemptID().toString(); if (attemptid != null) { isThisAttemptTheFirst = attemptid.endsWith("0"); } }
Source:
<code>public BakingActionResult checkActionIsApplicableInState(State state, String[] params) { BakingActionResult superResult = super.checkActionIsApplicableInState(state, params); if (!superResult.getIsSuccess()) { return superResult; } ObjectInstance agent = state.getObject(params[0]); String spaceName = params[1]; ObjectInstance spaceInstance = state.getObject(spaceName); if (!SpaceFactory.isSwitchable(spaceInstance)) { <START> return BakingActionResult.failure(spaceName + " cannot be turned on/off"); <END> } return BakingActionResult.success(); }</code><technical_language>this is turn on/off this message misleading (pouting a failure in attempting turn on/off). Rather, : spaceName + " on/off option" -- clear action fault, space ability turned</technical_language>

Target:
public BakingActionResult checkActionIsApplicableInState(State state, String[] params) { BakingActionResult superResult = super.checkActionIsApplicableInState(state, params); if (!superResult.getIsSuccess()) { return superResult; } ObjectInstance agent = state.getObject(params[0]); String spaceName = params[1]; ObjectInstance spaceInstance = state.getObject(spaceName); if (!SpaceFactory.isSwitchable(spaceInstance)) { return BakingActionResult.failure(spaceName + " does not have the capability to be turned on/off"); } return BakingActionResult.success(); }
Source:
<code>public CompletableFuture<Optional<Integer>> getSize(Multihash hash) { return Futures.of(map(hash, h -> { GetObjectRequest get = new GetObjectRequest(bucket, folder + hashToKey(hash)); <START> Histogram.Timer readTimer = readTimerLog.labels(h.toString()).startTimer(); <END> try (S3Object res = s3Client.getObject(get)) { return Optional.of((int)res.getObjectMetadata().getContentLength()); } catch (IOException e) { throw new RuntimeException(e.getMessage(), e); } finally { readTimer.observeDuration(); } }, e -> Optional.empty())); }</code><technical_language>re: labels</technical_language>

Target:
public CompletableFuture<Optional<Integer>> getSize(Multihash hash) { return Futures.of(map(hash, h -> { GetObjectRequest get = new GetObjectRequest(bucket, folder + hashToKey(hash)); Histogram.Timer readTimer = readTimerLog.labels("size").startTimer(); try (S3Object res = s3Client.getObject(get)) { return Optional.of((int)res.getObjectMetadata().getContentLength()); } catch (IOException e) { throw new RuntimeException(e.getMessage(), e); } finally { readTimer.observeDuration(); } }, e -> Optional.empty())); }
Source:
<code>public void testButtonVisibilityForMusicFile() throws Throwable { Uri uri = Uri.parse("android.resource://" + mContext.getPackageName() + "/" + R.raw.test_music); final MediaItem uriMediaItem = createTestMediaItem2(uri); final CountDownLatch latch = new CountDownLatch(3); final MediaController controller = createController(new MediaController.ControllerCallback() { @Override public void onCurrentMediaItemChanged(@NonNull MediaController controller, @Nullable MediaItem item) { <START> latch.countDown(); <END> } }); mActivityRule.runOnUiThread(new Runnable() { @Override public void run() { mVideoView.setMediaItem(uriMediaItem); } }); assertTrue(latch.await(WAIT_TIME_MS, TimeUnit.MILLISECONDS)); onView(withId(R.id.subtitle)).check(matches(not(isCompletelyDisplayed()))); }</code><technical_language>Is guaranteed expected called times setMediaItem is called? I this is proper condition for button visible</technical_language>

Target:
public void testButtonVisibilityForMusicFile() throws Throwable { Uri uri = Uri.parse("android.resource://" + mContext.getPackageName() + "/" + R.raw.test_music); final MediaItem uriMediaItem = createTestMediaItem2(uri); final CountDownLatch latch = new CountDownLatch(1); final MediaController controller = createController(new MediaController.ControllerCallback() { @NonNull @Override public SessionResult onCustomCommand(@NonNull MediaController controller, @NonNull SessionCommand command, @Nullable Bundle args) { if (command.getCustomAction() == MediaControlView.EVENT_UPDATE_TRACK_STATUS) { latch.countDown(); } return new SessionResult(SessionResult.RESULT_SUCCESS, null); } }); mActivityRule.runOnUiThread(new Runnable() { @Override public void run() { mVideoView.setMediaItem(uriMediaItem); } }); assertTrue(latch.await(WAIT_TIME_MS, TimeUnit.MILLISECONDS)); onView(withId(R.id.subtitle)).check(matches(not(isCompletelyDisplayed()))); }
Source:
<code>public void testMarshallAccount() throws Exception { ImmutableSerializationContext ctx = createContext(); Account account = new Account(); account.setId(1); account.setDescription("test account"); account.setCurrencies(new Account.Currency[]{Account.Currency.BRL}); <START> Date creationDate = new Date(); <END> account.setCreationDate(creationDate); List<byte[]> blurb = new ArrayList<>(); blurb.add(new byte[0]); blurb.add(new byte[]{1, 2, 3}); account.setBlurb(blurb); byte[] bytes = ProtobufUtil.toByteArray(ctx, account); Account decoded = ProtobufUtil.fromByteArray(ctx, bytes, Account.class); assertEquals(1, decoded.getId()); assertEquals("test account", decoded.getDescription()); assertEquals(creationDate, decoded.getCreationDate()); assertNotNull(decoded.getBlurb()); assertEquals(2, decoded.getBlurb().size()); assertEquals(0, decoded.getBlurb().get(0).length); assertEquals(3, decoded.getBlurb().get(1).length); assertArrayEquals(new byte[]{1, 2, 3}, decoded.getBlurb().get(1)); }</code><technical_language>add assert enum correclty survives marshaling unmarshalling</technical_language>

Target:
public void testMarshallAccount() throws Exception { ImmutableSerializationContext ctx = createContext(); Account account = new Account(); account.setId(1); account.setDescription("test account"); account.setCurrencies(new Account.Currency[]{Account.Currency.BRL}); Date creationDate = new Date(); account.setCreationDate(creationDate); List<byte[]> blurb = new ArrayList<>(); blurb.add(new byte[0]); blurb.add(new byte[]{1, 2, 3}); account.setBlurb(blurb); byte[] bytes = ProtobufUtil.toByteArray(ctx, account); Account decoded = ProtobufUtil.fromByteArray(ctx, bytes, Account.class); assertEquals(1, decoded.getId()); assertEquals("test account", decoded.getDescription()); assertEquals(creationDate, decoded.getCreationDate()); assertNotNull(decoded.getBlurb()); assertEquals(2, decoded.getBlurb().size()); assertEquals(0, decoded.getBlurb().get(0).length); assertEquals(3, decoded.getBlurb().get(1).length); assertArrayEquals(new byte[]{1, 2, 3}, decoded.getBlurb().get(1)); assertArrayEquals(new Account.Currency[]{Account.Currency.BRL}, decoded.getCurrencies()); }
Source:
<code>public void testSetEnumNameProperty() { Assertions.assertThrows(IllegalStateException.class, () -> { JavaBeanDescriptor descriptor = new JavaBeanDescriptor(long.class.getName(), JavaBeanDescriptor.TYPE_PRIMITIVE); descriptor.setEnumNameProperty(JavaBeanDescriptor.class.getName()); }); JavaBeanDescriptor descriptor1 = new JavaBeanDescriptor(JavaBeanDescriptor.class.getName(), JavaBeanDescriptor.TYPE_ENUM); <START> String oldValue1 = descriptor1.setEnumNameProperty(JavaBeanDescriptor.class.getName()); <END> Assertions.assertNull(oldValue1); String oldValue2 = descriptor1.setEnumNameProperty(JavaBeanDescriptor.class.getName()); Assertions.assertEquals(oldValue2, descriptor1.getEnumPropertyName()); }</code><technical_language>a variable named oldValue1</technical_language>

Target:
public void testSetEnumNameProperty() { Assertions.assertThrows(IllegalStateException.class, () -> { JavaBeanDescriptor descriptor = new JavaBeanDescriptor(long.class.getName(), JavaBeanDescriptor.TYPE_PRIMITIVE); descriptor.setEnumNameProperty(JavaBeanDescriptor.class.getName()); }); JavaBeanDescriptor descriptor = new JavaBeanDescriptor(JavaBeanDescriptor.class.getName(), JavaBeanDescriptor.TYPE_ENUM); String oldValueOrigin = descriptor.setEnumNameProperty(JavaBeanDescriptor.class.getName()); Assertions.assertNull(oldValueOrigin); String oldValueNext = descriptor.setEnumNameProperty(JavaBeanDescriptor.class.getName()); Assertions.assertEquals(oldValueNext, descriptor.getEnumPropertyName()); }
Source:
<code>private void setAssertionNameIdQualifierAndFormat( NameID assertionNameId, @Nullable String nameIdFormatPolicy, @Nullable String spNameQualifierPolicy, Response response) { if (StringUtils.isNotEmpty(spNameQualifierPolicy)) { assertionNameId.setSPNameQualifier(spNameQualifierPolicy); } if (StringUtils.isNotEmpty(nameIdFormatPolicy)) { switch (nameIdFormatPolicy) { case NameID.UNSPECIFIED: break; case NameID.PERSISTENT: break; case NameID.TRANSIENT: break; case NameID.X509_SUBJECT: LOGGER.warn("Specifying the \"X509Subject\" NameIDPolicy Format is not fully supported."); if (!NameID.X509_SUBJECT.equals(assertionNameId.getFormat())) { throw new UnsupportedOperationException( "The \"X509Subject\" NameID could not be retrieved."); } break; case NameID.EMAIL: LOGGER.warn("Specifying the \"Email\" NameIDPolicy Format is not fully supported."); assertionNameId.setValue(resolveEmail(response)); break; <START> case NameID.WIN_DOMAIN_QUALIFIED: <END> case NameID.KERBEROS: case NameID.ENTITY: default: throw new UnsupportedOperationException( String.format( "The NameIDPolicy Format of value %s is not supported.", nameIdFormatPolicy)); } } assertionNameId.setFormat(nameIdFormatPolicy); }</code><technical_language>a big deal leave in here, I a lot of in it</technical_language>

Target:
private void setAssertionNameIdQualifierAndFormat( NameID assertionNameId, @Nullable String nameIdFormatPolicy, @Nullable String spNameQualifierPolicy, Response response) { if (StringUtils.isNotEmpty(spNameQualifierPolicy)) { assertionNameId.setSPNameQualifier(spNameQualifierPolicy); } if (StringUtils.isNotEmpty(nameIdFormatPolicy)) { switch (nameIdFormatPolicy) { case NameID.UNSPECIFIED: return; case NameID.PERSISTENT: break; case NameID.X509_SUBJECT: LOGGER.warn("Specifying the \"X509Subject\" NameIDPolicy Format is not fully supported."); if (!NameID.X509_SUBJECT.equals(assertionNameId.getFormat())) { throw new UnsupportedOperationException( "The \"X509Subject\" NameID could not be retrieved."); } break; case NameID.EMAIL: LOGGER.warn("Specifying the \"Email\" NameIDPolicy Format is not fully supported."); assertionNameId.setValue(resolveEmail(response, assertionNameId)); break; case NameID.TRANSIENT: case NameID.WIN_DOMAIN_QUALIFIED: case NameID.KERBEROS: case NameID.ENTITY: default: throw new UnsupportedOperationException( String.format( "The NameIDPolicy Format of value %s is not supported.", nameIdFormatPolicy)); } assertionNameId.setFormat(nameIdFormatPolicy); } }
Source:
<code>public void onBlockPlace(final BlockPlaceEvent event) { final ItemStack is = LocationUtil.convertBlockToItem(event.getBlockPlaced()); if (is == null) { return; } if (is.getType() == MaterialUtil.SPAWNER && event.getItemInHand().getType() == MaterialUtil.SPAWNER) { final BlockState blockState = event.getBlockPlaced().getState(); if (blockState instanceof CreatureSpawner) { final CreatureSpawner spawner = (CreatureSpawner) blockState; final EntityType type = ess.getSpawnerProvider().getEntityType(event.getItemInHand()); final Mob mob = Mob.fromBukkitType(type); if (type != null && mob != null) { String mobName = mob.name().toLowerCase(Locale.ENGLISH); <START> if (ess.getUser(event.getPlayer()).isAuthorized("essentials.spawnerconvert." + mobName)) { <END> spawner.setSpawnedType(type); spawner.update(); } } } } final User user = ess.getUser(event.getPlayer()); if (user.hasUnlimited(is) && user.getBase().getGameMode() == GameMode.SURVIVAL) { class UnlimitedItemSpawnTask implements Runnable { @Override public void run() { user.getBase().getInventory().addItem(is); user.getBase().updateInventory(); } } ess.scheduleSyncDelayedTask(new UnlimitedItemSpawnTask()); } }</code><technical_language>changes in this PR</technical_language>

Target:
public void onBlockPlace(final BlockPlaceEvent event) { final ItemStack is = LocationUtil.convertBlockToItem(event.getBlockPlaced()); if (is == null) { return; } if (is.getType() == MaterialUtil.SPAWNER && event.getItemInHand() != null && event.getPlayer() != null && event.getItemInHand().getType() == MaterialUtil.SPAWNER) { final BlockState blockState = event.getBlockPlaced().getState(); if (blockState instanceof CreatureSpawner) { final CreatureSpawner spawner = (CreatureSpawner) blockState; final EntityType type = ess.getSpawnerProvider().getEntityType(event.getItemInHand()); if (type != null && Mob.fromBukkitType(type) != null) { if (ess.getUser(event.getPlayer()).isAuthorized("essentials.spawnerconvert." + Mob.fromBukkitType(type).name().toLowerCase(Locale.ENGLISH))) { spawner.setSpawnedType(type); spawner.update(); } } } } final User user = ess.getUser(event.getPlayer()); if (user.hasUnlimited(is) && user.getBase().getGameMode() == GameMode.SURVIVAL) { class UnlimitedItemSpawnTask implements Runnable { @Override public void run() { user.getBase().getInventory().addItem(is); user.getBase().updateInventory(); } } ess.scheduleSyncDelayedTask(new UnlimitedItemSpawnTask()); } }
Source:
<code>private boolean attemptTrade(List<EntityVillager> villagers, int tradeSet) { ItemStack buy1 = recipeSlots.getStackInSlot(tradeSet * 3 + 0); ItemStack buy2 = recipeSlots.getStackInSlot(tradeSet * 3 + 1); ItemStack sell = recipeSlots.getStackInSlot(tradeSet * 3 + 2); for (EntityVillager villager : villagers) { MerchantRecipeList recipes = villager.getRecipes(null); for (MerchantRecipe recipe : recipes) { if (recipe.isRecipeDisabled()) continue; <START> if (recipe.getItemToBuy() != InvTools.emptyStack() && !InvTools.isItemLessThanOrEqualTo(recipe.getItemToBuy(), buy1)) <END> continue; if (recipe.getSecondItemToBuy() != InvTools.emptyStack() && !InvTools.isItemLessThanOrEqualTo(recipe.getSecondItemToBuy(), buy2)) continue; if (!InvTools.isItemGreaterOrEqualThan(recipe.getItemToSell(), sell)) continue; if (canDoTrade(recipe)) { doTrade(villager, recipe); return true; } } } return false; }</code><technical_language>This 100% safe, isEmpty(stack) in tests instead</technical_language>

Target:
private boolean attemptTrade(List<EntityVillager> villagers, int tradeSet) { ItemStack buy1 = recipeSlots.getStackInSlot(tradeSet * 3 + 0); ItemStack buy2 = recipeSlots.getStackInSlot(tradeSet * 3 + 1); ItemStack sell = recipeSlots.getStackInSlot(tradeSet * 3 + 2); for (EntityVillager villager : villagers) { MerchantRecipeList recipes = villager.getRecipes(null); for (MerchantRecipe recipe : recipes) { if (recipe.isRecipeDisabled()) continue; if (!InvTools.isEmpty(recipe.getItemToBuy()) && !InvTools.isItemLessThanOrEqualTo(recipe.getItemToBuy(), buy1)) continue; if (!InvTools.isEmpty(recipe.getSecondItemToBuy()) && !InvTools.isItemLessThanOrEqualTo(recipe.getSecondItemToBuy(), buy2)) continue; if (!InvTools.isItemGreaterOrEqualThan(recipe.getItemToSell(), sell)) continue; if (canDoTrade(recipe)) { doTrade(villager, recipe); return true; } } } return false; }
Source:
<code>public void startVoiceRecognition() { <START> final String language = QuranSettings.getInstance(this).isArabicNames() ? "ar-SA" : "en-US"; <END> String choice = getText(R.string.vChoice).toString(); Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, language); intent.putExtra(RecognizerIntent.EXTRA_PROMPT, choice); startActivityForResult(intent, SPEECH_REQUEST_CODE); }</code><technical_language>essentially limiting voice recognition Arabic English. Google voice recognition Qur'an app supports more locales. Please consider account</technical_language>

Target:
public void startVoiceRecognition() { int voiceLanguage = settings.getPreferredVoiceLanguage(); final String language = voiceCom.findLanguageCode(voiceLanguage); String choice = getText(R.string.voice_Dialogue_Title).toString(); Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, language); intent.putExtra(RecognizerIntent.EXTRA_PROMPT, choice); intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 10); startActivityForResult(intent, SPEECH_REQUEST_CODE); }
Source:
<code>public static List<Double> boundingBoxCenter(Place place) { if( place == null ) return new ArrayList<>(); if( place.getBoundingBox() == null ) return new ArrayList<>(); if( place.getBoundingBox().getCoordinates().size() != 1 ) return new ArrayList<>(); if( place.getBoundingBox().getCoordinates().get(0).size() != 4 ) return new ArrayList<>(); List<Double> lats = Lists.newArrayList(); List<Double> lons = Lists.newArrayList(); for( List<Double> point : place.getBoundingBox().getCoordinates().get(0)) { lats.add(point.get(0)); lons.add(point.get(1)); } <START> List<Double> result = new ArrayList<Double>(); <END> result.add(new Double(mean(lats))); result.add(new Double(mean(lons))); return result; }</code><technical_language>RHS 'new ArrayList<>();' -> Java 7</technical_language>

Target:
public static List<Double> boundingBoxCenter(Place place) { if( place == null ) return new ArrayList<>(); if( place.getBoundingBox() == null ) return new ArrayList<>(); if( place.getBoundingBox().getCoordinates().size() != 1 ) return new ArrayList<>(); if( place.getBoundingBox().getCoordinates().get(0).size() != 4 ) return new ArrayList<>(); List<Double> lats = new ArrayList<>(); List<Double> lons = new ArrayList<>(); for( List<Double> point : place.getBoundingBox().getCoordinates().get(0)) { lats.add(point.get(0)); lons.add(point.get(1)); } List<Double> result = new ArrayList<>(); result.add(new Double(mean(lats))); result.add(new Double(mean(lons))); return result; }
Source:
<code><START> public List<String> getOutputStreams() { <END> return outputStreams; }</code><technical_language>Stream abstraction is added want remove todo refactor list of streams</technical_language>

Target:
public Set<String> getOutputStreams() { return Collections.unmodifiableSet(outputStreams); }
Source:
<code>public void setEnvironment() throws Exception { super.init(userMode); String userName = gatewayContextWrk.getContextTenant().getTenantAdmin().getUserNameWithoutDomain(); String password = gatewayContextWrk.getContextTenant().getTenantAdmin().getPassword(); String tenantDomain = gatewayContextWrk.getContextTenant().getDomain(); <START> restAPIPublisher = new RestAPIPublisherImpl(userName, password, tenantDomain); <END> }</code><technical_language>Do need this? This is done in Super class</technical_language>

Target:
public void setEnvironment() throws Exception { super.init(userMode); }
Source:
<code>public LogReplicationMetadataManager(CorfuRuntime rt, long topologyConfigId, String localClusterId) { this.runtime = rt; this.corfuStore = new CorfuStore(runtime); metadataTableName = getPersistedWriterMetadataTableName(localClusterId); try { metadataTable = this.corfuStore.openTable(NAMESPACE, metadataTableName, LogReplicationMetadataKey.class, LogReplicationMetadataVal.class, null, TableOptions.builder().build()); } catch (Exception e) { <START> log.error("Caught an exception while opening the table NAMESPACE={}, name={}", NAMESPACE, metadataTableName); <END> throw new ReplicationWriterException(e); } setupTopologyConfigId(topologyConfigId); }</code><technical_language>print exception trace also..</technical_language>

Target:
public LogReplicationMetadataManager(CorfuRuntime rt, long topologyConfigId, String localClusterId) { this.runtime = rt; this.corfuStore = new CorfuStore(runtime); metadataTableName = getPersistedWriterMetadataTableName(localClusterId); try { metadataTable = this.corfuStore.openTable(NAMESPACE, metadataTableName, LogReplicationMetadataKey.class, LogReplicationMetadataVal.class, null, TableOptions.builder().build()); } catch (Exception e) { log.error("Caught an exception while opening the table NAMESPACE={}, name={}", NAMESPACE, metadataTableName, e); throw new ReplicationWriterException(e); } setupTopologyConfigId(topologyConfigId); }
Source:
<code>private GetRouterMonitorResultsAnswer execute(GetRouterMonitorResultsCommand cmd) { String routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP); String args = cmd.shouldPerformFreshChecks() ? "true" : "false"; s_logger.debug("Fetching health check result for " + routerIp + " and executing fresh checks: " + args); ExecutionResult result = _vrDeployer.executeInVR(routerIp, VRScripts.ROUTER_MONITOR_RESULTS, args); if (result.isSuccess()) { List<String> failingChecks = new ArrayList<>(); StringBuilder monitorResults = new StringBuilder(); if (!result.getDetails().isEmpty()) { <START> String[] lines = result.getDetails().trim().split("\n"); <END> boolean readingFailedChecks = false, readingMonitorResults = false; for (String line : lines) { line = line.trim(); if (line.contains("FAILING CHECKS")) { readingFailedChecks = true; readingMonitorResults = false; continue; } else if (line.contains("MONITOR RESULTS")) { readingFailedChecks = false; readingMonitorResults = true; continue; } if (readingFailedChecks && !readingMonitorResults) { for (String w : line.split(",")) { if (!w.trim().isEmpty()) { failingChecks.add(w.trim()); } } } else if (!readingFailedChecks && readingMonitorResults) { monitorResults.append(line); } else { s_logger.info("Unexpected state of lines reached while parsing response. Skipping line."); } } } else { s_logger.warn("Received no results back in monitor results."); } if (monitorResults.length() == 0) { monitorResults.append("No results available."); } return new GetRouterMonitorResultsAnswer(cmd, true, failingChecks, monitorResults.toString()); } else { return new GetRouterMonitorResultsAnswer(cmd, false, null, result.getDetails()); } }</code><technical_language>increase readability, split this big method multiple methods</technical_language>

Target:
private GetRouterMonitorResultsAnswer execute(GetRouterMonitorResultsCommand cmd) { String routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP); String args = cmd.shouldPerformFreshChecks() ? "true" : "false"; s_logger.info("Fetching health check result for " + routerIp + " and executing fresh checks: " + args); ExecutionResult result = _vrDeployer.executeInVR(routerIp, VRScripts.ROUTER_MONITOR_RESULTS, args); if (!result.isSuccess()) { s_logger.warn("Result of " + cmd + " failed with details: " + result.getDetails()); return new GetRouterMonitorResultsAnswer(cmd, false, null, result.getDetails()); } if (result.getDetails().isEmpty()) { s_logger.warn("Result of " + cmd + " received no details."); return new GetRouterMonitorResultsAnswer(cmd, false, null, "No results available."); } return parseLinesForHealthChecks(cmd, result.getDetails()); }
Source:
<code>private BlobId getRandomBlobId(short version) throws Exception { byte[] bytes = new byte[2]; random.nextBytes(bytes); random.nextBytes(bytes); byte datacenterId = bytes[0]; short accountId = getRandomShort(random); short containerId = getRandomShort(random); BlobIdType type = random.nextBoolean() ? BlobIdType.NATIVE : BlobIdType.CRAFTED; PartitionId partitionId = referenceClusterMap.getWritablePartitionIds(MockClusterMap.DEFAULT_PARTITION_CLASS).get(random.nextInt(3)); boolean isEncrypted = random.nextBoolean(); <START> return new BlobId(version, type, datacenterId, accountId, containerId, partitionId, isEncrypted, null); <END> }</code><technical_language>I pass in a random BlobDataType do for BlobIdType</technical_language>

Target:
private BlobId getRandomBlobId(short version) throws Exception { byte[] bytes = new byte[2]; random.nextBytes(bytes); random.nextBytes(bytes); byte datacenterId = bytes[0]; short accountId = getRandomShort(random); short containerId = getRandomShort(random); BlobIdType type = random.nextBoolean() ? BlobIdType.NATIVE : BlobIdType.CRAFTED; PartitionId partitionId = referenceClusterMap.getWritablePartitionIds(MockClusterMap.DEFAULT_PARTITION_CLASS).get(random.nextInt(3)); boolean isEncrypted = random.nextBoolean(); BlobDataType dataType = BlobDataType.values()[random.nextInt(BlobDataType.values().length)]; return new BlobId(version, type, datacenterId, accountId, containerId, partitionId, isEncrypted, dataType); }
Source:
<code><START> public void verifyAPIName(String apiName) throws APIManagerIntegrationTestException { <END> HttpResponse getApi = apiPublisher.getAPI(apiName, "admin"); JSONObject response = new JSONObject(getApi.getData()); log.info("API Infor : " + getApi.getData()); Assert.assertEquals(response.getJSONObject("api").get("name").toString(), apiName, "Expected API name value not match"); }</code><technical_language>this private method</technical_language>

Target:
private void verifyAPIName(String apiName) throws APIManagerIntegrationTestException { HttpResponse getApi = apiPublisher.getAPI(apiName, "admin"); JSONObject response = new JSONObject(getApi.getData()); log.info("API Infor : " + getApi.getData()); Assert.assertEquals(response.getJSONObject("api").get("name").toString(), apiName, "Expected API name value not match"); }