auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Construct exec(Target t, com.laytonsmith.core.environments.Environment environment, Construct... args) throws ConfigRuntimeException { MCLocation loc = ObjectGenerator.GetGenerator().location(args[0], null, t); MCSound sound = MCSound.BREATH; float volume = 1, pitch = 1; if (!(args[1] instanceof CArray)) throw new Exceptions.FormatException("An array was expected but recieved " + args[1], t); CArray sa = (CArray) args[1]; if (sa.containsKey("sound")) { try { sound = MCSound.valueOf(sa.get("sound", t).val().toUpperCase()); } catch (IllegalArgumentException iae) { <START> <END> } } else { throw new Exceptions.FormatException("Sound field was missing.", t); } if (sa.containsKey("volume")) volume = Static.getDouble32(sa.get("volume", t), t); if (sa.containsKey("pitch")) pitch = Static.getDouble32(sa.get("pitch", t), t); if (args.length == 3) { java.util.List<MCPlayer> players = new java.util.ArrayList<MCPlayer>(); if (args[2] instanceof CArray) { for (String key : ((CArray) args[2]).keySet()) players.add(Static.GetPlayer(((CArray) args[2]).get(key, t), t)); } else { players.add(Static.GetPlayer(args[2], t)); } for (MCPlayer p : players) p.playSound(loc, sound, volume, pitch); } else { loc.getWorld().playSound(loc, sound, volume, pitch); } return new CVoid(t); }</code><technical_language>Throw exception here</technical_language>

Target:
public Construct exec(Target t, com.laytonsmith.core.environments.Environment environment, Construct... args) throws ConfigRuntimeException { MCLocation loc = ObjectGenerator.GetGenerator().location(args[0], null, t); MCSound sound = MCSound.BREATH; float volume = 1, pitch = 1; if (!(args[1] instanceof CArray)) throw new Exceptions.FormatException("An array was expected but recieved " + args[1], t); CArray sa = (CArray) args[1]; if (sa.containsKey("sound")) { try { sound = MCSound.valueOf(sa.get("sound", t).val().toUpperCase()); } catch (IllegalArgumentException iae) { throw new Exceptions.FormatException("Sound name '" + sa.get("sound", t).val() + "' is invalid.", t); } } else { throw new Exceptions.FormatException("Sound field was missing.", t); } if (sa.containsKey("volume")) volume = Static.getDouble32(sa.get("volume", t), t); if (sa.containsKey("pitch")) pitch = Static.getDouble32(sa.get("pitch", t), t); if (args.length == 3) { java.util.List<MCPlayer> players = new java.util.ArrayList<MCPlayer>(); if (args[2] instanceof CArray) { for (String key : ((CArray) args[2]).keySet()) players.add(Static.GetPlayer(((CArray) args[2]).get(key, t), t)); } else { players.add(Static.GetPlayer(args[2], t)); } for (MCPlayer p : players) p.playSound(loc, sound, volume, pitch); } else { loc.getWorld().playSound(loc, sound, volume, pitch); } return new CVoid(t); }
Source:
<code>public void unretireOrderType_shouldUnretireTheGivenUnretiredOrderType() { OrderService orderService = Context.getOrderService(); <START> OrderType orderType = orderService.getOrderType(11); <END> assertTrue(orderType.getRetired()); orderService.unretireOrderType(orderType); orderType = orderService.getOrderType(11); assertFalse(orderType.getRetired()); }</code><technical_language>here, need check retireable fields null null</technical_language>

Target:
public void unretireOrderType_shouldUnretireTheGivenUnretiredOrderType() { OrderService orderService = Context.getOrderService(); OrderType orderType = orderService.getOrderType(16); assertTrue(orderType.getRetired()); assertNotNull(orderType.getRetiredBy()); assertNotNull(orderType.getRetireReason()); assertNotNull(orderType.getDateRetired()); orderService.unretireOrderType(orderType); orderType = orderService.getOrderType(16); assertFalse(orderType.getRetired()); assertNull(orderType.getRetiredBy()); assertNull(orderType.getRetireReason()); assertNull(orderType.getDateRetired()); }
Source:
<code>public Object acquireLockIfAvailable(Order order) { if (order == null || order instanceof NullOrderImpl) { if (LOG.isDebugEnabled()) { <START> LOG.debug("Attempted to grab a lock for a NullOrderImpl. Not blocking"); <END> } return order; } boolean lockAcquired = orderService.acquireLock(order); return lockAcquired ? order : null; }</code><technical_language>debug message updated order null</technical_language>

Target:
public Object acquireLockIfAvailable(Order order) { if (order == null || order instanceof NullOrderImpl) { if (LOG.isDebugEnabled()) { LOG.debug("Attempted to grab a lock - order was null or it was a NullOrderImpl. Not blocking"); } return order; } boolean lockAcquired = orderService.acquireLock(order); return lockAcquired ? order : null; }
Source:
<code>public Temporal adjustInto(Temporal temporal) { int dow = temporal.get(DAY_OF_WEEK); switch (dow) { case 6: return temporal.minus(1, DAYS); case 7: return temporal.minus(2, DAYS); default: return temporal; } <START> } <END></code><technical_language>tabs allowed</technical_language>

Target:
public Temporal adjustInto(Temporal temporal) { int dow = temporal.get(DAY_OF_WEEK); switch (dow) { case 6: return temporal.plus(2, DAYS); case 5: return temporal.plus(3, DAYS); default: return temporal.plus(1, DAYS); } }
Source:
<code>@Test public void builtInConvertersAbsentInCloneBuilder() { Retrofit retrofit = new Retrofit.Builder() .baseUrl(server.url("/")) .build(); <START> assertEquals(retrofit.converterFactories().size() - 1, <END> retrofit.newBuilder().converterFactories().size()); }</code><technical_language>this assert empty? if split built in factories this test is wrong</technical_language>

Target:
@Test public void builtInConvertersAbsentInCloneBuilder() { Retrofit retrofit = new Retrofit.Builder() .baseUrl(server.url("/")) .build(); assertEquals(0, retrofit.newBuilder().converterFactories().size()); }
Source:
<code>public static synchronized void storeInteractionForCurrentAppVersion(Context context, String name) { <START> storeRecordForCurrentAppVersion(context, false, name); <END> }</code><technical_language>arg true here</technical_language>

