auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public GHPoint intermediatePoint(double f, double lat1, double lon1, double lat2, double lon2) { double lat1radians = Math.toRadians(lat1); double lon1radians = Math.toRadians(lon1); double lat2radians = Math.toRadians(lat2); double lon2radians = Math.toRadians(lon2); double deltaLat = lat2radians - lat1radians; double deltaLon = lon2radians - lon1radians; double a = Math.sin(deltaLat/2) * Math.sin(deltaLat/2) + Math.cos(lat1radians) * Math.cos(lat2radians) * Math.sin(deltaLon/2) * Math.sin(deltaLon/2); double angularDistance = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); if (angularDistance == 0) return new GHPoint(lat1, lon1); double A = Math.sin((1-f)*angularDistance) / Math.sin(angularDistance); double B = Math.sin(f*angularDistance) / Math.sin(angularDistance); <START> double x = A * Math.cos(lat1radians) * Math.cos(lon1radians) + B * Math.cos(lat2radians) * Math.cos(lon2radians); <END> double y = A * Math.cos(lat1radians) * Math.sin(lon1radians) + B * Math.cos(lat2radians) * Math.sin(lon2radians); double z = A * Math.sin(lat1radians) + B * Math.sin(lat2radians); double midLat = Math.toDegrees(Math.atan2(z, Math.sqrt(x*x + y*y))); double midLon = Math.toDegrees(Math.atan2(y, x)); return new GHPoint(midLat, midLon); }</code><technical_language>avoid recompute stuff Math.cos(lat1radians)</technical_language>

Target:
public GHPoint intermediatePoint(double f, double lat1, double lon1, double lat2, double lon2) { double lat1radians = Math.toRadians(lat1); double lon1radians = Math.toRadians(lon1); double lat2radians = Math.toRadians(lat2); double lon2radians = Math.toRadians(lon2); double deltaLat = lat2radians - lat1radians; double deltaLon = lon2radians - lon1radians; double cosLat1 = cos(lat1radians); double cosLat2 = cos(lat2radians); double sinHalfDeltaLat = sin(deltaLat / 2); double sinHalfDeltaLon = sin(deltaLon / 2); double a = sinHalfDeltaLat * sinHalfDeltaLat + cosLat1 * cosLat2 * sinHalfDeltaLon * sinHalfDeltaLon; double angularDistance = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); double sinDistance = sin(angularDistance); if (angularDistance == 0) return new GHPoint(lat1, lon1); double A = Math.sin((1-f)*angularDistance) / sinDistance; double B = Math.sin(f*angularDistance) / sinDistance; double x = A * cosLat1 * cos(lon1radians) + B * cosLat2 * cos(lon2radians); double y = A * cosLat1 * sin(lon1radians) + B * cosLat2 * sin(lon2radians); double z = A * sin(lat1radians) + B * sin(lat2radians); double midLat = Math.toDegrees(Math.atan2(z, Math.sqrt(x*x + y*y))); double midLon = Math.toDegrees(Math.atan2(y, x)); return new GHPoint(midLat, midLon); }
Source:
<code>public boolean matches(ITmfEvent event) { boolean match = false; if (event.getTrace().getClass().equals(fTraceClass)) { if (fTraceClass == CustomTxtTrace.class || fTraceClass == CustomXmlTrace.class) { <START> if (fTraceTypeId.endsWith(':' + event.getType().getName())) { <END> match = true; } } else { match = true; } } if (match) { for (ITmfFilterTreeNode node : getChildren()) { if (! node.matches(event)) { return false; } } return true; } return false; }</code><technical_language>hardcoded ':'! Also, if 2 trace types name in a category some incorrect matches. CustomTraceDefinition contains category trace type name for advantage</technical_language>

Target:
public boolean matches(ITmfEvent event) { boolean match = false; ITmfTrace trace = event.getTrace(); if (trace.getClass().equals(fTraceClass)) { if (fTraceTypeId != null) { if (fTraceTypeId.equals(trace.getTraceTypeId())) { match = true; } } else { match = true; } } if (match) { for (ITmfFilterTreeNode node : getChildren()) { if (! node.matches(event)) { return false; } } return true; } return false; }
Source:
<code>public void processJobExecuteResponse(UUID nodeId, GridJobExecuteResponse msg) { assert nodeId != null; assert msg != null; lock.readLock(); try { <START> GridTaskWorker<?, ?> task = tasks.get(msg.getSessionId()); if (stopping && !waiting) { U.warn(log, "Received job execution response while stopping grid (will ignore): " + msg + (task != null && task.getSession() != null ? (", " + task.getSession().getTaskName()) : "")); <END> return; } if (task == null) { if (log.isDebugEnabled()) log.debug("Received job execution response for unknown task (was task already reduced?): " + msg); return; } if (log.isDebugEnabled()) log.debug("Received grid job response message [msg=" + msg + ", nodeId=" + nodeId + ']'); task.onResponse(msg); } finally { lock.readUnlock(); } }</code><technical_language>similar code block repeats 5 times. refactored separate method, tryResolveTaskName(sesId)</technical_language>

Target:
public void processJobExecuteResponse(UUID nodeId, GridJobExecuteResponse msg) { assert nodeId != null; assert msg != null; lock.readLock(); try { GridTaskWorker<?, ?> task = tasks.get(msg.getSessionId()); if (stopping && !waiting) { U.warn(log, "Received job execution response while stopping grid (will ignore): " + msg + tryResolveTaskName(task)); return; } if (task == null) { if (log.isDebugEnabled()) log.debug("Received job execution response for unknown task (was task already reduced?): " + msg); return; } if (log.isDebugEnabled()) log.debug("Received grid job response message [msg=" + msg + ", nodeId=" + nodeId + ']'); task.onResponse(msg); } finally { lock.readUnlock(); } }
Source:
<code>protected void after() { System.setOut(originalOut); System.setErr(originalErr); <START> System.out.println("What was captured:"); <END> System.out.println(out); }</code><technical_language>I disagree... is job of client of OutputCapture print stuff if sense. In cases, not. if does, a logger</technical_language>

Target:
protected void after() { System.setOut(originalOut); System.setErr(originalErr); }
Source:
<code>public SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX() <START> <END></code><technical_language>leave this empty - add call _super()_ - is implicit, this enables placing a debug breakpoint in constructor</technical_language>

