auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void constructsValidWhereClauseForNOTIN() { Map<String, Object> op = new HashMap<String, Object>(); op.put("$in", Arrays.<Object>asList("mike", "fred")); Map<String, Object> notOp = new HashMap<String, Object>(); notOp.put("$not", op); Map<String, Object> name = new HashMap<String, Object>(); name.put("name", notOp); SqlParts where = QuerySqlTranslator.whereSqlForAndClause(Arrays.<Object>asList(name), indexName); String expectedSubWhere = "WHERE \"name\" IN ( ?, ? ))"; String expected = String.format("_id NOT IN (SELECT _id FROM %s %s", indexTable, <START> expectedSubWhere); <END> assertThat(where.sqlWithPlaceHolders, is(expected)); assertThat(where.placeHolderValues, is(arrayContaining("mike", "fred"))); }</code><technical_language>prefer sub-select statement a separate variable. least, balancing bracket for SELECT in string</technical_language>

Target:
public void constructsValidWhereClauseForNOTIN() { Map<String, Object> op = new HashMap<String, Object>(); op.put("$in", Arrays.<Object>asList("mike", "fred")); Map<String, Object> notOp = new HashMap<String, Object>(); notOp.put("$not", op); Map<String, Object> name = new HashMap<String, Object>(); name.put("name", notOp); SqlParts where = QuerySqlTranslator.whereSqlForAndClause(Arrays.<Object>asList(name), indexName); String expected = String.format("_id NOT IN (SELECT _id FROM %s %s)", indexTable, "WHERE \"name\" IN ( ?, ? )"); assertThat(where.sqlWithPlaceHolders, is(expected)); assertThat(where.placeHolderValues, is(arrayContaining("mike", "fred"))); }
Source:
<code>public void test_create_text_type_with_wrong_number_of_parameters_throws_exception() { expectedException.expect(IllegalArgumentException.class); <START> expectedException.expectMessage("The number of parameters for the text data is wrong: 2"); <END> StringType.of(List.of(1, 2)); }</code><technical_language>I realize test case moved, for a separate commit a follow up: error give a hint correct. E.g. StringType a single parameter value, received: ... in other error messages. E.g. 0 point out > 0</technical_language>