Target:
public static synchronized void storeInteractionForCurrentAppVersion(Context context, String name) { storeRecordForCurrentAppVersion(context, true, name); }
Source:
<code>public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { int length = this.applicationContext .getBeanNamesForType(TaskBatchExecutionListener.class).length; if(bean instanceof AbstractJob) { if(length != 1) { throw new IllegalStateException("The application context is required to " + <START> "have exactly 1 instance of the TaskBatchExecutionListner but has " + <END> length); } ((AbstractJob) bean).registerJobExecutionListener( this.applicationContext.getBean(TaskBatchExecutionListener.class)); } return bean; }</code><technical_language>TaskBatchExecutionListner is misspelled</technical_language>

Target:
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { int length = this.applicationContext .getBeanNamesForType(TaskBatchExecutionListener.class).length; if(bean instanceof AbstractJob) { if(length != 1) { throw new IllegalStateException("The application context is required to " + "have exactly 1 instance of the TaskBatchExecutionListener but has " + length); } ((AbstractJob) bean).registerJobExecutionListener( this.applicationContext.getBean(TaskBatchExecutionListener.class)); } return bean; }
Source:
<code>public void walk() { Set<Role> roles = RoleMap.this.getRoles(); Iterator<Role> iter = roles.iterator(); while (iter.hasNext()) { Role current = iter.next(); perform(current); <START> if(a) { <END> break; } } }</code><technical_language>suggestion if (a) {</technical_language>

Target:
public void walk() { Set<Role> roles = RoleMap.this.getRoles(); Iterator<Role> iter = roles.iterator(); while (iter.hasNext()) { Role current = iter.next(); perform(current); if (shouldAbort) { break; } } }
Source:
<code>private void throwIfNotValidMerchantId(JsonNode valueNode, String field) { boolean isValidWorldpayMerchantId = valueNode.textValue().matches("[0-9a-f]{15}"); if(!isValidWorldpayMerchantId) { <START> throw new ValidationException(Collections.singletonList(format("Field [%s] value [%s] does not match that expected for a Worldpay Merchant ID; characters should be within range [0-9a-f]", field, valueNode.asText()))); <END> } }</code><technical_language>add 15 characters long more info provide easier for realise error</technical_language>

Target:
private void throwIfNotValidMerchantId(JsonNode valueNode, String field) { boolean isValidWorldpayMerchantId = valueNode.textValue().matches("[0-9a-f]{15}"); if(!isValidWorldpayMerchantId) { throw new ValidationException(Collections.singletonList(format("Field [%s] value [%s] does not match that expected for a Worldpay Merchant ID; should be 15 characters and within range [0-9a-f]", field, valueNode.asText()))); } }
Source:
<code>public Object execute(ExecutionEvent event) throws ExecutionException { Repository[] repos = getRepositories(event); if (repos.length == 0) return null; Set<Repository> repositories = new HashSet<Repository>(); for (int i = 0; i < repos.length; i++) <START> repositories.add(repos[i]); <END> new PullOperationUI(repositories).start(); return null; }</code><technical_language>this: new HashSet<Repository>(Arrays.asList(repos));</technical_language>

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { Repository[] repos = getRepositories(event); if (repos.length == 0) return null; Set<Repository> repositories = new HashSet<Repository>( Arrays.asList(repos)); new PullOperationUI(repositories).start(); return null; }
Source:
<code>public static MaterialDesignIcon getIconForSignState(AccountAgeWitnessService.SignState state) { if (state.equals(AccountAgeWitnessService.SignState.PEER_INITIAL)) <START> return MaterialDesignIcon.CLOCK; <END> return (state.equals(AccountAgeWitnessService.SignState.ARBITRATOR) || state.equals(AccountAgeWitnessService.SignState.PEER_SIGNER)) ? MaterialDesignIcon.APPROVAL : MaterialDesignIcon.ALERT_CIRCLE_OUTLINE; }</code><technical_language>(and compiler) know, should(?) a white space line block of if statement</technical_language>

Target:
public static MaterialDesignIcon getIconForSignState(AccountAgeWitnessService.SignState state) { if (state.equals(AccountAgeWitnessService.SignState.PEER_INITIAL)) { return MaterialDesignIcon.CLOCK; } return (state.equals(AccountAgeWitnessService.SignState.ARBITRATOR) || state.equals(AccountAgeWitnessService.SignState.PEER_SIGNER)) ? MaterialDesignIcon.APPROVAL : MaterialDesignIcon.ALERT_CIRCLE_OUTLINE; }
Source:
<code>private void init(Configuration config) throws AMQException, JMSException, URISyntaxException { conn = new AMQConnection(config.getString(ConfigKey.AMQP_CONNECT_STRING.toString())); conn.start(); sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE); dest = new AMQAnyDestination("event"); consumer = sess.createDurableSubscriber(dest, "event"); <START> consumer.setMessageListener(eventMessageListener); <END> log.info("receiver init complete"); }</code><technical_language>+1 instantiating locally</technical_language>

Target:
private void init(Configuration config) throws AMQException, JMSException, URISyntaxException { conn = new AMQConnection(config.getString(ConfigKey.AMQP_CONNECT_STRING.toString())); conn.start(); sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE); dest = new AMQAnyDestination("event"); consumer = sess.createDurableSubscriber(dest, "event"); consumer.setMessageListener(eventMessageListener); log.info("Receiver init complete"); }
Source:
<code>public boolean removeAll(final Collection<?> c) { boolean ret = false; <START> for(Object elem : c) { <END> boolean currentRet = remove(elem); if(currentRet) { ret = true; } } return ret; }</code><technical_language>Add final keyword</technical_language>

Target:
public boolean removeAll(final Collection<?> c) { boolean ret = false; for(final Object elem : c) { boolean currentRet = remove(elem); if(currentRet) { ret = true; } } return ret; }
Source:
<code>private void findMatch() { <START> boolean cont = true; <END> while (cont && matcher.find()) { final FileText text = getFileContents().getText(); final LineColumn start = text.lineColumn(matcher.start()); final int startLine = start.getLine(); final boolean ignore = isIgnore(startLine, text, start); if (!ignore) { matchCount++; if (illegalPattern || checkForDuplicates && matchCount - 1 > duplicateLimit) { errorCount++; logMessage(startLine); } } if (!canContinueValidation()) { cont = false; } } if (!illegalPattern && matchCount == 0) { logMessage(0); } }</code><technical_language>cont -> shouldContinue</technical_language>