Target:
public SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX() { super(); }
Source:
<code>public void clientCallback(final ClientResponse response) throws Exception { byte status = response.getStatus(); if (status == ClientResponse.SUCCESS) { if (m_callbackExecutor != null && m_successCallback != null) { m_callbackExecutor.execute(new Runnable() { @Override public void run() { m_successCallback.success(m_csvLine, response); } }); } } <START> else if (status != ClientResponse.CONNECTION_LOST){ <END> m_failedCount.incrementAndGet(); m_errHandler.handleError(m_csvLine, response, response.getStatusString()); } long currentCount = m_processedCount.incrementAndGet(); if (currentCount % m_reportEveryNRows == 0) { m_log.info("Inserted " + (currentCount - m_failedCount.get()) + " rows"); } }</code><technical_language>This connection loss in callback, is retry</technical_language>

Target:
public void clientCallback(final ClientResponse response) throws Exception { byte status = response.getStatus(); if (status == ClientResponse.SUCCESS) { if (m_callbackExecutor != null && m_successCallback != null) { m_callbackExecutor.execute(new Runnable() { @Override public void run() { m_successCallback.success(m_csvLine, response); } }); } } else if (status == ClientResponse.CONNECTION_LOST && m_autoReconnect) { m_reinsertExecutor.execute(new Runnable() { @Override public void run() { try { insert(m_csvLine, m_values); } catch (InterruptedException e) { m_log.error("CSVLoader interrupted: " + e); } } }); return; } else { m_failedCount.incrementAndGet(); m_errHandler.handleError(m_csvLine, response, response.getStatusString()); } long currentCount = m_processedCount.incrementAndGet(); if (currentCount % m_reportEveryNRows == 0) { m_log.info("Inserted " + (currentCount - m_failedCount.get()) + " rows"); } }
Source:
<code>static Properties attemptLoadAsResource(String propertiesFile, ClassLoader classLoader) { LOGGER.debug("Attempting to load properties as a resource: {}", propertiesFile); InputStream ins = PropertiesLoader.class.getResourceAsStream(propertiesFile); Properties properties = new Properties(); if (ins != null) { try { properties.load(ins); <START> ins.close(); <END> } catch (IOException e) { LOGGER.debug("Unable to load properties: {}", propertiesFile, e); properties.clear(); } finally { IOUtils.closeQuietly(ins); } } return properties; }</code><technical_language>need close here; finally block manage this for you</technical_language>

Target:
static Properties attemptLoadAsResource(String propertiesFile, ClassLoader classLoader) { LOGGER.debug("Attempting to load properties as a resource: {}", propertiesFile); InputStream ins = PropertiesLoader.class.getResourceAsStream(propertiesFile); Properties properties = new Properties(); if (ins != null) { try { properties.load(ins); } catch (IOException e) { LOGGER.debug("Unable to load properties: {}", propertiesFile, e); } finally { IOUtils.closeQuietly(ins); } } return properties; }
Source:
<code>protected void validateCurrentPassword(UserVO user, String currentPassword) { AccountVO userAccount = _accountDao.findById(user.getAccountId()); boolean currentPasswordMatchesDataBasePassword = false; for (UserAuthenticator userAuthenticator : _userPasswordEncoders) { Pair<Boolean, ActionOnFailedAuthentication> authenticationResult = userAuthenticator.authenticate(user.getUsername(), currentPassword, userAccount.getDomainId(), null); if (authenticationResult == null) { s_logger.trace(String.format("Authenticator [%s] is returning null for the authenticate mehtod.", userAuthenticator.getClass())); continue; } if (BooleanUtils.toBoolean(authenticationResult.first())) { s_logger.debug(String.format("User [id=%s] re-authenticated [authenticator=%s] during password update.", user.getUuid(), userAuthenticator.getName())); currentPasswordMatchesDataBasePassword = true; break; } } if (!currentPasswordMatchesDataBasePassword) { <START> throw new InvalidParameterValueException("Current password informed does not match the database password."); <END> } }</code><technical_language>I prefer "Current password is incorrect."</technical_language>

Target:
protected void validateCurrentPassword(UserVO user, String currentPassword) { AccountVO userAccount = _accountDao.findById(user.getAccountId()); boolean currentPasswordMatchesDataBasePassword = false; for (UserAuthenticator userAuthenticator : _userPasswordEncoders) { Pair<Boolean, ActionOnFailedAuthentication> authenticationResult = userAuthenticator.authenticate(user.getUsername(), currentPassword, userAccount.getDomainId(), null); if (authenticationResult == null) { s_logger.trace(String.format("Authenticator [%s] is returning null for the authenticate mehtod.", userAuthenticator.getClass())); continue; } if (BooleanUtils.toBoolean(authenticationResult.first())) { s_logger.debug(String.format("User [id=%s] re-authenticated [authenticator=%s] during password update.", user.getUuid(), userAuthenticator.getName())); currentPasswordMatchesDataBasePassword = true; break; } } if (!currentPasswordMatchesDataBasePassword) { throw new InvalidParameterValueException("Current password is incorrect."); } }
Source:
<code><START> public void setDataSources(List<DataSource> dataSources) { <END> this.dataSources = dataSources; }</code><technical_language>I need access dataSources is thread safe</technical_language>

Target:
synchronized void setDataSources(List<DataSource> dataSources) { this.dataSources = dataSources; }
Source:
<code>private boolean isUsedSlot(int dimIndex) { final int index = dimIndex / 8; final int extraIndex = dimIndex % 8; final int usedByte = 1 << extraIndex; <START> return (usedFlagBuffer.get(index) & usedByte) == usedByte; <END> }</code><technical_language>!= 0 slightly more efficient</technical_language>

Target:
private boolean isUsedSlot(int dimIndex) { final int index = dimIndex / Byte.SIZE; final int extraIndex = dimIndex % Byte.SIZE; final int usedFlagByte = 1 << extraIndex; return (usedFlagBuffer.get(index) & usedFlagByte) != 0; }
Source:
<code>protected void configure() { Multibinder<RuntimeInfrastructure> infrastructures = Multibinder.newSetBinder(binder(), RuntimeInfrastructure.class); infrastructures.addBinding().to(OpenShiftInfrastructure.class); bind(InfrastructureProvisioner.class).to(OpenShiftInfrastructureProvisioner.class); <START> bind(ConfigurationProvisioner.class).to(PersistentVolumeClaimProvisioner.class); <END> install(new FactoryModuleBuilder().build(OpenShiftRuntimeContextFactory.class)); install(new FactoryModuleBuilder().build(OpenShiftRuntimeFactory.class)); install(new FactoryModuleBuilder().build(OpenShiftBootstrapperFactory.class)); }</code><technical_language>I guess this binding is useless</technical_language>