Target:
public void test_create_text_type_with_wrong_number_of_parameters_throws_exception() { expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("The text type can only have a single parameter value, received: 2"); StringType.of(List.of(1, 2)); }
Source:
<code>private static void writeBagitFileInternal(final Version version, final Charset encoding, final Long payloadByteCount, final Long payloadFileCount, final Path outputDir) throws IOException{ final Path bagitPath = outputDir.resolve("bagit.txt"); logger.debug("Writing bagit.txt file to [{}]", outputDir); final String firstLine = "BagIt-Version : " + version + System.lineSeparator(); logger.debug("Writing line to [{}]", firstLine, bagitPath); Files.write(bagitPath, firstLine.getBytes(StandardCharsets.UTF_8), StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.CREATE); final String secondLine = "Tag-File-Character-Encoding : " + encoding + System.lineSeparator(); logger.debug("Writing line to [{}]", secondLine, bagitPath); Files.write(bagitPath, secondLine.getBytes(StandardCharsets.UTF_8), StandardOpenOption.WRITE, StandardOpenOption.APPEND); if(version.compareTo(ONE_DOT_ZERO) >= 0 && payloadByteCount != null && payloadFileCount != null){ <START> final String thirdLine = "Payload-Byte-Count : " + payloadByteCount + System.lineSeparator(); <END> Files.write(bagitPath, thirdLine.getBytes(StandardCharsets.UTF_8), StandardOpenOption.WRITE, StandardOpenOption.APPEND); final String fourthLine = "Payload-File-Count : " + payloadFileCount + System.lineSeparator(); Files.write(bagitPath, fourthLine.getBytes(StandardCharsets.UTF_8), StandardOpenOption.WRITE, StandardOpenOption.APPEND); } }</code><technical_language>wondering is right time fix naming convention - firstLine, al. making itch a bit. Also, Files.write code, this is repeatedly opening file a bunch of redundant options getBytes calls repeated line well. of this collapsed a single array 2-4 lines for a single [Files.write](<LINK_0> call form accepts text target output encoding</technical_language>

Target:
private static void writeBagitFileInternal(final Version version, final Charset encoding, final Long payloadByteCount, final Long payloadFileCount, final Path outputDir) throws IOException{ final Path bagitPath = outputDir.resolve("bagit.txt"); logger.debug("Writing bagit.txt file to [{}]", outputDir); final StringBuilder sb = new StringBuilder(100); sb.append("BagIt-Version : ").append(version).append(System.lineSeparator()) .append("Tag-File-Character-Encoding : ").append(encoding).append(System.lineSeparator()); logger.debug("Writing to [{}]", sb.toString(), bagitPath); if(version.compareTo(ONE_DOT_ZERO) >= 0 && payloadByteCount != null && payloadFileCount != null){ sb.append("Payload-Byte-Count : ").append(payloadByteCount).append(System.lineSeparator()) .append("Payload-File-Count : ").append(payloadFileCount).append(System.lineSeparator()); } Files.write(bagitPath, sb.toString().getBytes(StandardCharsets.UTF_8), StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.CREATE); }
Source:
<code>public void handleData(final ITmfEvent event) { super.handleData(event); if (event.getTrace() == trace) { sci.processEvent(event); <START> } else if (experiment != null) { <END> for (ITmfTrace childTrace : experiment.getTraces()) { if (childTrace == event.getTrace()) { sci.processEvent(event); } } } }</code><technical_language>instanceof check instead (trace instanceof TmfExperiment)</technical_language>

Target:
public void handleData(final ITmfEvent event) { super.handleData(event); if (event.getTrace() == trace) { sci.processEvent(event); } else if (trace instanceof TmfExperiment) { for (ITmfTrace childTrace : ((TmfExperiment) trace).getTraces()) { if (childTrace == event.getTrace()) { sci.processEvent(event); } } } }
Source:
<code>void errorOutReadLacKey(final CompletionKey key, final int rc) { <START> LOG.info("Removing completion key: {}", key); <END> final ReadLacCompletion readLacCompletion = (ReadLacCompletion)completionObjects.remove(key); if (null == readLacCompletion) { return; } executor.submitOrdered(readLacCompletion.ledgerId, new SafeRunnable() { @Override public void safeRun() { String bAddress = "null"; Channel c = channel; if (c != null) { bAddress = c.getRemoteAddress().toString(); } LOG.debug("Could not write request readLac for ledgerId: bookie: {}", new Object[] { readLacCompletion.ledgerId, bAddress}); readLacCompletion.cb.readLacComplete(rc, readLacCompletion.ledgerId, null, null, readLacCompletion.ctx); } }); }</code><technical_language>@govind-menon remove change "debug" level</technical_language>

Target:
void errorOutReadLacKey(final CompletionKey key, final int rc) { LOG.debug("Removing completion key: {}", key); final ReadLacCompletion readLacCompletion = (ReadLacCompletion)completionObjects.remove(key); if (null == readLacCompletion) { return; } executor.submitOrdered(readLacCompletion.ledgerId, new SafeRunnable() { @Override public void safeRun() { String bAddress = "null"; Channel c = channel; if (c != null) { bAddress = c.getRemoteAddress().toString(); } LOG.debug("Could not write request readLac for ledgerId: bookie: {}", new Object[] { readLacCompletion.ledgerId, bAddress}); readLacCompletion.cb.readLacComplete(rc, readLacCompletion.ledgerId, null, null, readLacCompletion.ctx); } }); }
Source:
<code>private SerializedValue getSerializedValue(RestAction<?> action, Object object) throws ActionException { String bodyClass = action.getBodyClass(); if (bodyClass != null) { List<ContentType> contentTypes = action.getClientProducedContentTypes(); Serialization serialization = findSerialization(bodyClass, contentTypes); if (serialization != null) { <START> try { <END> return serialize(serialization, object, bodyClass, contentTypes); } catch (SerializationException e) { throw new ActionSerializationException(e); } } } throw new ActionSerializationException( "Unable to serialize request body. No serializer found."); }</code><technical_language>I more readable try-catch part of serialize</technical_language>

Target:
private SerializedValue getSerializedValue(RestAction<?> action, Object object) throws ActionException { String bodyClass = action.getBodyClass(); if (bodyClass != null) { List<ContentType> contentTypes = action.getClientProducedContentTypes(); Serialization serialization = findSerialization(bodyClass, contentTypes); if (serialization != null) { return serialize(serialization, object, bodyClass, contentTypes); } } throw new ActionSerializationException( "Unable to serialize request body. No serializer found."); }
Source:
<code>protected boolean activateOrDeactivateNic(Guid nicId, PlugAction plugAction) { <START> VdcReturnValueBase activateVmNicReturnValue = <END> getBackend().runInternalAction(VdcActionType.ActivateDeactivateVmNic, createActivateDeactivateParameters(nicId, plugAction)); if (!activateVmNicReturnValue.getSucceeded()) { propagateFailure(activateVmNicReturnValue); } return activateVmNicReturnValue.getSucceeded(); }</code><technical_language>return activate deactivate, this variable name generalized returnValue, stating action</technical_language>

Target:
protected boolean activateOrDeactivateNic(Guid nicId, PlugAction plugAction) { VdcReturnValueBase returnValue = getBackend().runInternalAction(VdcActionType.ActivateDeactivateVmNic, createActivateDeactivateParameters(nicId, plugAction)); if (!returnValue.getSucceeded()) { propagateFailure(returnValue); } return returnValue.getSucceeded(); }
Source:
<code>public long getLong(int field) { <START> checkFieldType(field, ImmutableSet.of(BIGINT, INTEGER)); <END> return Long.valueOf(String.valueOf(getFieldValue(field))); }</code><technical_language>(Long) getFieldValue(field); do in other methods</technical_language>

Target:
public long getLong(int field) { checkFieldType(field, ImmutableSet.of(BIGINT, INTEGER)); return (Integer) getFieldValue(field); }
Source:
<code>protected Score score(Item subject, Item candidate) { <START> if (subject.getYear() == null && candidate.getYear() == null) { <END> return nullYearScore; } if (subject.getYear() == null || candidate.getYear() == null) { return mismatchScore; } return subject.getYear().equals(candidate.getYear()) ? matchScore : mismatchScore; }</code><technical_language>I disagree changing behaviour in this method, is longer consistent container year scorer</technical_language>

Target:
protected Score score(Item subject, Item candidate) { if (subject.getYear() == null && candidate.getYear() == null) { return treatNullYearsAsMatch ? matchScore : nullYearScore; } if (subject.getYear() == null || candidate.getYear() == null) { return nullYearScore; } return subject.getYear().equals(candidate.getYear()) ? matchScore : mismatchScore; }
Source:
<code><START> protected void ExecuteVdsBrokerCommand() { <END> storage_pool storagePool = DbFacade.getInstance().getStoragePoolDAO().get(getVds().getstorage_pool_id()); boolean grayedOutLUNsEnabled = Config.<Boolean> GetValue( ConfigValues.GrayedOutLUNsEnabled, storagePool.getcompatibility_version().getValue()); XmlRpcStruct options = new XmlRpcStruct(); if (grayedOutLUNsEnabled) { options.add(VdsProperties.includePartitioned, "true"); } _result = getBroker() .getDeviceList( (int) getParameters().getStorageType().getValue(), options); ProceedProxyReturnValue(); setReturnValue(ParseLUNList(_result.lunList)); }</code><technical_language>Please getStoragePoolDAO() instead of DbFacade.getInstance().getStoragePoolDAO()</technical_language>

Target:
protected void ExecuteVdsBrokerCommand() { storage_pool storagePool = DbFacade.getInstance().getStoragePoolDAO().get(getVds().getstorage_pool_id()); boolean grayedOutLUNsEnabled = Config.<Boolean> GetValue( ConfigValues.FilteringLUNsEnabled, storagePool.getcompatibility_version().getValue()); XmlRpcStruct options = new XmlRpcStruct(); if (grayedOutLUNsEnabled) { options.add(VdsProperties.includePartitioned, "true"); } _result = getBroker() .getDeviceList( (int) getParameters().getStorageType().getValue(), options); ProceedProxyReturnValue(); setReturnValue(ParseLUNList(_result.lunList)); }
Source:
<code>public List<RunT> getLastBuildsOverThreshold(int numberOfBuilds, Result threshold) { RunT r = getLastBuild(); <START> return r.getBuildsOverThreshold(r, numberOfBuilds, threshold); <END> }</code><technical_language>IMHO a run object passing in member function feels awkward. function is starting awkward</technical_language>

Target:
public List<RunT> getLastBuildsOverThreshold(int numberOfBuilds, Result threshold) { RunT r = getLastBuild(); return r.getBuildsOverThreshold(numberOfBuilds, threshold); }
Source:
<code>public void testSchemaStoreRetrieval() { assertNotNull(Framework.getService(SchemaStore.class)); <START> assertNotNull(Framework.getService(AvroSchemaStoreService.class)); <END> }</code><technical_language>In fact this test is useful, framework fail start if injection processed</technical_language>

Target:
public void testSchemaStoreRetrieval() { assertNotNull(Framework.getService(SchemaStore.class)); }
Source:
<code>public void MessageWall_017_CloseAndReopenThread() { MessageWallPageObject wall = new MessageWallPageObject(driver); String timeStamp = wall.getTimeStamp(); String title = PageContent.messageWallTitlePrefix + timeStamp; String message = PageContent.messageWallMessagePrefix + timeStamp; wall.openWikiPage(); CommonFunctions.logInCookie(Properties.userNameStaff, Properties.passwordStaff); wall.openMessageWall(Properties.userNameStaff); wall.writeMessage(title, message); wall.clickPostButton(); wall.verifyPostedMessageWithTitle(title, message); <START> wall.closeThread("reason"); <END> wall.reopenThread(); CommonFunctions.logOut(driver); }</code><technical_language>create a String in PageContent class</technical_language>

Target:
public void MessageWall_017_CloseAndReopenThread() { MessageWallPageObject wall = new MessageWallPageObject(driver); timeStamp = wall.getTimeStamp(); title = PageContent.messageWallTitlePrefix + timeStamp; message = PageContent.messageWallMessagePrefix + timeStamp; wall.openWikiPage(); CommonFunctions.logInCookie(Properties.userNameStaff, Properties.passwordStaff); wall.openMessageWall(Properties.userNameStaff); wall.writeMessage(title, message); wall.clickPostButton(); wall.verifyPostedMessageWithTitle(title, message); wall.closeThread(PageContent.messageWallCloseReopenReason); wall.reopenThread(); CommonFunctions.logOut(driver); }
Source:
<code>public void write(DataOutput out) throws IOException { <START> } <END></code><technical_language>need implement these</technical_language>

Target:
public void write(DataOutput out) throws IOException { throw new UnsupportedOperationException(); }
Source:
<code>public static MapboxWebMapType fromBundle(Bundle bundle) { AirMapType airMapType = AirMapType.fromBundle(bundle); <START> return new MapboxWebMapType(airMapType.getFileName(), airMapType.getMapUrl(), airMapType.getDomain(), bundle.getString(ARG_MAPBOX_ACCESS_TOKEN, ""), bundle.getString(ARG_MAPBOX_MAPID, "")); <END> }</code><technical_language>please lines 100 characters</technical_language>

Target:
public static MapboxWebMapType fromBundle(Bundle bundle) { AirMapType airMapType = AirMapType.fromBundle(bundle); String mapboxAccessToken = bundle.getString(ARG_MAPBOX_ACCESS_TOKEN, ""); String mapboxMapId = bundle.getString(ARG_MAPBOX_MAPID, ""); return new MapboxWebMapType(airMapType.getFileName(), airMapType.getMapUrl(), airMapType.getDomain(), mapboxAccessToken, mapboxMapId); }
Source:
<code>public Collection<PluginInfo> getUninstalledPlugins() { return listJarFiles(uninstalledPluginsDir()) .stream() .map(PluginInfo::create) <START> .collect(Collectors.toList()); <END> }</code><technical_language>suggestion MoreCollectors</technical_language>

Target:
public Collection<PluginInfo> getUninstalledPlugins() { return listJarFiles(uninstalledPluginsDir()) .stream() .map(PluginInfo::create) .collect(MoreCollectors.toList()); }
Source:
<code>public synchronized void cancel() { super.cancel(); while <START> (fEventsQueue.size() >= 1) { <END> fEventIterator.next(); } fEventsQueue.put(END_EVENT); fEventsQueue.flushInputBuffer(); }</code><technical_language>!fEventsQueue.isEmpty() clearer</technical_language>

Target:
public synchronized void cancel() { super.cancel(); while (!fEventsQueue.isEmpty()) { fEventIterator.next(); } fEventsQueue.put(END_EVENT); fEventsQueue.flushInputBuffer(); }
Source:
<code>public void remoteAck(final long seq) { m_es.execute(new Runnable() { @Override public void run() { try { <START> if (!isMaster()) { <END> if (exportLog.isDebugEnabled()) { exportLog.debug("Skip remote RELEASE_BUFFER message for " + seq + " because current stream is master now"); } return; } localAck(seq, seq); if (m_coordinator.isSafePoint(seq)) { if (exportLog.isDebugEnabled()) { exportLog.debug("Passed safe point " + seq + ", resume polling."); } pollImpl(m_pollTask); } } catch (Exception e) { exportLog.error("Error acking export buffer", e); } catch (Error e) { VoltDB.crashLocalVoltDB("Error acking export buffer", true, e); } } }); }</code><technical_language>This match debug log below. ignore a remote Ack if master</technical_language>

Target:
public void remoteAck(final long seq) { m_es.execute(new Runnable() { @Override public void run() { try { if (isMaster()) { if (exportLog.isDebugEnabled()) { exportLog.debug("Skip remote RELEASE_BUFFER message for " + seq + " because current stream is master now"); } return; } localAck(seq, seq); if (m_coordinator.isSafePoint(seq)) { if (exportLog.isDebugEnabled()) { exportLog.debug("Passed safe point " + seq + ", resume polling."); } pollImpl(m_pollTask); } } catch (Exception e) { exportLog.error("Error acking export buffer", e); } catch (Error e) { VoltDB.crashLocalVoltDB("Error acking export buffer", true, e); } } }); }
Source:
<code>public UnsynchronizedSpeedControllerRuntimeException() { <START> super(getName() + "'s CustomSpeedControllers report different speeds"); <END> }</code><technical_language>SpeedController CustomSpeedController</technical_language>

Target:
public UnsynchronizedSpeedControllerRuntimeException() { super(getName() + "'s SpeedControllers report different speeds"); }
Source:
<code>public boolean deleteImage(String id) { Snapshot snapshot = api.snapshotApi().getSnapshot(id); if (snapshot != null) try { logger.debug(">> deleting snapshot %s..", id); return api.snapshotApi().deleteSnapshot(id); } catch (Exception ex) { logger.error(ex, ">> error deleting snapshot %s..", id); } <START> return true; <END> }</code><technical_language>this a return false, cover case official Image is provided cover return catch block is executed</technical_language>

Target:
public boolean deleteImage(String id) { Snapshot snapshot = api.snapshotApi().getSnapshot(id); boolean deleted = false; if (snapshot != null) try { logger.debug(">> deleting snapshot %s..", id); if (api.snapshotApi().deleteSnapshot(id)) { deleted = true; images.removeImage(id); } } catch (Exception ex) { logger.error(ex, ">> error deleting snapshot %s..", id); } return deleted; }
Source:
<code>MembershipManager(Node node, ClusterServiceImpl clusterService, Lock clusterServiceLock) { this.node = node; this.clusterService = clusterService; this.clusterServiceLock = clusterServiceLock; this.nodeEngine = node.getNodeEngine(); this.logger = node.getLogger(getClass()); this.mastershipClaimTimeoutSeconds = node.getProperties().getInteger(MASTERSHIP_CLAIM_TIMEOUT_SECONDS); int partialDisconnectionResolutionHeartbeatCount = node.getProperties().getInteger( PARTIAL_MEMBER_DISCONNECTION_RESOLUTION_HEARTBEAT_COUNT); this.partialDisconnectionDetectionEnabled = partialDisconnectionResolutionHeartbeatCount > 0; long heartbeatIntervalMs = SECONDS.toMillis(node.getProperties().getInteger(HEARTBEAT_INTERVAL_SECONDS)); long partialDisconnectivityDetectionIntervalMs = partialDisconnectionResolutionHeartbeatCount * heartbeatIntervalMs; long heartbeatTimeoutMs = SECONDS.toMillis(node.getProperties().getInteger(MAX_NO_HEARTBEAT_SECONDS)); if (!partialDisconnectionDetectionEnabled) { partialDisconnectivityDetectionIntervalMs = Long.MAX_VALUE; } else if (heartbeatTimeoutMs < partialDisconnectivityDetectionIntervalMs) { partialDisconnectivityDetectionIntervalMs = heartbeatTimeoutMs; } <START> this.partialDisconnectionHandler = new PartialDisconnectionHandler(partialDisconnectivityDetectionIntervalMs, <END> node.getProperties().getInteger(PARTIAL_MEMBER_DISCONNECTION_RESOLUTION_ALGORITHM_TIMEOUT_SECONDS)); registerThisMember(); }</code><technical_language>encapsulate prop readings PartialDisconnectionHandler increase isolation</technical_language>

Target:
MembershipManager(Node node, ClusterServiceImpl clusterService, Lock clusterServiceLock) { this.node = node; this.clusterService = clusterService; this.clusterServiceLock = clusterServiceLock; this.nodeEngine = node.getNodeEngine(); this.logger = node.getLogger(getClass()); this.mastershipClaimTimeoutSeconds = node.getProperties().getInteger(MASTERSHIP_CLAIM_TIMEOUT_SECONDS); int partialDisconnectionResolutionHeartbeatCount = node.getProperties().getInteger( PARTIAL_MEMBER_DISCONNECTION_RESOLUTION_HEARTBEAT_COUNT); this.partialDisconnectionDetectionEnabled = partialDisconnectionResolutionHeartbeatCount > 0; this.partialDisconnectionHandler = new PartialDisconnectionHandler(node.getProperties()); registerThisMember(); }
Source:
<code>public String getQueueName() { if (isUseUserCRPref() && userComputeResourcePreference != null && <START> userComputeResourcePreference.getPreferredBatchQueue() != null) { <END> return userComputeResourcePreference.getPreferredBatchQueue(); } else if (isValid(processModel.getProcessResourceSchedule().getQueueName())) { return processModel.getProcessResourceSchedule().getQueueName(); } else { return gatewayComputeResourcePreference.getPreferredBatchQueue(); } }</code><technical_language>switch isValid != null? Is empty string is valid (I is)? question lines 658 679</technical_language>

Target:
public String getQueueName() { if (isValid(processModel.getProcessResourceSchedule().getQueueName())) { return processModel.getProcessResourceSchedule().getQueueName(); } else if (isUseUserCRPref() && userComputeResourcePreference != null && userComputeResourcePreference.getPreferredBatchQueue() != null) { return userComputeResourcePreference.getPreferredBatchQueue(); } else { return gatewayComputeResourcePreference.getPreferredBatchQueue(); } }
Source:
<code>protected ByteBuffer computeNext() { ByteBuffer chunk = chunks.poll(); while (chunk == null) { <START> try (TraceTokenScope ignored = registerTraceToken(traceToken)) { <END> writer.write(); } catch (Exception e) { throw propagate(e); } chunk = chunks.poll(); } if (chunk == DONE) { return endOfData(); } bytesWritten.addAndGet(chunk.position()); chunk.flip(); return chunk; }</code><technical_language>wrap loop registerTraceToken()? save a bunch of set/unset operations thread local storage</technical_language>

Target:
protected ByteBuffer computeNext() { ByteBuffer chunk = chunks.poll(); if (chunk == null) { try (TraceTokenScope ignored = registerTraceToken(traceToken)) { while (chunk == null) { try { writer.write(); } catch (Exception e) { throw propagate(e); } chunk = chunks.poll(); } } } if (chunk == DONE) { return endOfData(); } bytesWritten.addAndGet(chunk.position()); chunk.flip(); return chunk; }
Source:
<code>private static String toRpn(String str) { MyStack<Character> s = new MyStack<Character>(); String resStr = ""; StringBuilder builder = new StringBuilder(); for (int i = 0; i < str.length(); ++i) { char cur; if (Character.isDigit(str.charAt(i))) { builder.append(str.charAt(i)); if (i != str.length() - 1 && !Character.isDigit(str.charAt(i + 1))) { builder.append(","); } else if (i == str.length() - 1) builder.append(","); } else { if (str.charAt(i) == '(') { s.push(str.charAt(i)); } else { if (str.charAt(i) == '+' || str.charAt(i) == '-' || str.charAt(i) == '/' || str.charAt(i) == '*') { while (!s.isEmpty()) { if (s.peek() == '/' || s.peek() == '*' || ((s.peek() == '-' || s.peek() == '+') && (str .charAt(i) == '-' || str.charAt(i) == '+'))) { builder.append(s.pop().charValue()).append(","); } else break; if (s.isEmpty() || s.peek() == '(') { break; } } s.push(str.charAt(i)); } else { if (str.charAt(i) == ')') { while (!s.isEmpty() && s.peek() != '(') { builder.append(s.pop().charValue()).append(","); } } else { <START> if (str.charAt(i) != ' ' && str.charAt(i) != '\n' <END> && str.charAt(i) != '\t') { return ""; } } } } } if (i == str.length() - 1) { while (!s.isEmpty()) { if (!s.isEmpty()) { cur = s.pop().charValue(); if (cur != '(') builder.append(cur).append(","); } } } } resStr = builder.toString(); return resStr; }</code><technical_language>Character.isWhitespace</technical_language>

Target:
private static String toRpn(String str) { LinkedList<Character> s = new LinkedList<Character>(); StringBuilder builder = new StringBuilder(); for (int i = 0; i < str.length(); ++i) { char cur; if (Character.isDigit(str.charAt(i))) { builder.append(str.charAt(i)); if (i != str.length() - 1 && !Character.isDigit(str.charAt(i + 1))) { builder.append(","); } else if (i == str.length() - 1) { builder.append(","); } } else { if (str.charAt(i) == '(') { s.push(str.charAt(i)); } else { if (str.charAt(i) == '+' || str.charAt(i) == '-' || str.charAt(i) == '/' || str.charAt(i) == '*') { while (!s.isEmpty()) { if (s.peek() == '/' || s.peek() == '*' || ((s.peek() == '-' || s.peek() == '+') && (str .charAt(i) == '-' || str.charAt(i) == '+'))) { builder.append(s.pop().charValue()).append(","); } else { break; } if (s.isEmpty() || s.peek() == '(') { break; } } s.push(str.charAt(i)); } else { if (str.charAt(i) == ')') { while (!s.isEmpty() && s.peek() != '(') { builder.append(s.pop().charValue()).append(","); } } else { if (!Character.isWhitespace(str.charAt(i))) { return ""; } } } } } if (i == str.length() - 1) { while (!s.isEmpty()) { cur = s.pop().charValue(); if (cur != '(') { builder.append(cur).append(","); } } } } return builder.toString(); }
Source:
<code>public static void setup() { <START> callerImpl = new CallerImpl<CallManager.CallEvent>(null) { <END> @Override public CallManager.CallEvent callForEvent(DatabaseClient client, CallArgs args) throws Exception { return null; } }; callbackGeneratorTest = new CallbackGeneratorTest(); }</code><technical_language>if tests public interfaces. way, implementation change freely destabilizing interface. (That's motivation for separating interface implementation.) In other words, tests create a CallManager, caller, args, CallBatcherBuilder, CallBatcher in a developer creating them. way, confirming interfaces developer work correctly. tests execute a call endpoint enode do response. possibility create endpoint takes returns a single double. test callback return 1.1 passed a null event call -- subsequent calls -- save returned in a final set (if is 10) modify args incrementing (if greater 10) returning null. stopping job, test confirm actual set is expected set</technical_language>

Target:
public static void setup() { DatabaseClient adminClient = Common.newServerAdminClient("java-unittest-modules"); JSONDocumentManager docMgr = adminClient.newJSONDocumentManager(); DocumentMetadataHandle docMeta = new DocumentMetadataHandle(); docMeta.getPermissions().add("rest-reader", DocumentMetadataHandle.Capability.EXECUTE); endpointUtil.setupEndpointSingleRequired(docMgr, docMeta, "singleAtomic", "double"); adminClient.release(); callableEndpoint = endpointUtil.makeCallableEndpoint("singleAtomic"); caller = endpointUtil.makeOneCaller(callableEndpoint, Double.class); }
Source:
<code>public boolean isExpired() { try { JWT jwt = this.getIdToken(); JWTClaimsSet claims = jwt.getJWTClaimsSet(); Date expiresOn = claims.getExpirationTime(); Calendar now = Calendar.getInstance(); <START> now.add( Calendar.MINUTE, 5 ); <END> if (expiresOn.before(now.getTime())) { return true; } } catch (ParseException e) { throw new TechnicalException(e); } return false; }</code><technical_language>add 5 minutes for now</technical_language>

Target:
public boolean isExpired() { try { JWT jwt = this.getIdToken(); JWTClaimsSet claims = jwt.getJWTClaimsSet(); Date expiresOn = claims.getExpirationTime(); Calendar now = Calendar.getInstance(); now.add( Calendar.SECOND, idTokenExpireAdvance ); if (expiresOn.before(now.getTime())) { return true; } } catch (ParseException e) { throw new TechnicalException(e); } return false; }
Source:
<code>static IdToken getIdToken(String serviceAccountEmail, Credentials credentials, HttpTransport transport, String targetAudience, boolean includeEmail, Map<String, ?> additionalFields) throws IOException { <START> IdToken token; <END> token = getOIDCToken(serviceAccountEmail, credentials, transport, targetAudience, includeEmail, additionalFields); return token; }</code><technical_language>This method combined getOIDToken</technical_language>

Target:
static IdToken getIdToken( String serviceAccountEmail, Credentials credentials, HttpTransport transport, String targetAudience, boolean includeEmail, Map<String, ?> additionalFields) throws IOException { String idTokenUrl = String.format(ID_TOKEN_URL_FORMAT, serviceAccountEmail); GenericUrl genericUrl = new GenericUrl(idTokenUrl); GenericData idTokenRequest = new GenericData(); idTokenRequest.set("audience", targetAudience); idTokenRequest.set("includeEmail", includeEmail); for (Map.Entry<String, ?> entry : additionalFields.entrySet()) { idTokenRequest.set(entry.getKey(), entry.getValue()); } JsonHttpContent idTokenContent = new JsonHttpContent(OAuth2Utils.JSON_FACTORY, idTokenRequest); HttpCredentialsAdapter adapter = new HttpCredentialsAdapter(credentials); HttpRequest request = transport.createRequestFactory(adapter).buildPostRequest(genericUrl, idTokenContent); JsonObjectParser parser = new JsonObjectParser(OAuth2Utils.JSON_FACTORY); request.setParser(parser); request.setThrowExceptionOnExecuteError(false); HttpResponse response = request.execute(); int statusCode = response.getStatusCode(); if (statusCode >= 400 && statusCode < HttpStatusCodes.STATUS_CODE_SERVER_ERROR) { GenericData responseError = response.parseAs(GenericData.class); Map<String, Object> error = OAuth2Utils.validateMap(responseError, "error", PARSE_ERROR_MESSAGE); String errorMessage = OAuth2Utils.validateString(error, "message", PARSE_ERROR_MESSAGE); throw new IOException( String.format("Error code %s trying to getIDToken: %s", statusCode, errorMessage)); } if (statusCode != HttpStatusCodes.STATUS_CODE_OK) { throw new IOException( String.format( "Unexpected Error code %s trying to getIDToken: %s", statusCode, response.parseAsString())); } InputStream content = response.getContent(); if (content == null) { throw new IOException("Empty content from generateIDToken server request."); } GenericJson responseData = response.parseAs(GenericJson.class); String rawToken = OAuth2Utils.validateString(responseData, "token", PARSE_ERROR_MESSAGE); return IdToken.create(rawToken); }
Source:
<code>public void getAppConfigForUser() { Survey survey = Survey.create(); survey.setIdentifier("theIdentifier"); survey.setGuid(SURVEY_REF_LIST.get(0).getGuid()); survey.setCreatedOn(SURVEY_REF_LIST.get(0).getCreatedOn().getMillis()); <START> when(surveyService.getSurvey(SURVEY_KEY)).thenReturn(survey); <END> CriteriaContext context = new CriteriaContext.Builder() .withClientInfo(ClientInfo.fromUserAgentCache("app/7 (Motorola Flip-Phone; Android/14) BridgeJavaSDK/10")) .withStudyIdentifier(TEST_STUDY).build(); AppConfig appConfig2 = setupConfigsForUser(); AppConfig match = service.getAppConfigForUser(context, true); assertEquals(appConfig2, match); assertEquals("theIdentifier", match.getSurveyReferences().get(0).getIdentifier()); }</code><technical_language>Unit test for case survey exist</technical_language>

Target:
public void getAppConfigForUser() { Survey survey = Survey.create(); survey.setIdentifier("theIdentifier"); survey.setGuid(SURVEY_REF_LIST.get(0).getGuid()); survey.setCreatedOn(SURVEY_REF_LIST.get(0).getCreatedOn().getMillis()); when(surveyService.getSurvey(SURVEY_KEY, false)).thenReturn(survey); CriteriaContext context = new CriteriaContext.Builder() .withClientInfo(ClientInfo.fromUserAgentCache("app/7 (Motorola Flip-Phone; Android/14) BridgeJavaSDK/10")) .withStudyIdentifier(TEST_STUDY).build(); AppConfig appConfig2 = setupConfigsForUser(); AppConfig match = service.getAppConfigForUser(context, true); assertEquals(appConfig2, match); assertEquals("theIdentifier", match.getSurveyReferences().get(0).getIdentifier()); }
Source:
<code>public static TestTable getSerialTable() { return new TestTable( TableSchema.builder() .field("f0", DataTypes.SMALLINT()) .field("f1", DataTypes.INT()) .field("f2", DataTypes.SMALLINT()) .field("f3", DataTypes.INT()) .field("f4", DataTypes.BIGINT()) .field("f5", DataTypes.BIGINT()) .build(), "f0 smallserial, " + "f1 serial, " + "f2 serial2, " + "f3 serial4, " + "f4 serial8, " + "f5 bigserial", <START> "0," + "1," + "2," + "3," + "4," + "5" <END> ); }</code><technical_language>This values is used. add a ITCase read serial type data properly check type mapping logic? more meaningful values "32767, 2147483647, 32767, 2147483647 , 9223372036854775807, 9223372036854775807"</technical_language>

Target:
public static TestTable getSerialTable() { return new TestTable( TableSchema.builder() .field("f0", DataTypes.SMALLINT().notNull()) .field("f1", DataTypes.INT().notNull()) .field("f2", DataTypes.SMALLINT().notNull()) .field("f3", DataTypes.INT().notNull()) .field("f4", DataTypes.BIGINT().notNull()) .field("f5", DataTypes.BIGINT().notNull()) .build(), "f0 smallserial, " + "f1 serial, " + "f2 serial2, " + "f3 serial4, " + "f4 serial8, " + "f5 bigserial", "32767," + "2147483647," + "32767," + "2147483647," + "9223372036854775807," + "9223372036854775807" ); }
Source:
<code>private boolean isExportCommandAvailable() { ArrayList<Disk> disks = (ArrayList<Disk>) getSelectedItems(); <START> if (disks == null || disks.size() < 1) { <END> return false; } for (Disk disk : disks) { if (disk.getDiskStorageType() != DiskStorageType.IMAGE) { return false; } DiskImage diskImage = (DiskImage) disk; if (diskImage.getImageStatus() != ImageStatus.OK || !diskImage.getParentId().equals(Guid.Empty)) { return false; } } return true; }</code><technical_language>disks.isEmpty()</technical_language>

Target:
private boolean isExportCommandAvailable() { ArrayList<Disk> disks = (ArrayList<Disk>) getSelectedItems(); if (disks == null || disks.isEmpty()) { return false; } for (Disk disk : disks) { if (disk.getDiskStorageType() != DiskStorageType.IMAGE) { return false; } DiskImage diskImage = (DiskImage) disk; if (diskImage.getImageStatus() != ImageStatus.OK || !diskImage.getParentId().equals(Guid.Empty)) { return false; } } return true; }
Source:
<code>private static void removeOutputFiles(@NotNull Collection<String> removedFiles, @NotNull File... outputDirectories) { for (File dir : outputDirectories) { List<File> outputErlangModuleFiles = ContainerUtil.concat(getBeams(findErlFiles(removedFiles), dir), getAppsOutput(findAppFiles(removedFiles), dir)); for (File output : outputErlangModuleFiles) { if (output.exists()) { <START> output.delete(); <END> } } } }</code><technical_language>want log if fail delete a file</technical_language>

Target:
private static void removeOutputFiles(@NotNull Collection<String> removedFiles, @NotNull File... outputDirectories) { for (File dir : outputDirectories) { List<File> outputErlangModuleFiles = ContainerUtil.concat(getBeams(findErlFiles(removedFiles), dir), getAppsOutput(findAppFiles(removedFiles), dir)); for (File output : outputErlangModuleFiles) { if (output.exists() && !output.delete()) { LOG.warn("Can't delete file " + output.getAbsolutePath()); } } } }
Source:
<code>public void testSendMultipleBroadcasts() throws InterruptedException { int[] values = new int[] {30, 60, -30, -60}; List<UserVariable> variables = createProject(values); baseActivityTestRule.launchActivity(null); <START> Thread.sleep(1500); <END> for (int i = 0; i < variables.size(); i++) { UiTestUtils.waitForVariableValueEquals(variables.get(i), values[i], 2000); } }</code><technical_language>if this is required waitForVariableValueEquals function below, timeout for is short</technical_language>

Target:
public void testSendMultipleBroadcasts() throws InterruptedException { baseActivityTestRule.launchActivity(null); for (int i = 0; i < userVariables.size(); i++) { Assert.assertTrue(StageTestUtils.userVariableEqualsWithinTimeout(userVariables.get(i), VALUES[i], 2000)); } }
Source:
<code>public Set<URI> getHasSelfImplyingType(final Resource type){ final Set<URI> properties = new HashSet<>(); <START> properties.addAll(hasSelfByType.get(type)); <END> if (type instanceof URI) { for (final URI subtype : findParents(subClassOfGraph, (URI) type)) { properties.addAll(hasSelfByType.get(subtype)); } } return properties; }</code><technical_language>This line NPE if is hasSelf property type. unrelated tests fail if HasSelfVisitor a chance visit -- statement pattern "?x rdf:type :T" end here, needs check hasSelf logic applies proceeding</technical_language>

Target:
public Set<URI> getHasSelfImplyingType(final Resource type){ final Set<URI> properties = new HashSet<>(); Set<URI> tempProperties = hasSelfByType.get(type); if (tempProperties != null) { properties.addAll(tempProperties); } if (type instanceof URI) { for (final URI subtype : findParents(subClassOfGraph, (URI) type)) { tempProperties = hasSelfByType.get(subtype); if (tempProperties != null) { properties.addAll(tempProperties); } } } return properties; }
Source:
<code>protected Ecdsa() { <START> super("NONEwithEDCSA"); <END> }</code><technical_language>Is ECDSA EDCSA</technical_language>

Target:
protected Ecdsa() { super("NONEwithECDSA"); }
Source:
<code>public ICommandShell createCommandShell() { <START> LTTngToolsFileShell shell <END> = fShell; if (shell == null) { shell = new LTTngToolsFileShell(); if ((fTestFile != null) && (fScenario != null)) { shell.loadScenarioFile(fTestFile); shell.setScenario(fScenario); } fShell = shell; } return shell; }</code><technical_language>good multi-thread catch</technical_language>

Target:
public ICommandShell createCommandShell() { LTTngToolsFileShell shell = fShell; if (shell == null) { shell = new LTTngToolsFileShell(); if ((fTestFile != null) && (fScenario != null)) { shell.loadScenarioFile(fTestFile); shell.setScenario(fScenario); fShell = shell; } fShell = shell; } return shell; }
Source:
<code>private JsonToRowDataConverter wrapIntoNullableConverter( JsonToRowDataConverter converter) { return jsonNode -> { <START> if (jsonNode == null || jsonNode.isNull() || jsonNode instanceof MissingNode) { <END> return null; } try { return converter.convert(jsonNode); } catch (Throwable t) { if (!ignoreParseErrors) { throw t; } return null; } }; }</code><technical_language>jsonNode.isMissingNode() here</technical_language>

Target:
private JsonToRowDataConverter wrapIntoNullableConverter( JsonToRowDataConverter converter) { return jsonNode -> { if (jsonNode == null || jsonNode.isNull() || jsonNode.isMissingNode()) { return null; } try { return converter.convert(jsonNode); } catch (Throwable t) { if (!ignoreParseErrors) { throw t; } return null; } }; }
Source:
<code>public T take() { fOutputLock.lock(); try { if (fOutputBuffer.isEmpty()) { <START> @SuppressWarnings("null") <END> Deque<T> value = fInnerQueue.remove(); if (!value.isEmpty()) { Activator.instance().logError("Queue chunk not empty " + value); } while (fInnerQueue.isEmpty()) { fInnerQueueNotEmpty.await(); } fOutputBuffer = checkNotNull(fInnerQueue.peek()); } T element = checkNotNull(fOutputBuffer.remove()); fSize.decrementAndGet(); return element; } catch (InterruptedException e) { Activator.instance().logError(BUFFERED_QUEUE_INTERRUPTED, e); Thread.currentThread().interrupt(); throw new IllegalStateException(e); } finally { fOutputLock.unlock(); } }</code><technical_language>add external annotations for BlockingDeque</technical_language>

Target:
public T take() { fOutputLock.lock(); try { if (fOutputBuffer.isEmpty()) { Deque<T> value = fInnerQueue.remove(); if (!value.isEmpty()) { Activator.instance().logError("Queue chunk not empty " + value); } while (fInnerQueue.isEmpty()) { fInnerQueueNotEmpty.await(); } fOutputBuffer = checkNotNull(fInnerQueue.peek()); } T element = checkNotNull(fOutputBuffer.remove()); fSize.decrementAndGet(); return element; } catch (InterruptedException e) { Activator.instance().logError(BUFFERED_QUEUE_INTERRUPTED, e); Thread.currentThread().interrupt(); throw new IllegalStateException(e); } finally { fOutputLock.unlock(); } }
Source:
<code>private Change computeChangeFromGamma(CompositeKeyHashMap<TransactionRecord, Integer, Artifact> bulkLoaded, IOseeBranch startTxBranch, ChangeItem item) { Change change = null; try { int artId = item.getArtId(); Long destGamma = item.getDestinationVersion().getGammaId(); Long baseGamma = item.getBaselineVersion().getGammaId(); Artifact startTxArtifact; Artifact endTxArtifact; if (txDelta.areOnTheSameBranch()) { startTxArtifact = bulkLoaded.get(txDelta.getStartTx(), artId); endTxArtifact = bulkLoaded.get(txDelta.getEndTx(), artId); } else { startTxArtifact = bulkLoaded.get(txDelta.getEndTx(), artId); endTxArtifact = bulkLoaded.get(txDelta.getStartTx(), artId); } Artifact baseTxArtifact; if ((baseGamma != null) && baseGamma.equals(destGamma)) { baseTxArtifact = startTxArtifact; } else { if (baseGamma == null) { baseTxArtifact = endTxArtifact; } <START> baseTxArtifact = bulkLoaded.get(txDelta.getStartTx().getBranch().getBaseTransaction(), artId); <END> } ArtifactDelta artifactDelta = new ArtifactDelta(txDelta, startTxArtifact, endTxArtifact, baseTxArtifact); change = createChangeObject(bulkLoaded, item, txDelta, startTxBranch, artifactDelta); change.setChangeItem(item); } catch (Exception ex) { OseeLog.log(Activator.class, Level.SEVERE, ex); change = new ErrorChange(startTxBranch, item.getArtId(), ex.toString()); } return change; }</code><technical_language>line in 'else'? (If base gamma is null set baseTx do get?_</technical_language>

Target:
private Change computeChangeFromGamma(CompositeKeyHashMap<TransactionRecord, Integer, Artifact> bulkLoaded, IOseeBranch startTxBranch, ChangeItem item) { Change change = null; try { int artId = item.getArtId(); Long destGamma = item.getDestinationVersion().getGammaId(); Long baseGamma = item.getBaselineVersion().getGammaId(); Artifact startTxArtifact; Artifact endTxArtifact; if (txDelta.areOnTheSameBranch()) { startTxArtifact = bulkLoaded.get(txDelta.getStartTx(), artId); endTxArtifact = bulkLoaded.get(txDelta.getEndTx(), artId); } else { startTxArtifact = bulkLoaded.get(txDelta.getEndTx(), artId); endTxArtifact = bulkLoaded.get(txDelta.getStartTx(), artId); } Artifact baseTxArtifact; if ((baseGamma != null) && baseGamma.equals(destGamma)) { baseTxArtifact = startTxArtifact; } else { baseTxArtifact = bulkLoaded.get(txDelta.getStartTx().getBranch().getBaseTransaction(), artId); } ArtifactDelta artifactDelta = new ArtifactDelta(txDelta, startTxArtifact, endTxArtifact, baseTxArtifact); change = createChangeObject(bulkLoaded, item, txDelta, startTxBranch, artifactDelta); change.setChangeItem(item); } catch (Exception ex) { OseeLog.log(Activator.class, Level.SEVERE, ex); change = new ErrorChange(startTxBranch, item.getArtId(), ex.toString()); } return change; }
Source:
<code>private void shutdownMySqlAbandonedConnectionCleanupThread() { try { Class<?> cleanupThreadsClass = findMySqlDriverClass(); if (cleanupThreadsClass == null) { logger.warn("No AbandonedConnectionCleanupThread class found. Check if thread class is between " + CONNECTION_CLEANUP_THREAD_KNOWN_CLASS_ADDRESES.toString()); throw new ClassNotFoundException(CONNECTION_CLEANUP_THREAD_KNOWN_CLASS_ADDRESES.get(0)); } shutdownMySqlConnectionCleanupThreads(cleanupThreadsClass); try { cleanMySqlCleanupThreadsThreadFactory(cleanupThreadsClass); <START> } catch (NoSuchFieldException e) { <END> logger.warn("Error cleaning threadFactory from AbandonedConnectionCleanupThread executor service"); } } catch (ClassNotFoundException | NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { logger.warn("Unable to shutdown MySql's AbandonedConnectionCleanupThread", e); } }</code><technical_language>need for this double nested try/catch, move this block cleanMySqlCleanupThreadsThreadFactory method if want log this cleanup failed. Is more cohesive handle exception for logging in method logic failed</technical_language>

Target:
private void shutdownMySqlAbandonedConnectionCleanupThread() { try { Class<?> cleanupThreadsClass = findMySqlDriverClass(); shutdownMySqlConnectionCleanupThreads(cleanupThreadsClass); cleanMySqlCleanupThreadsThreadFactory(cleanupThreadsClass); } catch (ClassNotFoundException | NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { logger.warn("Unable to shutdown MySql's AbandonedConnectionCleanupThread", e); } }
Source:
<code>public void dispose() { <START> fSegmentArray = null; <END> }</code><technical_language>clear fields here</technical_language>

Target:
public void dispose() { fSegmentArray = null; fTableViewer = null; fComparator = null; }
Source:
<code>private boolean isWorkItemAvailable(final PortableWorkDefinition pwd) { if (isNewColumn()) { return !getPresenter() .getModel() .getActionCols() .stream() .filter(a -> a instanceof ActionWorkItemCol52) .map(a -> ((ActionWorkItemCol52) a).getWorkItemDefinition()) .anyMatch(p -> p.getName().equals(pwd.getName())); <START> } <END> return true; }</code><technical_language>Thanks for letting know, I objections, I a again</technical_language>

Target:
private boolean isWorkItemAvailable(final PortableWorkDefinition pwd) { final boolean isUsedInModel = getPresenter() .getModel() .getActionCols() .stream() .filter(a -> a instanceof ActionWorkItemCol52) .map(a -> ((ActionWorkItemCol52) a).getWorkItemDefinition()) .anyMatch(p -> p.getName().equals(pwd.getName())); if (isNewColumn()) { return !isUsedInModel; } else if (!isWorkItemSet()) { return !isUsedInModel; } else { final String pwdName = pwd.getName(); return pwdName.equals(getWorkItemDefinition().getName()) || !isUsedInModel; } }
Source:
<code>protected Manager(HttpPipeline httpPipeline, AzureProfile profile, InnerT innerManagementClient) { this.httpPipeline = httpPipeline; if (httpPipeline != null) { <START> ResourceManager.Configurable resourceConfigurable = ResourceManager.configure(); <END> withInternalHttpPipeline(resourceConfigurable, httpPipeline); this.resourceManager = resourceConfigurable.authenticate(null, profile).withDefaultSubscription(); } this.subscriptionId = profile.getSubscriptionId(); this.environment = profile.getEnvironment(); this.innerManagementClient = innerManagementClient; }</code><technical_language>is this part of code resuable</technical_language>

Target:
protected Manager(HttpPipeline httpPipeline, AzureProfile profile, InnerT innerManagementClient) { this.httpPipeline = httpPipeline; if (httpPipeline != null) { this.resourceManager = AzureConfigurableImpl .configureHttpPipeline(httpPipeline, ResourceManager.configure()) .authenticate(null, profile) .withDefaultSubscription(); } this.subscriptionId = profile.getSubscriptionId(); this.environment = profile.getEnvironment(); this.innerManagementClient = innerManagementClient; }