Target:
private void findMatch() { final boolean foundMatch = matcher.find(); if (foundMatch) { final FileText text = getFileContents().getText(); final LineColumn start = text.lineColumn(matcher.start()); final int startLine = start.getLine(); final boolean ignore = isIgnore(startLine, text, start); if (!ignore) { matchCount++; if (illegalPattern || checkForDuplicates && matchCount - 1 > duplicateLimit) { errorCount++; logMessage(startLine); } } if (canContinueValidation(ignore)) { findMatch(); } } else if (!illegalPattern && matchCount == 0) { logMessage(0); } }
Source:
<code>ModuleLaunchTask(ModuleResolver moduleResolver, String module, String[] args) { this.moduleResolver = moduleResolver; String[] tokens = module.split(":"); <START> Assert.isTrue(tokens.length == 3, "required module format is: 'groupId:artifactId:version'"); <END> this.groupId = tokens[0]; this.artifactId = tokens[1]; this.version = tokens[2]; this.args = args; }</code><technical_language>possibility of module string group:artifact:extension:classifier:version group:artifact:extension:version? i.e., do require custom modules adhere 'exec' convention</technical_language>

Target:
ModuleLaunchTask(ModuleResolver moduleResolver, String module, String[] args) { this.moduleResolver = moduleResolver; this.coordinates = parse(module); this.args = args; }
Source:
<code>public void addNewModelElements(EObject eObject, EReference eReference) { <START> if (eReference == EcorePackage.eINSTANCE.getEReference_EOpposite()) { <END> handleEOpposite(eObject, eReference); return; } super.addNewModelElements(eObject, eReference); }</code><technical_language>I delegate new method</technical_language>

Target:
public void addNewModelElements(EObject eObject, EReference eReference) { addNewModelElements(eObject, eReference, true); }
Source:
<code>public SerbianStemmerTokenFilter(TokenStream in) { super(in); <START> this.stemmer <END> = new LjubesicPandzicStemmer(); }</code><technical_language>nitpick: tab</technical_language>

Target:
public SerbianStemmerTokenFilter(TokenStream in) { super(in); }
Source:
<code>public void init() { initMocks(this); pid = PIDs.get(UUID.randomUUID().toString()); unit = new AdminUnit(pid, repository, dataLoader); collectionChildPid = PIDs.get(UUID.randomUUID().toString()); workChildPid = PIDs.get(UUID.randomUUID().toString()); when(repository.mintContentPid()).thenReturn(collectionChildPid).thenReturn(workChildPid); collectionChildObj = new CollectionObject(collectionChildPid, repository, dataLoader); when(repository.createCollectionObject(any(PID.class), any(Model.class))) .thenReturn(collectionChildObj); <START> workChildObj = new WorkObject(workChildPid, repository, dataLoader); <END> when(repository.createWorkObject(any(PID.class), any(Model.class))) .thenReturn(workChildObj); }</code><technical_language>get mocking a WorkObject instead of instantiating one, is preferable for a unit test. Also, I repository.createWorkObject work get called in this test? suggestions apply CollectionObject created line 64</technical_language>

Target:
public void init() { initMocks(this); pid = PIDs.get(UUID.randomUUID().toString()); unit = new AdminUnit(pid, repository, dataLoader); collectionChildPid = PIDs.get(UUID.randomUUID().toString()); when(collectionChildObj.getPid()).thenReturn(collectionChildPid); }
Source:
<code>public IntegrationFlow messageSourceFlow(IntegrationFlowFunctionSupport functionSupport) { Assert.hasText(functionProperties.getName(), "Supplier name must be provided"); IntegrationFlowBuilder flowBuilder = functionSupport .integrationFlowFromNamedSupplier() <START> .split() <END> .channel(source.output()); return flowBuilder.get(); }</code><technical_language>I thought this .split() out-of-the-box feature. do leave a Flux processing end-user</technical_language>

Target:
public IntegrationFlow messageSourceFlow(IntegrationFlowFunctionSupport functionSupport) { Assert.hasText(functionProperties.getName(), "Supplier name must be provided"); IntegrationFlowBuilder flowBuilder = functionSupport .integrationFlowFromNamedSupplier() .channel(source.output()); return flowBuilder.get(); }
Source:
<code>public void run() { Map<String, Object> data = new HashMap<String, Object>(); Map<String, String> status = this.getDepositStatus(); if(!status.containsKey(DepositField.depositorEmail.name())) return; data.putAll(status); data.put("baseUrl", this.getBaseUrl()); if(status.containsKey(DepositField.errorMessage.name())) { data.put("error", Boolean.TRUE); } else { data.put("error", Boolean.FALSE); } String html = htmlTemplate.execute(data); String text = textTemplate.execute(data); MimeMessage mimeMessage = mailSender.createMimeMessage(); try { MimeMessageHelper message = new MimeMessageHelper(mimeMessage, MimeMessageHelper.MULTIPART_MODE_MIXED); String addy = status.get(DepositField.depositorEmail.name()); message.addTo(addy); <START> message.setSubject("CDR deposit complete"); <END> message.setFrom(getFromAddress()); message.setText(text, html); this.mailSender.send(mimeMessage); } catch(MessagingException e) { failJob(e, null, "Cannot send notification email"); } }</code><technical_language>Based lines 79-83 this email job handles errors too? a conditional for a failure subject too</technical_language>