Target:
protected void configure() { Multibinder<RuntimeInfrastructure> infrastructures = Multibinder.newSetBinder(binder(), RuntimeInfrastructure.class); infrastructures.addBinding().to(OpenShiftInfrastructure.class); install(new FactoryModuleBuilder().build(OpenShiftRuntimeContextFactory.class)); install(new FactoryModuleBuilder().build(OpenShiftRuntimeFactory.class)); install(new FactoryModuleBuilder().build(OpenShiftBootstrapperFactory.class)); }
Source:
<code>public MoveToBlockAITask build(Creature owner) { Preconditions.checkNotNull(destinationPredicate); IMixinMoveToBlock aiTask = (IMixinMoveToBlock) (Object) new EntityAIMoveToBlock((EntityCreature) owner, this.speed, this.searchRange) { @Override protected boolean shouldMoveTo(net.minecraft.world.World worldIn, BlockPos pos) { <START> return destinationPredicate.test(((World) worldIn).getLocation(pos.getX(), pos.getY(), pos.getZ())); <END> } }; aiTask.setDestinationPredicate(destinationPredicate); return (MoveToBlockAITask) aiTask; }</code><technical_language>I this code future change predicate for destination ineffective</technical_language>

Target:
public MoveToBlockAITask build(Creature owner) { Preconditions.checkNotNull(destinationPredicate); IMixinEntityAIMoveToBlock aiTask = (IMixinEntityAIMoveToBlock) (Object) new EntityAIMoveToBlock((EntityCreature) owner, this.speed, this.searchRange) { @Override protected boolean shouldMoveTo(net.minecraft.world.World worldIn, BlockPos pos) { return ((IMixinEntityAIMoveToBlock) (Object) this).getDestinationPredicate().test(((World) worldIn).getLocation(pos.getX(), pos.getY(), pos.getZ())); } }; aiTask.setDestinationPredicate(destinationPredicate); return (MoveToBlockAITask) aiTask; }
Source:
<code><START> private void drawAxes() { <END> GlyphLayout layout = getScaledFont(); batch.setProjectionMatrix(camera.combined); batch.begin(); batch.draw(axes, -virtualWidthHalf, -AXIS_WIDTH / 2, virtualWidth, AXIS_WIDTH); batch.draw(axes, -AXIS_WIDTH / 2, -virtualHeightHalf, AXIS_WIDTH, virtualHeight); final float fontOffset = layout.height / 2; font.draw(batch, "-" + (int) virtualWidthHalf, -virtualWidthHalf + fontOffset, -fontOffset); font.draw(batch, String.valueOf((int) virtualWidthHalf), virtualWidthHalf - layout.width, -fontOffset); font.draw(batch, "-" + (int) virtualHeightHalf, fontOffset, -virtualHeightHalf + layout.height + fontOffset); font.draw(batch, String.valueOf((int) virtualHeightHalf), fontOffset, virtualHeightHalf - fontOffset); font.draw(batch, "0", fontOffset, -fontOffset); batch.end(); font.getData().setScale(1.2f); }</code><technical_language>method side effect... called this, reset font scale factor yourself..</technical_language>

Target:
private void drawAxes() { GlyphLayout layout = getScaledFont(); batch.setProjectionMatrix(camera.combined); batch.begin(); batch.draw(axes, -virtualWidthHalf, -AXIS_WIDTH / 2, virtualWidth, AXIS_WIDTH); batch.draw(axes, -AXIS_WIDTH / 2, -virtualHeightHalf, AXIS_WIDTH, virtualHeight); final float fontOffset = layout.height / 2; font.draw(batch, "-" + (int) virtualWidthHalf, -virtualWidthHalf + fontOffset, -fontOffset); font.draw(batch, String.valueOf((int) virtualWidthHalf), virtualWidthHalf - layout.width - fontOffset, -fontOffset); font.draw(batch, "-" + (int) virtualHeightHalf, fontOffset, -virtualHeightHalf + layout.height + fontOffset); font.draw(batch, String.valueOf((int) virtualHeightHalf), fontOffset, virtualHeightHalf - fontOffset); font.draw(batch, "0", fontOffset, -fontOffset); batch.end(); }
Source:
<code><START> protected ExprEval eval(ExprEval param) <END> { return eval(param, 0); }</code><technical_language>private instead of protected, if so, preferred</technical_language>

Target:
private ExprEval eval(ExprEval param) { return eval(param, 0); }
Source:
<code>private ZkClient getZkClient(String path) { checkClosedState(); String zkRealm = getZkRealm(path); ZkClient zkClient = _zkRealmToZkClientMap.get(zkRealm); if (zkClient == null) { synchronized (_zkRealmToZkClientMap) { checkClosedState(); if (!_zkRealmToZkClientMap.containsKey(zkRealm)) { zkClient = createZkClient(zkRealm); _zkRealmToZkClientMap.put(zkRealm, zkClient); } } } <START> <END> return zkClient; }</code><technical_language>Nit. remove empty line</technical_language>

Target:
private ZkClient getZkClient(String path) { checkClosedState(); String zkRealm = getZkRealm(path); ZkClient zkClient = _zkRealmToZkClientMap.get(zkRealm); if (zkClient == null) { synchronized (_zkRealmToZkClientMap) { checkClosedState(); if (!_zkRealmToZkClientMap.containsKey(zkRealm)) { zkClient = createZkClient(zkRealm); _zkRealmToZkClientMap.put(zkRealm, zkClient); } else { zkClient = _zkRealmToZkClientMap.get(zkRealm); } } } return zkClient; }
Source:
<code>public void returnedTextTest() { <START> assertEquals("mode return <END> label is incorrect", MODEL_STYLED_LABEL.getString(), labelProvider.getText(model)); assertEquals("simple class return label is incorrect", SIMPLE_CLASS_STYLED_LABEL.getString(), labelProvider.getText(simpleClass)); assertEquals("stereotyped Class return label is incorrect", STEREOTYPED_CLASS_STYLED_LABEL.getString(), labelProvider.getText(stereotypedClass)); assertEquals("empty comment return label is incorrect", EMPTY_COMMENT_STYLED_LABEL.getString(), labelProvider.getText(emptyCommment)); assertEquals("comment return label is incorrect", BODY_COMMENT_STYLED_LABEL.getString(), labelProvider.getText(commment)); labelProvider.setStylesList(types4templateParameterTest, Collections.<Styler> emptyList()); assertEquals("template signature return label is incorrect", TEMPLATE_SIGNATURE_STYLED_LABEL.getString(), labelProvider.getText(templateSignature)); assertEquals("template parameter return label is incorrect", TEMPLATE_PARAMETER_STYLED_LABEL.getString(), labelProvider.getText(templateParameter)); }</code><technical_language>model</technical_language>

Target:
public void returnedTextTest() { assertEquals("model return label is incorrect", MODEL_STYLED_LABEL.getString(), labelProvider.getText(model)); assertEquals("simple class return label is incorrect", SIMPLE_CLASS_STYLED_LABEL.getString(), labelProvider.getText(simpleClass)); assertEquals("stereotyped Class return label is incorrect", STEREOTYPED_CLASS_STYLED_LABEL.getString(), labelProvider.getText(stereotypedClass)); assertEquals("empty comment return label is incorrect", EMPTY_COMMENT_STYLED_LABEL.getString(), labelProvider.getText(emptyCommment)); assertEquals("comment return label is incorrect", BODY_COMMENT_STYLED_LABEL.getString(), labelProvider.getText(commment)); labelProvider.setStylesList(types4templateParameterTest, Collections.<Styler> emptyList()); assertEquals("template signature return label is incorrect", TEMPLATE_SIGNATURE_STYLED_LABEL.getString(), labelProvider.getText(templateSignature)); assertEquals("template parameter return label is incorrect", TEMPLATE_PARAMETER_STYLED_LABEL.getString(), labelProvider.getText(templateParameter)); }
Source:
<code>public void initTrace(IResource resource, String path, Class<? extends ITmfEvent> eventType) throws TmfTraceException { super.initTrace(resource, path, eventType); ILttngUstEventLayout layout = getLayoutFromEnv(); fLayout = layout; ImmutableSet.Builder<ITmfEventAspect<?>> builder = ImmutableSet.builder(); builder.addAll(LTTNG_UST_ASPECTS); if (checkFieldPresent(layout.contextVtid())) { builder.add(new ContextVtidAspect(layout)); } if (checkFieldPresent(layout.contextVpid())) { builder.add(new ContextVpidAspect(layout)); } if (getContainedEventTypes().stream().anyMatch(potentialEvent -> potentialEvent.getName().startsWith(layout.eventTraceFPrefix()))) { <START> builder.add(UstTraceFAspect.INSTANCE); <END> } builder.addAll(createCounterAspects(this)); fUstTraceAspects = builder.build(); }</code><technical_language>potentially a race condition here</technical_language>

Target:
public void initTrace(IResource resource, String path, Class<? extends ITmfEvent> eventType) throws TmfTraceException { super.initTrace(resource, path, eventType); ILttngUstEventLayout layout = getLayoutFromEnv(); fLayout = layout; ImmutableSet.Builder<ITmfEventAspect<?>> builder = ImmutableSet.builder(); builder.addAll(LTTNG_UST_ASPECTS); if (checkFieldPresent(layout.contextVtid())) { builder.add(new ContextVtidAspect(layout)); } if (checkFieldPresent(layout.contextVpid())) { builder.add(new ContextVpidAspect(layout)); } if (getContainedEventTypes().stream().anyMatch(potentialEvent -> potentialEvent.getName().startsWith(layout.eventTraceFPrefix()))) { builder.add(UstTraceFAspect.getInstance()); } builder.addAll(createCounterAspects(this)); fUstTraceAspects = builder.build(); }
Source:
<code><START> private LRAStatus getExpectedStatus() { <END> return compensate ? LRAStatus.Cancelled : LRAStatus.Closed; }</code><technical_language>separate status types for participants LRAs (ParticipantStatus LRAStatus). return ParticipantStatus. lots of other places in PR need returning ParticipantStatus LRAStatus</technical_language>

Target:
private ParticipantStatus getExpectedStatus() { return compensate ? ParticipantStatus.Compensated : ParticipantStatus.Completed; }
Source:
<code>Database(CloudantClient client, CouchDatabase db) { super(); this.client = client; this.db = db; <START> this.couchDbDesign = db.getDesignDocumentManager(); <END> apiV2DBSecurityURI = buildUri(client.getBaseUri()).path("_api/v2/db/").path(db.getDbName ()).path("/_security").build(); }</code><technical_language>needed</technical_language>

Target:
Database(CloudantClient client, CouchDatabase db) { super(); this.client = client; this.db = db; apiV2DBSecurityURI = buildUri(client.getBaseUri()).path("_api/v2/db/").path(db.getDbName ()).path("/_security").build(); }
Source:
<code>public void handleFirstChildExchange( List<IkePayload> reqPayloads, List<IkePayload> respPayloads, InetAddress localAddress, InetAddress remoteAddress, UdpEncapsulationSocket udpEncapSocket, IkeMacPrf ikePrf, byte[] skD) { this.mLocalAddress = localAddress; this.mRemoteAddress = remoteAddress; this.mUdpEncapSocket = udpEncapSocket; this.mIkePrf = ikePrf; this.mSkD = skD; IkeSaPayload saPayload = IkePayload.getPayloadForTypeInProvidedList( PAYLOAD_TYPE_SA, IkeSaPayload.class, respPayloads); if (saPayload != null) { int spi = registerProvisionalChildAndGetSpi(saPayload); sendMessage( CMD_HANDLE_FIRST_CHILD_EXCHANGE, new FirstChildNegotiationData(reqPayloads, respPayloads, spi)); } else { <START> sendMessage( CMD_HANDLE_FIRST_CHILD_EXCHANGE, new FirstChildNegotiationData(reqPayloads, respPayloads)); <END> } }</code><technical_language>Hmm, SPI is set NOT_REGISTERED, reason pass in? I simplifies logic here</technical_language>

Target:
public void handleFirstChildExchange( List<IkePayload> reqPayloads, List<IkePayload> respPayloads, InetAddress localAddress, InetAddress remoteAddress, UdpEncapsulationSocket udpEncapSocket, IkeMacPrf ikePrf, byte[] skD) { this.mLocalAddress = localAddress; this.mRemoteAddress = remoteAddress; this.mUdpEncapSocket = udpEncapSocket; this.mIkePrf = ikePrf; this.mSkD = skD; int spi = registerProvisionalChildAndGetSpi(respPayloads); sendMessage( CMD_HANDLE_FIRST_CHILD_EXCHANGE, new FirstChildNegotiationData(reqPayloads, respPayloads, spi)); }
Source:
<code>protected List<String> getErlFlags() { List<String> result; if (myConfiguration.isUseShortNames()) { result = new ArrayList<String>(ContainerUtil.list("-sname", getNodeName())); } else { String host = StringUtil.nullize(myConfiguration.getHost(), true); String qualifiedName = getNodeName() + "@" + (host == null ? getDefaultHost() : host); result = new ArrayList<String>(ContainerUtil.list("-name", qualifiedName)); } List<String> debugNodeArgs = Arrays.asList(myConfiguration.getDebugNodeArgs().split(" ")); result.addAll(debugNodeArgs); <START> return result; <END> }</code><technical_language>ContainerUtil.concat(java.util.List, java.util.List)</technical_language>