Target:
public void run() { Map<String, Object> data = new HashMap<String, Object>(); Map<String, String> status = this.getDepositStatus(); if(!status.containsKey(DepositField.depositorEmail.name())) return; data.putAll(status); data.put("baseUrl", this.getBaseUrl()); boolean error = status.containsKey(DepositField.errorMessage.name()); data.put("error", Boolean.valueOf(error)); String html = htmlTemplate.execute(data); String text = textTemplate.execute(data); MimeMessage mimeMessage = mailSender.createMimeMessage(); try { MimeMessageHelper message = new MimeMessageHelper(mimeMessage, MimeMessageHelper.MULTIPART_MODE_MIXED); String addy = status.get(DepositField.depositorEmail.name()); message.addTo(addy); if(error) { message.setSubject("CDR deposit error"); } else { message.setSubject("CDR deposit complete"); } message.setFrom(getFromAddress()); message.setText(text, html); this.mailSender.send(mimeMessage); } catch(MessagingException e) { failJob(e, null, "Cannot send notification email"); } }
Source:
<code>public void commitStub() { SqlStorage<FormRecord> storage = CommCareApplication.instance().getUserStorage(FormRecord.class); SqlStorage<SessionStateDescriptor> sessionStorage = CommCareApplication.instance().getUserStorage(SessionStateDescriptor.class); SecretKey key = CommCareApplication.instance().createNewSymmetricKey(); FormRecord r = new FormRecord(FormRecord.STATUS_UNSTARTED, getSession().getForm(), key.getEncoded(), null, new Date(0), CommCareApplication.instance().getCurrentApp().getAppRecord().getApplicationId()); storage.write(r); setFormRecordId(r.getID()); SessionStateDescriptor ssd = SessionStateDescriptor.buildFromSessionWrapper(this); try { sessionStorage.write(ssd); } catch (Exception e) { <START> CrashUtil.log("SessionStateDescriptor form id: " + ssd.getFormRecordId()); <END> throw e; } sessionStateRecordId = ssd.getID(); }</code><technical_language>a heads if ~any chance SSD null this obfuscate underlying error resulting in a null pointer instead</technical_language>

Target:
public void commitStub() { SqlStorage<FormRecord> storage = CommCareApplication.instance().getUserStorage(FormRecord.class); SqlStorage<SessionStateDescriptor> sessionStorage = CommCareApplication.instance().getUserStorage(SessionStateDescriptor.class); SecretKey key = CommCareApplication.instance().createNewSymmetricKey(); FormRecord r = new FormRecord(FormRecord.STATUS_UNSTARTED, getSession().getForm(), key.getEncoded(), null, new Date(0), CommCareApplication.instance().getCurrentApp().getAppRecord().getApplicationId()); storage.write(r); setFormRecordId(r.getID()); SessionStateDescriptor ssd = SessionStateDescriptor.buildFromSessionWrapper(this); try { sessionStorage.write(ssd); } catch (Exception e) { if (ssd != null) { CrashUtil.log("SessionStateDescriptor form id: " + ssd.getFormRecordId()); } throw e; } sessionStateRecordId = ssd.getID(); }
Source:
<code>public EvalHierarchyNode getNodeById(String nodeId) { <START> if(cache.containsKey(nodeId)){ <END> LOG.debug("--- Fetching (External)getNodeById record from cache for: " + nodeId); EvalHierarchyNode ret = (EvalHierarchyNode)cache.get(nodeId); if(ret != null) { return ret; } } EvalHierarchyNode node = null; if (evalHierarchyProvider != null) { node = evalHierarchyProvider.getNodeById(nodeId); } if (node == null) { HierarchyNode hNode = hierarchyService.getNodeById(nodeId); node = makeEvalNode(hNode); } LOG.debug("+++ Adding (External)getNodeById record to cache for: " + nodeId); cache.put(nodeId, node); return node; }</code><technical_language>I preferred method is do cache.get(nodeId) check if result is null. I containsKey avoided</technical_language>

Target:
public EvalHierarchyNode getNodeById(String nodeId) { EvalHierarchyNode ret = (EvalHierarchyNode)cache.get(nodeId); if(ret != null) { LOG.debug("--- Fetching (External)getNodeById record from cache for: " + nodeId); return ret; } EvalHierarchyNode node = null; if (evalHierarchyProvider != null) { node = evalHierarchyProvider.getNodeById(nodeId); } if (node == null) { HierarchyNode hNode = hierarchyService.getNodeById(nodeId); node = makeEvalNode(hNode); } LOG.debug("+++ Adding (External)getNodeById record to cache for: " + nodeId); cache.put(nodeId, node); return node; }
Source:
<code>public boolean isFinished() { <START> return move.isFinished() || CommandScheduler.getInstance().timeSinceScheduled(this) > this.timeout; <END> }</code><technical_language>=</technical_language>

Target:
public boolean isFinished() { return move.isFinished() || CommandScheduler.getInstance().timeSinceScheduled(this) >= this.timeout; }
Source:
<code>protected Iterator<Event> createEvents(SentenceSample sample) { <START> Collection<Event> events = new ArrayList<Event>(); <END> for (Span sentenceSpan : sample.getSentences()) { String sentenceString = sentenceSpan.getCoveredText(sample.getDocument()).toString(); for (Iterator<Integer> it = scanner.getPositions( sentenceString).iterator(); it.hasNext();) { int candidate = it.next(); String type = SentenceDetectorME.NO_SPLIT; if (!it.hasNext()) { type = SentenceDetectorME.SPLIT; } events.add(new Event(type, cg.getContext(sample.getDocument(), sentenceSpan.getStart() + candidate))); } } return events.iterator(); }</code><technical_language>need declare type RHS</technical_language>

Target:
protected Iterator<Event> createEvents(SentenceSample sample) { Collection<Event> events = new ArrayList<>(); for (Span sentenceSpan : sample.getSentences()) { String sentenceString = sentenceSpan.getCoveredText(sample.getDocument()).toString(); for (Iterator<Integer> it = scanner.getPositions( sentenceString).iterator(); it.hasNext();) { int candidate = it.next(); String type = SentenceDetectorME.NO_SPLIT; if (!it.hasNext()) { type = SentenceDetectorME.SPLIT; } events.add(new Event(type, cg.getContext(sample.getDocument(), sentenceSpan.getStart() + candidate))); } } return events.iterator(); }
Source:
<code>public void throwsUnknownRemoteExceptionWithCorrectBodyAfterFailingToDeserializeSerializableError() { String responseJson = "{\"attribute\": \"foo\"}"; MockResponse mockResponse = new MockResponse() .setBody(responseJson) .addHeader("Content-Type", "application/json") .setResponseCode(400); server.enqueue(mockResponse); OkHttpClient client = createRetryingClient(1); Call call = client.newCall(new Request.Builder().url(url).build()); <START> assertThatThrownBy(call::execute).isInstanceOf(UnknownRemoteException.class) <END> .hasMessageContaining("Error 400. (Failed to parse response body as SerializableError.)"); }</code><technical_language>of assertions check getStatus() method</technical_language>