Target:
protected List<String> getErlFlags() { if (myConfiguration.isUseShortNames()) { return ContainerUtil.concat(ContainerUtil.list("-sname", getNodeName()), ParametersListUtil.parse(myConfiguration.getDebugNodeArgs())); } String host = StringUtil.nullize(myConfiguration.getHost(), true); String qualifiedName = getNodeName() + "@" + (host == null ? getDefaultHost() : host); return ContainerUtil.concat(ContainerUtil.list("-name", qualifiedName), ParametersListUtil.parse(myConfiguration.getDebugNodeArgs())); }
Source:
<code>private void getNumSuccessData(String series, LineGraph lineGraph) { Map<String, LineGraph.Data> data = new HashMap<>(); for (Map.Entry<String, SummaryStatistics> threadMethodEntry : mTimeToFirstByte.entrySet()) { <START> String[] threadMethod = threadMethodEntry.getKey().split(",", 2); <END> String prefix = series + ", method: " + threadMethod[1]; LineGraph.Data currentData = data.getOrDefault(prefix, new LineGraph.Data()); currentData.addData(Integer.valueOf(threadMethod[0]), threadMethodEntry.getValue().mNumSuccess); data.put(prefix, currentData); } for (Map.Entry<String, LineGraph.Data> entry : data.entrySet()) { lineGraph.addDataSeries(entry.getKey(), entry.getValue()); } }</code><technical_language>If data structure different, manually split strings</technical_language>

Target:
private void getNumSuccessData(String series, LineGraph lineGraph) { Map<String, LineGraph.Data> data = new HashMap<>(); for (Map.Entry<Integer, Map<String, SummaryStatistics>> threadEntry : mTimeToFirstByte.entrySet()) { for (Map.Entry<String, SummaryStatistics> methodEntry : threadEntry.getValue().entrySet()) { String prefix = series + ", method: " + methodEntry.getKey(); LineGraph.Data currentData = data.getOrDefault(prefix, new LineGraph.Data()); currentData.addData(threadEntry.getKey(), methodEntry.getValue().mNumSuccess); data.put(prefix, currentData); } } for (Map.Entry<String, LineGraph.Data> entry : data.entrySet()) { lineGraph.addDataSeries(entry.getKey(), entry.getValue()); } }
Source:
<code>private static boolean networkError(InternalDownloadBatchStatus downloadBatchStatus) { if (downloadBatchStatus.status() == DELETING) { Logger.v("abort networkError check because the batch " + downloadBatchStatus.getDownloadBatchId().rawId() + " is deleting"); return false; } DownloadBatchStatus.Status status = downloadBatchStatus.status(); if (status == WAITING_FOR_NETWORK) { return true; } else if (status == ERROR) { DownloadError downloadError = downloadBatchStatus.downloadError(); <START> if (downloadError != null && downloadError.type() == DownloadError.Type.NETWORK_ERROR_CANNOT_DOWNLOAD_FILE) { <END> return true; } } return false; }</code><technical_language>inlined to: return DownloadError.Type.NETWORK_ERROR_CANNOT_DOWNLOAD_FILE == downloadBatchStatus.downloadError()</technical_language>

Target:
private static boolean networkError(InternalDownloadBatchStatus downloadBatchStatus) { if (downloadBatchStatus.status() == DELETING) { Logger.v("abort networkError check because the batch " + downloadBatchStatus.getDownloadBatchId().rawId() + " is deleting"); return false; } DownloadBatchStatus.Status status = downloadBatchStatus.status(); if (status == WAITING_FOR_NETWORK) { return true; } else if (status == ERROR) { DownloadError downloadError = downloadBatchStatus.downloadError(); return downloadError != null && downloadError.type() == DownloadError.Type.NETWORK_ERROR_CANNOT_DOWNLOAD_FILE; } return false; }
Source:
<code>static private void buildPredicatesAndValues(Domain nameDomain, List<String> values, List<String> predicates, String predicatePrefix) { if (nameDomain.isSingleValue()) { predicates.add(predicatePrefix + " = ?"); values.add(getStringValue(nameDomain.getSingleValue())); } else if (nameDomain.getValues() instanceof SortedRangeSet) { List<String> names = ((SortedRangeSet)nameDomain.getValues()).getOrderedRanges() .stream() .map(range-> getStringValue(range.getSingleValue())) .collect(toList()); values.addAll(names); <START> StringBuffer tmp = new StringBuffer(); <END> for(int i = 0; i<names.size(); i++){ tmp.append('?'); if(i != names.size() - 1) { tmp.append(','); } } predicates.add(predicatePrefix + " IN ( " + tmp.toString() + " )"); } }</code><technical_language>StringBuffer is synchronized. it</technical_language>

Target:
private static void buildPredicatesAndValues(Domain nameDomain, List<String> values, List<String> predicates, String predicatePrefix) { List<String> names = nameDomain.getValues().getRanges().getOrderedRanges().stream() .filter(Range::isSingleValue) .map(range -> getStringValue(range.getSingleValue())) .collect(toList()); if (!names.isEmpty()) { values.addAll(names); String inClause = Joiner.on(",").join(nCopies(names.size(), "?")); predicates.add(format("%s IN (%s)", predicatePrefix, inClause)); } }
Source:
<code>private AccountAttributes createAccountAttributesToSanitize() { String shortName = "<name>"; String personalEmail = "'toSanitize@email.com'"; String profileInstitute = ""; String nationality = "&\"invalid nationality &"; String gender = "'\"'other"; String moreInfo = "<<script> alert('hi!'); </script>"; String pictureKey = ""; return AccountAttributes.builder() .withGoogleId("googleId@gmail.com") .withName("'name'") .withInstitute("\\/") .withEmail("&<email>&") .withIsInstructor(true) .withStudentProfileAttributes(StudentProfileAttributes.builder("googleId@gmail.com") .withShortName(shortName) .withEmail(personalEmail) .withInstitute(profileInstitute) .withNationality(nationality) .withGender(gender) .withMoreInfo(moreInfo) .withPictureKey(pictureKey) <START> .withModifiedDate(Instant.parse("2018-03-30T13:23:42.663Z")) <END> .build()) .build(); }</code><technical_language>Const#TIME_REPRESENTS_DEFAULT_TIMESTAMP if need arbitrary Instant</technical_language>