Target:
public void throwsUnknownRemoteExceptionWithCorrectBodyAfterFailingToDeserializeSerializableError() { String responseJson = "{\"attribute\": \"foo\"}"; MockResponse mockResponse = new MockResponse() .setBody(responseJson) .addHeader("Content-Type", "application/json") .setResponseCode(400); server.enqueue(mockResponse); OkHttpClient client = createRetryingClient(1); Call call = client.newCall(new Request.Builder().url(url).build()); assertThatThrownBy(call::execute) .isInstanceOf(UnknownRemoteException.class) .hasMessageContaining("Error 400. (Failed to parse response body as SerializableError.)") .matches(exc -> ((UnknownRemoteException) exc).getStatus() == 400) .matches(exc -> ((UnknownRemoteException) exc).getBody().equals(responseJson)); }
Source:
<code>private void createReleaseWebHook(final ReleaseWebHookResource resource) { if (resource == null) { throw new InvalidParameterException("event parameter is null"); } String payloadUrl = validateAndGetPayloadUrl(resource); String secret = resource.getSecret(); String webHookName = resource.getWebHookName(); if (webHookName == null || webHookName.isEmpty()) { throw new InvalidParameterException("webhook name is empty"); } List<ReleaseWebHook> releaseWebHooks = ReleaseWebHookHelper.getReleaseWebHookConfigurations(); for (ReleaseWebHook webHook : releaseWebHooks) { if (webHook.getPayloadUrl().equalsIgnoreCase(payloadUrl)) { <START> logger.fine(String.format("WebHook found for payloadUrl %s already exists", payloadUrl)); <END> return; } } ReleaseWebHook webHook = new ReleaseWebHook(webHookName, payloadUrl, secret); releaseWebHooks.add(webHook); ReleaseWebHookHelper.saveReleaseWebHookConfigurations(releaseWebHooks); }</code><technical_language>log webhook name also</technical_language>

Target:
private void createReleaseWebHook(final ReleaseWebHookResource resource) { if (resource == null) { throw new InvalidParameterException("resource is null"); } String payloadUrl = validateAndGetPayloadUrl(resource); String secret = resource.getSecret(); String webHookName = resource.getWebHookName(); if (StringUtils.isBlank(webHookName)) { throw new InvalidParameterException("webhook name is empty"); } List<ReleaseWebHook> releaseWebHooks = ReleaseWebHookHelper.getReleaseWebHookConfigurations(); for (ReleaseWebHook webHook : releaseWebHooks) { if (webHook.getWebHookName().equalsIgnoreCase(webHookName)) { if (webHook.getPayloadUrl().equalsIgnoreCase(payloadUrl)) { logger.fine(String.format("WebHook with the name %s and payloadUrl %s already exists", webHookName, payloadUrl)); return; } else { throw new InvalidParameterException(String.format("WebHook with the name %s already exists. Provide a unique name for the ReleaseWebHook", webHookName)); } } } ReleaseWebHook webHook = new ReleaseWebHook(webHookName, payloadUrl, secret); releaseWebHooks.add(webHook); ReleaseWebHookHelper.saveReleaseWebHookConfigurations(releaseWebHooks); }
Source:
<code>public static void EnableLoadBalancer() { <START> log.info("Start scheduling to enable load balancer"); <END> SchedulerUtilQuartzImpl.getInstance().scheduleAFixedDelayJob(instance, "PerformLoadBalancing", new Class[] {}, new Object[] {}, Config.<Integer> GetValue(ConfigValues.VdsLoadBalancingeIntervalInMinutes), Config.<Integer> GetValue(ConfigValues.VdsLoadBalancingeIntervalInMinutes), TimeUnit.MINUTES); log.info("Finished scheduling to enable load balancer"); }</code><technical_language>vds load blanacer</technical_language>

Target:
public static void EnableLoadBalancer() { log.info("Start scheduling to enable vds load balancer"); SchedulerUtilQuartzImpl.getInstance().scheduleAFixedDelayJob(instance, "PerformLoadBalancing", new Class[] {}, new Object[] {}, Config.<Integer> GetValue(ConfigValues.VdsLoadBalancingeIntervalInMinutes), Config.<Integer> GetValue(ConfigValues.VdsLoadBalancingeIntervalInMinutes), TimeUnit.MINUTES); log.info("Finished scheduling to enable vds load balancer"); }
Source:
<code>public static Collection<Object[]> configs() { String[] ledgerManagers = new String[] { "org.apache.bookkeeper.meta.FlatLedgerManagerFactory", <START> "org.apache.bookkeeper.meta.LegacyHierarchicalLedgerManagerFactory", <END> "org.apache.bookkeeper.meta.LongHierarchicalLedgerManagerFactory", "org.apache.bookkeeper.meta.MSLedgerManagerFactory", }; ArrayList<Object[]> cfgs = new ArrayList<Object[]>(ledgerManagers.length); for (String lm : ledgerManagers) { cfgs.add(new Object[] { lm }); } return cfgs; }</code><technical_language>want this here</technical_language>

Target:
public static Collection<Object[]> configs() { String[] ledgerManagers = new String[] { "org.apache.bookkeeper.meta.FlatLedgerManagerFactory", "org.apache.bookkeeper.meta.LegacyHierarchicalLedgerManagerFactory", "org.apache.bookkeeper.meta.HierarchicalLedgerManagerFactory", "org.apache.bookkeeper.meta.LongHierarchicalLedgerManagerFactory", "org.apache.bookkeeper.meta.MSLedgerManagerFactory", }; ArrayList<Object[]> cfgs = new ArrayList<Object[]>(ledgerManagers.length); for (String lm : ledgerManagers) { cfgs.add(new Object[] { lm }); } return cfgs; }
Source:
<code>private RemoteConfigurationRegistryJAASConfig(List<RemoteConfigurationRegistryConfig> configs, AliasService aliasService) { try { delegate = Configuration.getConfiguration(); } catch(Exception e) { final String message = String.format(Locale.ROOT, "Error while getting secure configuration. This error usually indicates an issue within the supplied JAAS configuration: %s", <START> System.getProperty(GatewayConfig.KRB5_LOGIN_CONFIG, "Undefined")); <END> throw new ConfigurationException(message, e); } this.aliasService = aliasService; for (RemoteConfigurationRegistryConfig config : configs) { if (config.isSecureRegistry()) { contextEntries.put(config.getName(), createEntries(config)); } } if (!contextEntries.isEmpty()) { Configuration.setConfiguration(this); } }</code><technical_language>Is this a system property</technical_language>