Target:
private AccountAttributes createAccountAttributesToSanitize() { String shortName = "<name>"; String personalEmail = "'toSanitize@email.com'"; String profileInstitute = ""; String nationality = "&\"invalid nationality &"; String gender = "'\"'other"; String moreInfo = "<<script> alert('hi!'); </script>"; String pictureKey = ""; return AccountAttributes.builder() .withGoogleId("googleId@gmail.com") .withName("'name'") .withInstitute("\\/") .withEmail("&<email>&") .withIsInstructor(true) .withStudentProfileAttributes(StudentProfileAttributes.builder("googleId@gmail.com") .withShortName(shortName) .withEmail(personalEmail) .withInstitute(profileInstitute) .withNationality(nationality) .withGender(gender) .withMoreInfo(moreInfo) .withPictureKey(pictureKey) .withModifiedDate(Const.TIME_REPRESENTS_DEFAULT_TIMESTAMP) .build()) .build(); }
Source:
<code>public static void main(String[] args) throws FormatException, IOException, DependencyException, ServiceException { int tileSizeX = Integer.parseInt(args[2]); int tileSizeY = Integer.parseInt(args[3]); OverlappedTiledWriter overlappedTiledWriter = new OverlappedTiledWriter(args[0], args[1], tileSizeX, tileSizeY); overlappedTiledWriter.initialize(); overlappedTiledWriter.readWriteTiles(); <START> overlappedTiledWriter.cleanup(); <END> }</code><technical_language>resources closed if error is thrown while reading</technical_language>

Target:
public static void main(String[] args) throws FormatException, IOException, DependencyException, ServiceException { int tileSizeX = Integer.parseInt(args[2]); int tileSizeY = Integer.parseInt(args[3]); OverlappedTiledWriter overlappedTiledWriter = new OverlappedTiledWriter(args[0], args[1], tileSizeX, tileSizeY); overlappedTiledWriter.initialize(); try { overlappedTiledWriter.readWriteTiles(); } catch(Exception e) { System.err.println("Failed to read and write tiles."); e.printStackTrace(); throw e; } finally { overlappedTiledWriter.cleanup(); } }
Source:
<code>List<MetricFamilySamples> fromGauge(String name, Gauge gauge) { Object obj = gauge.getValue(); Double value; if (obj instanceof Integer) { value = Double.valueOf(((Integer) obj).doubleValue()); } else if (obj instanceof Double) { value = (Double) obj; } else if (obj instanceof Float) { value = Double.valueOf(((Float) obj).doubleValue()); } else if (obj instanceof Long) { value = Double.valueOf(((Long) obj).doubleValue()); } else { <START> LOGGER.warning(String.format("Invalid type for Gauge %s: %s", name, <END> obj.getClass().getName())); return new ArrayList<MetricFamilySamples>(); } MetricFamilySamples.Sample sample = new MetricFamilySamples.Sample(name, new ArrayList<String>(), new ArrayList<String>(), value); return Arrays.asList(new MetricFamilySamples(name, Type.GAUGE, GENERIC_HELP_MESSAGE, Arrays.asList(sample))); }</code><technical_language>I this spammy strings, a debug log</technical_language>

Target:
List<MetricFamilySamples> fromGauge(String name, Gauge gauge) { Object obj = gauge.getValue(); Double value; if (obj instanceof Integer) { value = Double.valueOf(((Integer) obj).doubleValue()); } else if (obj instanceof Double) { value = (Double) obj; } else if (obj instanceof Float) { value = Double.valueOf(((Float) obj).doubleValue()); } else if (obj instanceof Long) { value = Double.valueOf(((Long) obj).doubleValue()); } else { LOGGER.log(Level.FINE, String.format("Invalid type for Gauge %s: %s", name, obj.getClass().getName())); return new ArrayList<MetricFamilySamples>(); } MetricFamilySamples.Sample sample = new MetricFamilySamples.Sample(name, new ArrayList<String>(), new ArrayList<String>(), value); return Arrays.asList(new MetricFamilySamples(name, Type.GAUGE, getHelpMessage(name, gauge), Arrays.asList(sample))); }
Source:
<code>public void testRegionIsFoundWithMafGreaterThan() { String chr = "11"; int start = 185000; int end = 190000; Region region = new Region(chr, start, end); List<Region> regions = new ArrayList<>(); regions.add(region); List<VariantEntityRepositoryFilter> filters = new FilterBuilder().withMaf(">0.125").build(); List<String> exclude = new ArrayList<>(); <START> testFiltersHelperRegion(regions, filters, exclude, 43); <END> }</code><technical_language>new numbers checked direct queries database, in order tests correct</technical_language>

Target:
public void testRegionIsFoundWithMafGreaterThan() { String chr = "11"; int start = 191000; int end = 193000; Region region = new Region(chr, start, end); List<Region> regions = new ArrayList<>(); regions.add(region); List<VariantEntityRepositoryFilter> filters = new FilterBuilder().withMaf(">0.125").build(); List<String> exclude = new ArrayList<>(); testFiltersHelperRegion(regions, filters, exclude, 13); }
Source:
<code>@Override public Connection getConnection(String userName, String password) throws JMSException { Connection connection; if (cachedConnection == null) { connection = createConnection(userName, password); } else { connection = cachedConnection; } if (connection == null) { return null; } try { connection.start(); } catch (JMSException e) { if (cachedConnection != null) { resetCache(); getConnection(userName, password); } else { logger.error( <START> "JMS Exception while starting connection for factory '" + this.connectionFactoryString + "' " + <END> e.getMessage()); throw e; } } return connection; }</code><technical_language>Formatting wrong here</technical_language>