Target:
private RemoteConfigurationRegistryJAASConfig(List<RemoteConfigurationRegistryConfig> configs, AliasService aliasService) { try { delegate = Configuration.getConfiguration(); } catch(Exception e) { final String message = String.format(Locale.ROOT, "%s: %s", JAAS_CONFIG_ERRROR_PREFIX, System.getProperty(GatewayConfig.KRB5_LOGIN_CONFIG, "Undefined")); throw new ConfigurationException(message, e); } this.aliasService = aliasService; for (RemoteConfigurationRegistryConfig config : configs) { if (config.isSecureRegistry()) { contextEntries.put(config.getName(), createEntries(config)); } } if (!contextEntries.isEmpty()) { Configuration.setConfiguration(this); } }
Source:
<code>public void testPeriodParser() { BigDecimal yearsDecimal = new BigDecimal(0.1); BigDecimal monthsDecimal = new BigDecimal(0.2); BigDecimal secondsInAYear = new BigDecimal(ChronoUnit.YEARS.getDuration().getSeconds()); BigDecimal secondsInAMonth = new BigDecimal(ChronoUnit.MONTHS.getDuration().getSeconds()); int yearDecimalInSeconds = yearsDecimal.multiply(secondsInAYear).intValue(); int monthDecimalInSeconds = monthsDecimal.multiply(secondsInAMonth).intValue(); org.joda.time.Period period = org.joda.time.Period.parse( <START> String.format("P8MT6H%dS", yearDecimalInSeconds + monthDecimalInSeconds)); <END> assertThat(period, is(PeriodParser.parse("P.1Y8.2MT6H"))); }</code><technical_language>~I if spec compliant this test fail. This a negative test case I feel values this accepted.~</technical_language>

Target:
public void testPeriodParser() { BigDecimal yearsDecimal = new BigDecimal("0.1"); BigDecimal monthsDecimal = new BigDecimal("0.2"); BigDecimal secondsInAYear = new BigDecimal(ChronoUnit.YEARS.getDuration().getSeconds()); BigDecimal secondsInAMonth = new BigDecimal(ChronoUnit.MONTHS.getDuration().getSeconds()); int yearDecimalInSeconds = yearsDecimal.multiply(secondsInAYear).intValue(); int monthDecimalInSeconds = monthsDecimal.multiply(secondsInAMonth).intValue(); org.joda.time.Period period = org.joda.time.Period.parse( String.format("P8MT6H%dS", yearDecimalInSeconds + monthDecimalInSeconds)); assertThat(period, is(PeriodParser.parse("RELATIVE(P.1Y8.2MT6H)", RELATIVE_TEMPORAL_REGEX))); }
Source:
<code>public static FlowTrigger createTestFlowTrigger(final List<FlowTriggerDependency> deps, final Duration maxWaitDuration) { <START> final FlowTrigger flowTrigger = new FlowTrigger( <END> new CronSchedule("* * * * ? *"), deps, maxWaitDuration); return flowTrigger; }</code><technical_language>lines merged one</technical_language>

Target:
public static FlowTrigger createTestFlowTrigger(final List<FlowTriggerDependency> deps, final Duration maxWaitDuration) { return new FlowTrigger( new CronSchedule("* * * * ? *"), deps, maxWaitDuration); }
Source:
<code>public void define(WebService.NewController controller) { controller.createAction("form_data") .setSince("6.7") .setPost(true) <START> .setDescription("Provide data for fields: the server ID and the total number of lines of code.") <END> .setResponseExample(getClass().getResource("example-edition-form_data.json")) .setInternal(true) .setHandler(this); }</code><technical_language>"Provide data prefill license request forms: ..."</technical_language>