Target:
public Connection getConnection(String userName, String password) throws JMSException { Connection connection; if (cachedConnection == null) { connection = createConnection(userName, password); } else { connection = cachedConnection; } try { connection.start(); } catch (JMSException e) { if (cachedConnection != null) { resetCache(); getConnection(userName, password); } else { throw e; } } return connection; }
Source:
<code>public static void assertPushed(DatastoreExtended datastore, CouchClient client) { <START> logger.entering(DatabaseAssert.class.getCanonicalName(),"assertPushed",new Object[]{datastore,client}); <END> Long start = System.currentTimeMillis(); Set<String> alreadyChecked = new HashSet<String>(); Changes changesBatch = datastore.changes(0, BATCH_LIMIT); while(changesBatch.size() > 0) { for (BasicDocumentRevision object : changesBatch.getResults()) { ChangeRowAdaptor adaptor = new ChangeRowAdaptor(object); if (alreadyChecked.contains(adaptor.id)) { continue; } DatabaseAssert.checkChangeRow(adaptor, client, datastore); alreadyChecked.add(adaptor.id); } changesBatch = datastore.changes(changesBatch.getLastSequence(), BATCH_LIMIT); } Long end = System.currentTimeMillis(); logger.finest(String.format("Done check took %1 seconds",(end - start)/1000.0)); }</code><technical_language>of this.getClass().getName</technical_language>

Target:
public static void assertPushed(DatastoreExtended datastore, CouchClient client) { logger.entering("DatabaseAssert","assertPushed",new Object[]{datastore,client}); Long start = System.currentTimeMillis(); Set<String> alreadyChecked = new HashSet<String>(); Changes changesBatch = datastore.changes(0, BATCH_LIMIT); while(changesBatch.size() > 0) { for (BasicDocumentRevision object : changesBatch.getResults()) { ChangeRowAdaptor adaptor = new ChangeRowAdaptor(object); if (alreadyChecked.contains(adaptor.id)) { continue; } DatabaseAssert.checkChangeRow(adaptor, client, datastore); alreadyChecked.add(adaptor.id); } changesBatch = datastore.changes(changesBatch.getLastSequence(), BATCH_LIMIT); } Long end = System.currentTimeMillis(); logger.finest(String.format("Done check took %1 seconds",(end - start)/1000.0)); }
Source:
<code><START> public void setIndentationFactor(int indentationFactor) { <END> this.indentationFactor = indentationFactor; }</code><technical_language>fluent</technical_language>

Target:
public CodeWriter setIndentationFactor(int indentationFactor) { this.indentationFactor = indentationFactor; return this; }
Source:
<code><START> protected void handleSeal(Request request, ChannelHandlerContext ctx) { <END> log.warn("handleSeal: Received SEAL request from client with " + "LSB: MSB:{}, " + "moving to new epoch {}", request.getHeader().getClientId().getLsb(), request.getHeader().getClientId().getMsb(), request.getSealRequest().getEpoch()); ByteBuf byteBuf = PooledByteBufAllocator.DEFAULT.buffer(); byteBuf.writeByte(0x2); byteBuf.writeBytes(API.newSealResponse(request.getHeader()).toByteArray()); ctx.writeAndFlush(byteBuf); }</code><technical_language>this method synchronized</technical_language>

Target:
protected synchronized void handleSeal(Request request, ChannelHandlerContext ctx) { log.warn("handleSeal: Received SEAL request from client with " + "LSB: MSB:{}, " + "moving to new epoch {}", request.getHeader().getClientId().getLsb(), request.getHeader().getClientId().getMsb(), request.getSealRequest().getEpoch()); ByteBuf byteBuf = PooledByteBufAllocator.DEFAULT.buffer(); byteBuf.writeByte(0x2); byteBuf.writeBytes(API.getSealResponse(request.getHeader()).toByteArray()); ctx.writeAndFlush(byteBuf); }
Source:
<code>public void run() { while (running.get()) { try { if (!hardDelete(true)) { isCaughtUp = true; Thread.sleep(hardDeleterSleepTimeWhenCaughtUpMs); } else if (isCaughtUp) { isCaughtUp = false; logger.info("Resumed hard deletes for after having caught up", dataDir); } } catch (InterruptedException e) { logger.info("Caught interrupted exception"); } catch (Exception e) { <START> logger.error("Caught exception: ", e); <END> } } close(); }</code><technical_language>tracking this error? metrics alert on</technical_language>

Target:
public void run() { try { while (running.get()) { try { if (!hardDelete(true)) { isCaughtUp = true; Thread.sleep(hardDeleterSleepTimeWhenCaughtUpMs); } else if (isCaughtUp) { isCaughtUp = false; logger.info("Resumed hard deletes for after having caught up", dataDir); } } catch (InterruptedException e) { logger.info("Caught interrupted exception during hard delete", e); } catch (StoreException e) { logger.error("Caught store exception: ", e); } } } finally { close(); } }
Source:
<code>private Map<String, Object> getVisitTypeColorCodes(VisitType visitType){ Map<String, Object> colorCode = new HashMap<String, Object>(); AdministrationService adminService = Context.getAdministrationService(); String propertyValue = adminService.getGlobalProperty(CoreAppsConstants.VISIT_TYPE_COLORS); try{ if(StringUtils.isNotEmpty(propertyValue)){ ArrayNode array = new ObjectMapper().readValue(propertyValue, ArrayNode.class); for (JsonNode node : array) { String visitTypeUuid= node.path("uuid").getTextValue(); if(visitType.getUuid().equalsIgnoreCase(visitTypeUuid)){ colorCode.put("uuid", visitTypeUuid); String color = node.path("color").getTextValue(); colorCode.put("color", color); String shortName = node.path("shortName").getTextValue(); colorCode.put("shortName", shortName); } } } } catch(IOException ex){ <START> ex.printStackTrace(); <END> } return colorCode; }</code><technical_language>intentionally leave out print stack trace</technical_language>

Target:
private Map<String, Object> getVisitTypeColorCodes(VisitType visitType){ Map<String, Object> colorCode = new HashMap<String, Object>(); AdministrationService adminService = Context.getAdministrationService(); String propertyValue = adminService.getGlobalProperty(CoreAppsConstants.VISIT_TYPE_COLORS); try{ if(StringUtils.isNotEmpty(propertyValue)){ ArrayNode array = new ObjectMapper().readValue(propertyValue, ArrayNode.class); for (JsonNode node : array) { String visitTypeUuid= node.path("uuid").getTextValue(); if(visitType.getUuid().equalsIgnoreCase(visitTypeUuid)){ colorCode.put("uuid", visitTypeUuid); String color = node.path("color").getTextValue(); colorCode.put("color", color); String shortName = node.path("shortName").getTextValue(); colorCode.put("shortName", shortName); } } } } catch(IOException ex){ LOG.error("Error retrieving visit type color codes, " + ex); } return colorCode; }
Source:
<code>public CorfuRecordId enqueue(E e) { <START> checkState(TransactionalContext.isInTransaction(), "must be called within a transaction!"); <END> final CorfuRecordId id = new CorfuRecordId(0, guidGenerator.nextLong()); class QueueEntryAddressGetter implements PreCommitListener { private CorfuRecordId recordId; private QueueEntryAddressGetter(CorfuRecordId recordId) { this.recordId = recordId; } @Override public void preCommitCallback(TokenResponse tokenResponse) { recordId.setTxSequence(tokenResponse.getSequence()); log.trace("preCommitCallback for Queue: " + recordId.toString()); } } QueueEntryAddressGetter addressGetter = new QueueEntryAddressGetter(id); log.trace("enqueue: Adding preCommitListener for Queue: " + id.toString()); TransactionalContext.getRootContext().addPreCommitListener(addressGetter); corfuTable.put(id, e); return id; }</code><technical_language>concerned, if this change affect clients changed contract, hope works</technical_language>

Target:
public CorfuRecordId enqueue(E e) { checkState(TransactionalContext.isInTransaction(), "must be called within a transaction!"); final CorfuRecordId id = new CorfuRecordId(0, guidGenerator.nextLong()); @AllArgsConstructor class QueueEntryAddressGetter implements PreCommitListener { private final CorfuRecordId recordId; @Override public void preCommitCallback(TokenResponse tokenResponse) { recordId.setTxSequence(tokenResponse.getSequence()); log.trace("preCommitCallback for Queue: " + recordId.toString()); } } QueueEntryAddressGetter addressGetter = new QueueEntryAddressGetter(id); log.trace("enqueue: Adding preCommitListener for Queue: " + id.toString()); TransactionalContext.getRootContext().addPreCommitListener(addressGetter); corfuTable.put(id, e); return id; }
Source:
<code>public void load() { extraConfig.clear(); if (!configFile.exists()) { if (!configDir.isDirectory() && !configDir.mkdirs()) { GlowServer.logger.severe("Cannot create directory: " + configDir); return; } createDefaultConfig(configFile); return; } try { config.load(configFile); } catch (IOException e) { GlowServer.logger.log(Level.SEVERE, "Failed to read config: " + configFile, e); } catch (InvalidConfigurationException e) { report(configFile, e); } <START> if (migrate()) { <END> try { config.save(configFile); } catch (IOException e) { GlowServer.logger.log(Level.SEVERE, "Failed to write config: " + configFile, e); return; } GlowServer.logger.info("Migrated configuration from CraftBukkit"); } }</code><technical_language>Pretty this run if created defaults, a return above, right createDefaultConfig. want put migration stuff in function</technical_language>

Target:
public void load() { extraConfig.clear(); boolean changed = false; if (!configFile.exists()) { GlowServer.logger.info("Creating default config: " + configFile); if (!configDir.isDirectory() && !configDir.mkdirs()) { GlowServer.logger.severe("Cannot create directory: " + configDir); return; } for (Key key : Key.values()) { config.set(key.path, key.def); } if (migrate()) { GlowServer.logger.info("Migrated configuration from previous installation"); } changed = true; } else { try { config.load(configFile); } catch (IOException e) { GlowServer.logger.log(Level.SEVERE, "Failed to read config: " + configFile, e); } catch (InvalidConfigurationException e) { report(configFile, e); } for (Key key : Key.values()) { if (!config.contains(key.path)) { config.set(key.path, key.def); changed = true; } } } if (changed) { save(); } }
Source:
<code>private boolean hasPermissions() { <START> if (checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) != PERMISSION_GRANTED && <END> checkSelfPermission(context, ACCESS_COARSE_LOCATION) != PERMISSION_GRANTED) { Log.e(TAG, String.format("Missing permission: '%s'", Manifest.permission.ACCESS_FINE_LOCATION)); return false; } return true; }</code><technical_language>do need access permissions? I thought if ACCESS_FINE_LOCATION is true ACCESS_COARSE_LOCATION is automatically</technical_language>

Target:
private boolean hasPermissions() { if (checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) != PERMISSION_GRANTED) { Log.e(TAG, String.format("Missing permission: '%s'", Manifest.permission.ACCESS_FINE_LOCATION)); return false; } return true; }
Source:
<code><START> public AbstractSegmentStoreTableViewer getTableViewer() { <END> return fTableViewer; }</code><technical_language>public @Nullable</technical_language>

Target:
public @Nullable AbstractSegmentStoreTableViewer getTableViewer() { return fTableViewer; }
Source:
<code>extractVariablesThirdPartyCredentialsAndSystemEnvironmentVariables(TaskContext taskContext) { ForkEnvironment forkEnvironment = taskContext.getInitializer().getForkEnvironment(); Map<String, Serializable> variables = new HashMap<>(); try { variables = extractAllVariables(taskContext, null, ""); } catch (IOException | ClassNotFoundException e) { <START> logger.error("Error reading variables from task context!"); <END> } Map<String, String> thirdPartyCredentials = new HashMap<>(); try { thirdPartyCredentials = forkedTaskVariablesManager.extractThirdPartyCredentials(taskContext); } catch (Exception e) { logger.error("Error decrypting third party credentials!"); } HashMap<String, Serializable> systemEnvironmentVariables = new HashMap<String, Serializable>(System.getenv()); systemEnvironmentVariables.putAll(variables); systemEnvironmentVariables.putAll(thirdPartyCredentials); return filterAndUpdate(forkEnvironment.getSystemEnvironment(), systemEnvironmentVariables); }</code><technical_language>log exception : logger.error("Error reading variables task context!", e);</technical_language>

Target:
extractVariablesThirdPartyCredentialsAndSystemEnvironmentVariables(TaskContext taskContext) { ForkEnvironment forkEnvironment = taskContext.getInitializer().getForkEnvironment(); Map<String, Serializable> variables = new HashMap<>(); try { variables = extractAllVariables(taskContext, null, ""); } catch (IOException | ClassNotFoundException e) { logger.error(ERROR_READING_VARIABLES, e); } Map<String, String> thirdPartyCredentials = new HashMap<>(); try { thirdPartyCredentials = forkedTaskVariablesManager.extractThirdPartyCredentials(taskContext); } catch (Exception e) { logger.error(ERROR_READING_VARIABLES, e); } HashMap<String, Serializable> systemEnvironmentVariables = new HashMap<String, Serializable>(System.getenv()); systemEnvironmentVariables.putAll(variables); systemEnvironmentVariables.putAll(thirdPartyCredentials); return filterAndUpdate(forkEnvironment.getSystemEnvironment(), systemEnvironmentVariables); }