Target:
public void define(WebService.NewController controller) { controller.createAction("form_data") .setSince("6.7") .setPost(false) .setDescription("Provide data to prefill license request forms: the server ID and the total number of lines of code.") .setResponseExample(getClass().getResource("example-edition-form_data.json")) .setInternal(true) .setHandler(this); }
Source:
<code>public int run(CommandLine cl) throws AlluxioException, IOException { mWorkingDirPath = getWorkingDirectory(cl); DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd_HH-mm-ss"); for (int i = 0; i < COLLECT_METRICS_TIMES; i++) { LocalDateTime now = LocalDateTime.now(); String timeString = dtf.format(now); LOG.info(String.format("Collecting metrics at %s", timeString)); File outputFile = generateOutputFile(mWorkingDirPath, String.format("%s-%s", getCommandName(), i)); StringWriter outputBuffer = new StringWriter(); outputBuffer.write(String.format("Collect metric at approximately %s", timeString)); String masterAddr; try { masterAddr = mFsContext.getMasterAddress().getHostName(); } catch (UnavailableException e) { String noMasterMsg = "No Alluxio master available. Skip metrics collection."; LOG.warn(noMasterMsg); outputBuffer.write(noMasterMsg); <START> continue; <END> } String url = String.format("http://%s:%s%s", masterAddr, mFsContext.getClusterConf().get(PropertyKey.MASTER_WEB_PORT), METRICS_SERVLET_PATH); LOG.info(String.format("Metric address URL: %s", url)); String metricsResponse = getMetricsJson(url); outputBuffer.write(metricsResponse); FileUtils.writeStringToFile(outputFile, metricsResponse); SleepUtils.sleepMs(LOG, COLLECT_METRICS_INTERVAL); } return 0; }</code><technical_language>break instead of continue retry get error</technical_language>

Target:
public int run(CommandLine cl) throws AlluxioException, IOException { mWorkingDirPath = getWorkingDirectory(cl); DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd_HH-mm-ss"); StringWriter outputBuffer = new StringWriter(); for (int i = 0; i < COLLECT_METRICS_TIMES; i++) { LocalDateTime now = LocalDateTime.now(); String timeMsg = String.format("Collecting metrics at %s", dtf.format(now)); LOG.info(timeMsg); outputBuffer.write(timeMsg); String masterAddr; try { masterAddr = mFsContext.getMasterAddress().getHostName(); } catch (UnavailableException e) { String noMasterMsg = "No Alluxio master available. Skip metrics collection."; LOG.warn(noMasterMsg); outputBuffer.write(noMasterMsg); break; } String url = String.format("http://%s:%s%s", masterAddr, mFsContext.getClusterConf().get(PropertyKey.MASTER_WEB_PORT), METRICS_SERVLET_PATH); LOG.info(String.format("Metric address URL: %s", url)); String metricsResponse = getMetricsJson(url); outputBuffer.write(metricsResponse); File outputFile = generateOutputFile(mWorkingDirPath, String.format("%s-%s", getCommandName(), i)); FileUtils.writeStringToFile(outputFile, metricsResponse); SleepUtils.sleepMs(LOG, COLLECT_METRICS_INTERVAL); } File outputFile = generateOutputFile(mWorkingDirPath, String.format("%s.txt", getCommandName())); FileUtils.writeStringToFile(outputFile, outputBuffer.toString()); return 0; }
Source:
<code>private static void handleError(File pigLog) throws Exception { System.out.println(); System.out.println("Pig logfile dump:"); System.out.println(); try { BufferedReader reader = new BufferedReader(new FileReader(pigLog)); String line = reader.readLine(); isTuningError = false; TuningErrorHandler tuningErrorHandle = new TuningErrorHandler(); while (line != null) { System.err.println(line); line = reader.readLine(); if (tuningErrorHandle.containsAutoTuningError(line)) { isTuningError = true; } } <START> reader.close(); <END> } catch (FileNotFoundException e) { System.err.println("pig log file: " + pigLog + " not found."); } }</code><technical_language>This in a finally clause. Ideally, a try-with-resources statement</technical_language>

Target:
private static void handleError(File pigLog) throws Exception { System.out.println(); System.out.println("Pig logfile dump:"); System.out.println(); try (BufferedReader reader = new BufferedReader(new FileReader(pigLog))) { String line = reader.readLine(); boolean isTuningError = false; TuningErrorDetector tuningErrorDetector = new TuningErrorDetector(); while (line != null) { System.err.println(line); line = reader.readLine(); if (tuningErrorDetector.containsAutoTuningError(line)) { isTuningError = true; } } if (isTuningError) { throw new TuningException("Auto Tuning Failure"); } } catch (FileNotFoundException e) { System.err.println("pig log file: " + pigLog + " not found."); } }
Source:
<code>public void testSplitDeviceDataByDay() { final DateTime timestamp = DateTime.now(DateTimeZone.UTC).withHourOfDay(21).withMinuteOfHour(0); <START> final List<DeviceData> data = new ArrayList<>(); <END> addDeviceData(data, 0, timestamp.withHourOfDay(21)); addDeviceData(data, 0, timestamp.withHourOfDay(23)); addDeviceData(data, 0, timestamp.plusDays(1).withHourOfDay(4)); addDeviceData(data, 1, timestamp.plusDays(1).withHourOfDay(21)); addDeviceData(data, 1, timestamp.plusDays(2).withHourOfDay(3)); addDeviceData(data, 1, timestamp.plusDays(2).withHourOfDay(4)); addDeviceData(data, 2, timestamp.plusDays(2).withHourOfDay(21)); addDeviceData(data, 3, timestamp.plusDays(4).withHourOfDay(1)); addDeviceData(data, 3, timestamp.plusDays(4).withHourOfDay(2)); final List<List<DeviceData>> deviceDataByDay = BedLightDuration.splitDeviceDataByDay(data); assertThat(deviceDataByDay.size(), is(4)); final Integer day1Duration = BedLightDuration.findLightOnDurationForDay(deviceDataByDay.get(0), 420); final Integer day2Duration = BedLightDuration.findLightOnDurationForDay(deviceDataByDay.get(1), 420); final Integer day3Duration = BedLightDuration.findLightOnDurationForDay(deviceDataByDay.get(2), 420); final Integer day4Duration = BedLightDuration.findLightOnDurationForDay(deviceDataByDay.get(3), 420); assertThat(day1Duration, is(7*60)); assertThat(day2Duration, is(7*60)); assertThat(day3Duration, is(0*60)); assertThat(day4Duration, is(1*60)); }</code><technical_language>_style_</technical_language>

Target:
public void testSplitDeviceDataByDay() { final DateTime timestamp = DateTime.now(DateTimeZone.UTC).withHourOfDay(21).withMinuteOfHour(0); final List<DeviceData> data = Lists.newArrayList( createNewDeviceData(0, timestamp.withHourOfDay(21)), createNewDeviceData(0, timestamp.withHourOfDay(23)), createNewDeviceData(0, timestamp.plusDays(1).withHourOfDay(4)), createNewDeviceData(1, timestamp.plusDays(1).withHourOfDay(21)), createNewDeviceData(1, timestamp.plusDays(2).withHourOfDay(3)), createNewDeviceData(1, timestamp.plusDays(2).withHourOfDay(4)), createNewDeviceData(2, timestamp.plusDays(2).withHourOfDay(21)), createNewDeviceData(3, timestamp.plusDays(4).withHourOfDay(1)), createNewDeviceData(3, timestamp.plusDays(4).withHourOfDay(2)) ); final List<List<DeviceData>> deviceDataByDay = BedLightDuration.splitDeviceDataByDay(data); assertThat(deviceDataByDay.size(), is(4)); final Integer day1Duration = BedLightDuration.findLightOnDurationForDay(deviceDataByDay.get(0), 420); final Integer day2Duration = BedLightDuration.findLightOnDurationForDay(deviceDataByDay.get(1), 420); final Integer day3Duration = BedLightDuration.findLightOnDurationForDay(deviceDataByDay.get(2), 420); final Integer day4Duration = BedLightDuration.findLightOnDurationForDay(deviceDataByDay.get(3), 420); assertThat(day1Duration, is(7*60)); assertThat(day2Duration, is(7*60)); assertThat(day3Duration, is(0*60)); assertThat(day4Duration, is(1*60)); }
Source:
<code>public ConfigImpl(Context context) { BASE_URL = context.getString(R.string.baseUrl); CANVASS_URL = context.getString(R.string.canvassUrl); CLIENT_ID = context.getString(R.string.oauth2ClientId); CLIENT_SECRET = context.getString(R.string.oauth2ClientSecret); String name = "FieldTheBern"; String version = null; try { <START> version = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName; <END> } catch (PackageManager.NameNotFoundException e) { version = "dev"; } LinkedList<String> comments = new LinkedList<>(); if(Build.VERSION.RELEASE != null) { comments.add("Android " + Build.VERSION.RELEASE); } if(Build.MODEL != null) { comments.add(Build.MODEL); } String nameAndVersion = name + "/" + version; String comment = Joiner.on("; ").join(comments); if(comment.length() > 0) { comment = " (" + comment + ")"; } USER_AGENT = nameAndVersion + comment; }</code><technical_language>good add version code here. versionCode is interger google play requires incremented updates, versionName is a string developer (or forget update)</technical_language>

Target:
public ConfigImpl(Context context) { BASE_URL = context.getString(R.string.baseUrl); CANVASS_URL = context.getString(R.string.canvassUrl); CLIENT_ID = context.getString(R.string.oauth2ClientId); CLIENT_SECRET = context.getString(R.string.oauth2ClientSecret); String name = "FieldTheBern"; String version = "dev"; try { PackageInfo packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0); version = packageInfo.versionName + "-b" + packageInfo.versionCode; } catch (PackageManager.NameNotFoundException e) { } LinkedList<String> comments = new LinkedList<>(); if(Build.VERSION.RELEASE != null) { comments.add("Android " + Build.VERSION.RELEASE); } if(Build.MODEL != null) { comments.add(Build.MODEL); } String nameAndVersion = name + "/" + version; String comment = Joiner.on("; ").join(comments); if(comment.length() > 0) { comment = " (" + comment + ")"; } USER_AGENT = nameAndVersion + comment; }
Source:
<code>public void start() { <START> communicationFSMConsumer.submit(this::consume); <END> router.connect(); }</code><technical_language>I out of curiosity. is difference this model thread running blocking eventQue</technical_language>

Target:
public void start() { log.info("Start Log Replication Runtime to remote {}", remoteClusterId); communicationFSMConsumer.submit(this::consume); router.connect(); }
Source:
<code><START> public static long calculateMaxMemoryFromPercent( int percent ) <END> { if ( percent < 1 ) { throw new IllegalArgumentException( "Expected percentage to be > 0, was " + percent ); } if ( percent > 100 ) { throw new IllegalArgumentException( "Expected percentage to be < 100, was " + percent ); } long freePhysicalMemory = OsBeanUtil.getFreePhysicalMemory(); if ( freePhysicalMemory == OsBeanUtil.VALUE_UNAVAILABLE ) { throw new UnsupportedOperationException( "Unable to detect amount of free memory, so max memory has to be explicitly set" ); } double factor = percent / 100D; return round( (freePhysicalMemory - Runtime.getRuntime().maxMemory()) * factor ); }</code><technical_language>is need declare public</technical_language>

Target:
static long calculateMaxMemoryFromPercent( int percent ) { if ( percent < 1 ) { throw new IllegalArgumentException( "Expected percentage to be > 0, was " + percent ); } if ( percent > 100 ) { throw new IllegalArgumentException( "Expected percentage to be < 100, was " + percent ); } long freePhysicalMemory = OsBeanUtil.getFreePhysicalMemory(); if ( freePhysicalMemory == OsBeanUtil.VALUE_UNAVAILABLE ) { throw new UnsupportedOperationException( "Unable to detect amount of free memory, so max memory has to be explicitly set" ); } double factor = percent / 100D; return round( (freePhysicalMemory - Runtime.getRuntime().maxMemory()) * factor ); }
Source:
<code>private FilterValidation isFiltered(MessageContent message, List<MessageFilterSpecification> filterSpecifications) { final List<MessageFilter> filters = filterSpecifications.stream() .map(messageFilters::compile) .collect(toList()); final FilterResult result = new FilterChain(filters).apply(message); <START> if(result.getCause().isPresent()) { <END> throw new InvalidFilterTypeException("Filters don't match topic's content type"); } return new FilterValidation(result.isFiltered()); }</code><technical_language>space keywords</technical_language>

Target:
private FilterValidation isFiltered(MessageContent message, List<MessageFilterSpecification> filterSpecifications) { List<MessageFilter> filters; try { filters = filterSpecifications.stream() .map(messageFilters::compile) .collect(toList()); } catch (NoSuchFilterException ex) { throw new FilterValidationException(ex.getMessage(), ex); } FilterResult result = new FilterChain(filters).apply(message); if (result.getCause().isPresent()) { Exception exception = result.getCause().get(); throw new FilterValidationException(exception.getMessage(), exception); } return new FilterValidation(result.isFiltered()); }
Source:
<code>private void reportError(BuildStep bs, Throwable e, BuildListener listener, boolean phase) { String msg = "Publisher " + bs.getClass().getName() + " aborted due to exception"; if (!(e instanceof AbortException)){ e.printStackTrace(listener.error(msg)); } <START> LOGGER.log(WARNING, msg, e); <END> if (phase) { setResult(Result.FAILURE); } }</code><technical_language>print stack trace in log for Aborts</technical_language>

Target:
private void reportError(BuildStep bs, Throwable e, BuildListener listener, boolean phase) { final String publisher = ((Publisher) bs).getDescriptor().getDisplayName(); if (e instanceof AbortException) { LOGGER.log(Level.FINE, "{0} : {1} failed", new Object[] {AbstractBuild.this, publisher}); listener.error("Publisher '" + publisher + "' failed: " + e.getMessage()); } else { String msg = "Publisher '" + publisher + "' aborted due to exception: "; e.printStackTrace(listener.error(msg)); LOGGER.log(WARNING, msg, e); } if (phase) { setResult(Result.FAILURE); } }
Source:
<code>public Filter adapt(FilterAdapterContext context, BigtableFilter filter) throws IOException { <START> return FILTERS.fromProto(filter.getRowFilter()); <END> }</code><technical_language>BigtableFilter a com.google.cloud.bigtable.data.v2.models.Filters.Filter member variable. deprecating current constructor com.google.cloud.bigtable.data.v2.wrappers.Filters.Filter, a com.google.cloud.bigtable.data.v2.models.Filters.Filter in a new constructor. Also, please add a BigtableFilter.getFilter() returns models.Filters.Filter getter here</technical_language>

Target:
public Filter adapt(FilterAdapterContext context, BigtableFilter filter) throws IOException { return filter.getFilter(); }
Source:
<code>private String getUsernameForUserId(int id) { if (id > 0) { String username = userIdentityStore.getPortalUserName(id); if (username != null) { return username; } <START> logger.warn("Invalid userID found when exporting a portlet; return system username instead"); <END> } return systemUsername; }</code><technical_language>Placeholder placeholder value</technical_language>

Target:
private String getUsernameForUserId(int id) { if (id > 0) { String username = userIdentityStore.getPortalUserName(id); if (username != null) { return username; } logger.warn("Invalid userID found when exporting a portlet; return system username instead", id); } return systemUsername; }