auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private static void writeConvertTable(Repository repo, ReftableWriter w, boolean writeLogs) throws IOException { int size = 0; List<Ref> refs = repo.getRefDatabase().getRefs(); if (writeLogs) { for (Ref r : refs) { ReflogReader rlr = repo.getReflogReader(r.getName()); size = <START> Math.max(rlr.getReverseEntries().size(), <END> size); } } w.setMinUpdateIndex(1).setMaxUpdateIndex(size + 1).begin(); try (RevWalk rw = new RevWalk(repo)) { List<Ref> toWrite = new ArrayList<>(refs.size()); for (Ref r : refs) { toWrite.add(refForWrite(rw, r)); } w.sortAndWriteRefs(toWrite); } if (writeLogs) { for (Ref r : refs) { long idx = size; ReflogReader reader = repo.getReflogReader(r.getName()); for (ReflogEntry e : reader.getReverseEntries()) { w.writeLog(r.getName(), idx, e.getWho(), e.getOldId(), e.getNewId(), e.getComment()); idx--; } } } }</code><technical_language>potential NPE, getReflogReader is @Nullable</technical_language>

Target:
private static void writeConvertTable(Repository repo, ReftableWriter w, boolean writeLogs) throws IOException { int size = 0; List<Ref> refs = repo.getRefDatabase().getRefs(); if (writeLogs) { for (Ref r : refs) { ReflogReader rlr = repo.getReflogReader(r.getName()); size = Math.max( rlr == null ? 0 : rlr.getReverseEntries().size(), size); } } w.setMinUpdateIndex(1).setMaxUpdateIndex(size + 1).begin(); try (RevWalk rw = new RevWalk(repo)) { List<Ref> toWrite = new ArrayList<>(refs.size()); for (Ref r : refs) { toWrite.add(refForWrite(rw, r)); } w.sortAndWriteRefs(toWrite); } if (writeLogs) { for (Ref r : refs) { long idx = size; ReflogReader reader = repo.getReflogReader(r.getName()); if (reader == null) { continue; } for (ReflogEntry e : reader.getReverseEntries()) { w.writeLog(r.getName(), idx, e.getWho(), e.getOldId(), e.getNewId(), e.getComment()); idx--; } } } }
Source:
<code>public void showAsyncDialogFragment(AsyncDialogFragment newFragment) { <START> showAsyncDialogFragment(newFragment, DEFAULT_NOTIFICATION_CHANNEL_ID); <END> }</code><technical_language>is new default channel</technical_language>

Target:
public void showAsyncDialogFragment(AsyncDialogFragment newFragment) { showAsyncDialogFragment(newFragment, NotificationChannels.Channel.GENERAL); }
Source:
<code>public Optional<EnumParticleTypes> getVanillaParticleType() { <START> return Optional.of(EnumParticleTypes.valueOf(name)); <END> }</code><technical_language>Enums throw IllegalArgumentException if name is available, this return type throw exception, Optional.absent()</technical_language>

Target:
public Optional<EnumParticleTypes> getVanillaParticleType() { try { return Optional.of(EnumParticleTypes.valueOf(name)); } catch (IllegalArgumentException e) { } return Optional.absent(); }
Source:
<code>public long size() { if (name.startsWith(CLASSPATH_PREFIX)) { try { String fileName = name.substring(CLASSPATH_PREFIX.length()); if (!fileName.startsWith("/")) { fileName = "/" + fileName; } URL resource = this.getClass().getResource(fileName); if (resource != null) { <START> return Files.size(Paths.get(this.getClass().getResource(fileName).toURI())); <END> } else { return 0; } } catch (Exception e) { return 0; } } return new File(name).length(); }</code><technical_language>return Files.size(Paths.get(resource.toURI()));</technical_language>

Target:
public long size() { if (name.startsWith(CLASSPATH_PREFIX)) { try { String fileName = name.substring(CLASSPATH_PREFIX.length()); if (!fileName.startsWith("/")) { fileName = "/" + fileName; } URL resource = this.getClass().getResource(fileName); if (resource != null) { return Files.size(Paths.get(resource.toURI())); } else { return 0; } } catch (Exception e) { return 0; } } return new File(name).length(); }
Source:
<code>public void testEndOfFreeBlockIsUsedIfThePreviousBlockIsLargerThanTheNextBlock() throws Exception { long prevChunk = mallocChunks(4); long middleChunk = mallocChunks(4); long nextChunk = mallocChunks(2); free(middleChunk); long smallChunk1 = mallocChunks(1); long smallChunk2 = mallocChunks(1); <START> assertTrue("The small chunks should have been allocated from the end of the free block", smallChunk1 > smallChunk2); assertTrue("The small chunks should have been allocated from space before 'nextChunk'", smallChunk1 < nextChunk); assertTrue("The small chunks should have been allocated from space after 'prevChunk'", smallChunk2 > prevChunk); <END> }</code><technical_language>I change order to: assertTrue(prevChunk < smallChunk2); assertTrue(smallChunk2 < smallChunk1); assertTrue(smallChunk1 < nextChunk);</technical_language>

Target:
public void testEndOfFreeBlockIsUsedIfThePreviousBlockIsLargerThanTheNextBlock() throws Exception { long prevChunk = mallocChunks(4); long middleChunk = mallocChunks(4); long nextChunk = mallocChunks(2); free(middleChunk); long smallChunk1 = mallocChunks(1); long smallChunk2 = mallocChunks(1); assertTrue("The small chunks should have been allocated from space after 'prevChunk'", prevChunk < smallChunk2); assertTrue("The small chunks should have been allocated from the end of the free block", smallChunk2 < smallChunk1); assertTrue("The small chunks should have been allocated from space before 'nextChunk'", smallChunk1 < nextChunk); }
Source:
<code>public @Nullable LttngInterruptContext peekContextStack(String hostId, Integer cpu) { Stack<LttngInterruptContext> stack = fIntCtxStacks.get(hostId, cpu); <START> if (stack == null) { <END> return null; } if (stack.empty()) { return null; } return stack.peek(); }</code><technical_language>merge please if( stack == null || stack.isEmpty()) {return null;} a separate helper method avoid duplication. or. both</technical_language>

Target:
public LttngInterruptContext peekContextStack(String hostId, Integer cpu) { Stack<LttngInterruptContext> stack = fIntCtxStacks.get(hostId, cpu); if (stack == null) { return LttngInterruptContext.DEFAULT_CONTEXT; } if (stack.empty()) { return LttngInterruptContext.DEFAULT_CONTEXT; } LttngInterruptContext peek = stack.peek(); if (peek == null) { peek = LttngInterruptContext.DEFAULT_CONTEXT; } return peek; }
Source:
<code>public AllNodes getAllNodes() { <START> return new AllNodes( <END> ImmutableSet.of( new InternalNode("spark1", URI.create("<LINK_1>"), NodeVersion.UNKNOWN, false), new InternalNode("spark2", URI.create("<LINK_3>"), NodeVersion.UNKNOWN, false), new InternalNode("spark3", URI.create("<LINK_0>"), NodeVersion.UNKNOWN, false), new InternalNode("spark4", URI.create("<LINK_2>"), NodeVersion.UNKNOWN, false)), ImmutableSet.of(), ImmutableSet.of(), ImmutableSet.of()); }</code><technical_language>nit: this a static field instead</technical_language>

Target:
public AllNodes getAllNodes() { return ALL_NODES; }
Source:
<code>public void predicate_fromJsonString() { IndexSearchTarget searchTarget = indexManager.createSearchTarget().build(); SearchQuery<DocumentReference> query = searchTarget.query( sessionContext ) .asReferences() .predicate().bool( b -> { b.should().extension().ifSupported( LuceneExtension.get(), c -> c.fromLuceneQuery( new TermQuery( new Term( "string", "text 1" ) ) ) <START> ); <END> b.should().extension( LuceneExtension.get() ) .fromLuceneQuery( IntPoint.newExactQuery( "integer", 2 ) ); b.should().extension() .ifSupported( LuceneExtension.get(), c -> c.fromLuceneQuery( LatLonPoint.newDistanceQuery( "geoPoint", 40, -70, 200_000 ) ) ) .orElseFail(); } ) .build(); assertThat( query ) .hasReferencesHitsAnyOrder( INDEX_NAME, FIRST_ID, SECOND_ID, THIRD_ID ) .hasHitCount( 3 ); }</code><technical_language>Is valid call ifSupported() a orElse() orElseFail()</technical_language>

Target:
public void predicate_fromJsonString() { IndexSearchTarget searchTarget = indexManager.createSearchTarget().build(); SearchQuery<DocumentReference> query = searchTarget.query( sessionContext ) .asReferences() .predicate().bool( b -> { b.should().extension( LuceneExtension.get() ) .fromLuceneQuery( new TermQuery( new Term( "string", "text 1" ) ) ); b.should().extension( LuceneExtension.get() ) .fromLuceneQuery( IntPoint.newExactQuery( "integer", 2 ) ); b.should().extension( LuceneExtension.get() ) .fromLuceneQuery( LatLonPoint.newDistanceQuery( "geoPoint", 40, -70, 200_000 ) ); } ) .build(); assertThat( query ) .hasReferencesHitsAnyOrder( INDEX_NAME, FIRST_ID, SECOND_ID, THIRD_ID ) .hasHitCount( 3 ); }
Source:
<code>private void initRecycler() { <START> links.setLayoutManager(new LinearLayoutManager(getActivity())); <END> links.setNestedScrollingEnabled(false); }</code><technical_language>I if matters much, consider getContext() instead. Context is LinearLayoutManager needs and, I think, more independent of Fragment Activity lifecycles getActivity()</technical_language>

Target:
private void initRecycler() { links.setLayoutManager(new LinearLayoutManager(getContext())); links.setNestedScrollingEnabled(false); }
Source:
<code>public void upgrade(ResourceUpgradeReport upgradeReport, ResourceUpgradeContext<ResourceComponent<?>> inventoriedResource) { ProcessInfo processInfo = inventoriedResource.getNativeProcess(); if (DiscoveryCallbackImpl.isRhqServer(processInfo)) { Configuration pluginConfiguration = upgradeReport.getNewPluginConfiguration(); if (pluginConfiguration == null) { pluginConfiguration = inventoriedResource.getPluginConfiguration(); } pluginConfiguration.setSimpleValue("supportsPatching", "false"); String resourceName = upgradeReport.getNewName(); if (resourceName == null) { resourceName = inventoriedResource.getName(); } if (!resourceName.endsWith(" RHQ Server")) { resourceName += " RHQ Server"; } upgradeReport.setNewName(resourceName); <START> } <END> }</code><technical_language>profit report attributes null checking. PC do newPluginConfig newName set</technical_language>

Target:
public void upgrade(ResourceUpgradeReport upgradeReport, ResourceUpgradeContext<ResourceComponent<?>> inventoriedResource) { ProcessInfo processInfo = inventoriedResource.getNativeProcess(); if (DiscoveryCallbackImpl.isRhqServer(processInfo)) { Configuration pluginConfiguration = upgradeReport.getNewPluginConfiguration(); if (pluginConfiguration == null) { pluginConfiguration = inventoriedResource.getPluginConfiguration(); } String currentValue = pluginConfiguration.getSimpleValue("supportsPatching"); if (currentValue == null) { pluginConfiguration.setSimpleValue("supportsPatching", "false"); upgradeReport.setNewPluginConfiguration(pluginConfiguration); } String resourceName = upgradeReport.getNewName(); if (resourceName == null) { resourceName = inventoriedResource.getName(); } if (!resourceName.endsWith(" RHQ Server")) { resourceName += " RHQ Server"; upgradeReport.setNewName(resourceName); } } }
Source:
<code>protected void update(final Map<String, Object> attributes) { final String id = (String) attributes.get(getIdAttribute()); logger.debug("Updating id: with attributes: {}", id, attributes); final Map<String,Object> profile = profiles.get(id); if (profile != null) { profile.putAll(attributes); } else { <START> insert(attributes); <END> } }</code><technical_language>do: profiles.put(id, attributes);</technical_language>

Target:
protected void update(final Map<String, Object> attributes) { final String id = (String) attributes.get(getIdAttribute()); logger.debug("Updating id: with attributes: {}", id, attributes); final Map<String,Object> profile = profiles.get(id); if (profile != null) { profile.putAll(attributes); } else { profiles.put(id, attributes); } }
Source:
<code>private static boolean isVariableThatCanEscape(Symbol symb) { List<Usage> usages = symb.usages(); if (usages.size() > 2) { return usages.stream().anyMatch(u -> !u.isBindingUsage() && TreeUtils.firstAncestorOfKind(u.tree(), Tree.Kind.IS) == null); <START> } else { <END> return false; } }</code><technical_language>Minor: I remove else returning in if body</technical_language>

Target:
private static boolean isVariableThatCanEscape(Symbol symb) { List<Usage> usages = symb.usages(); if (usages.size() > 2) { return usages.stream().anyMatch(u -> !u.isBindingUsage() && TreeUtils.firstAncestorOfKind(u.tree(), Tree.Kind.IS) == null); } return false; }
Source:
<code>public static Listener buildListener(ListenerDefinition listenerDef, AsyncDispatcher<TelemetryMessage> dispatcher) throws Exception { <START> final Class<?> clazz = Class.forName(listenerDef.getClassName()); <END> final Constructor<?> ctor = clazz.getConstructor(); final Object listenerInstance = ctor.newInstance(); if (!(listenerInstance instanceof Listener)) { throw new IllegalArgumentException(String.format("%s must implement %s", listenerDef.getClassName(), Listener.class.getCanonicalName())); } final Listener listener = (Listener)listenerInstance; final BeanWrapper wrapper = PropertyAccessorFactory.forBeanPropertyAccess(listener); wrapper.setPropertyValues(listenerDef.getParameterMap()); listener.setName(listenerDef.getName()); listener.setDispatcher(dispatcher); return listener; }</code><technical_language>I playing telemetryd defined accident a non-existing class, this threw exception. want add a more meaning full message "Cannot instantiate listener" instead of a generic "Class Exception", etc</technical_language>

Target:
public static Listener buildListener(ListenerDefinition listenerDef, AsyncDispatcher<TelemetryMessage> dispatcher) throws Exception { final Object listenerInstance; try { final Class<?> clazz = Class.forName(listenerDef.getClassName()); final Constructor<?> ctor = clazz.getConstructor(); listenerInstance = ctor.newInstance(); } catch (Exception e) { throw new RuntimeException(String.format("Failed to instantiate listener with class name '%s'.", listenerDef.getClassName(), e)); } if (!(listenerInstance instanceof Listener)) { throw new IllegalArgumentException(String.format("%s must implement %s", listenerDef.getClassName(), Listener.class.getCanonicalName())); } final Listener listener = (Listener)listenerInstance; final BeanWrapper wrapper = PropertyAccessorFactory.forBeanPropertyAccess(listener); wrapper.setPropertyValues(listenerDef.getParameterMap()); listener.setName(listenerDef.getName()); listener.setDispatcher(dispatcher); return listener; }
Source:
<code><START> public boolean getChannelStatus(String channelIdentifier) { <END> return false; }</code><technical_language>channel status Enum instead of a POD type? Res: new Enum type created: ChannelStatus</technical_language>

Target:
public ChannelStatus getChannelStatus(String channelIdentifier) { return ChannelStatus.OFFLINE; }
Source:
<code>public boolean apply(Throwable exception) { String message; try { message = "Unexpected exception during request; channel = " + channel; } catch (Exception ignore) { message = "Unexpected exception during request; channel = <unprintable>"; } boolean isIOException = exception instanceof IOException || (exception.getCause() instanceof IOException); if (!alwaysLogAtError && isIOException) { <START> if (ioExceptionsAtDebugLevel.stream().anyMatch(ioExceptionAtDebugLevel -> exception.getMessage().contains(ioExceptionAtDebugLevel))) <END> { logger.trace(message, exception); } else { logger.info(message, exception); } } else { logger.error(message, exception); } return true; }</code><technical_language>prefer avoid streaming API creates a bunch of excess garbage. this instead: java // exceptions thrown netty epoll transport add name of function failed // exception string (which is simply wrapping a JDK exception), do a simple/naive comparison String errorMessage = exception.getMessage(); boolean logAtTrace = false; for (String s : ioExceptionsAtDebugLevel) { if (errorMessage.contains(s)) { logAtTrace = true; break; } } if (logAtTrace) { // unclean client disconnects logger.trace(message, exception); } else { // Generally unhandled IO exceptions network issues, actual ERRORS logger.info(message, exception); }</technical_language>

Target:
public boolean apply(Throwable exception) { String message; try { message = "Unexpected exception during request; channel = " + channel; } catch (Exception ignore) { message = "Unexpected exception during request; channel = <unprintable>"; } boolean isIOException = exception instanceof IOException || (exception.getCause() instanceof IOException); if (!alwaysLogAtError && isIOException) { String errorMessage = exception.getMessage(); boolean logAtTrace = false; for (String ioException : ioExceptionsAtDebugLevel) { if (errorMessage.contains(ioException)) { logAtTrace = true; break; } } if (logAtTrace) { logger.trace(message, exception); } else { logger.info(message, exception); } } else { logger.error(message, exception); } return true; }
Source:
<code>public HttpResponse execute(HttpRequestBase request, IOperationMonitor monitor) throws IOException { prepareRequest(request, monitor); <START> return HttpUtil.execute(getHttpClient(), HttpUtil.createHost(request), context.get(), request, monitor); <END> }</code><technical_language>this getContext() instead of context.get()</technical_language>

Target:
public HttpResponse execute(HttpRequestBase request, IOperationMonitor monitor) throws IOException { prepareRequest(request, monitor); return HttpUtil.execute(getHttpClient(), HttpUtil.createHost(request), getContext(), request, monitor); }
Source:
<code>public synchronized String format(LogRecord record) { date.setTime(record.getMillis()); args[0] = date; args[1] = "[id=" + record.getThreadID() + "]"; args[2] = record.getLevel().getName(); args[3] = record.getSourceMethodName() != null ? abbreviateClassName( record.getSourceClassName() == null ? record.getLoggerName() : record.getSourceClassName(), 32) + "#" + record.getSourceMethodName() : abbreviateClassName( record.getSourceClassName() == null ? record.getLoggerName() : record.getSourceClassName(), 40); args[4] = formatMessage(record); StringBuffer buf = formatter.format(args, new StringBuffer(), null); if (record.getThrown() != null) { try { StringWriter writer = new StringWriter(); PrintWriter out = new PrintWriter(writer); record.getThrown().printStackTrace(out); out.close(); buf.append(writer.toString()); } catch (Error error) { throw error; <START> } catch (Throwable e) { <END> } } return buf.toString(); }</code><technical_language>Uh, is purpose of this change exactly</technical_language>

Target:
public synchronized String format(LogRecord record) { date.setTime(record.getMillis()); args[0] = date; args[1] = "[id=" + record.getThreadID() + "]"; args[2] = record.getLevel().getName(); args[3] = record.getSourceMethodName() != null ? abbreviateClassName( record.getSourceClassName() == null ? record.getLoggerName() : record.getSourceClassName(), 32) + "#" + record.getSourceMethodName() : abbreviateClassName( record.getSourceClassName() == null ? record.getLoggerName() : record.getSourceClassName(), 40); args[4] = formatMessage(record); StringBuffer buf = formatter.format(args, new StringBuffer(), null); if (record.getThrown() != null) { try { StringWriter writer = new StringWriter(); PrintWriter out = new PrintWriter(writer); record.getThrown().printStackTrace(out); out.close(); buf.append(writer.toString()); } catch (Exception e) { } } return buf.toString(); }
Source:
<code>public DBReferenceInfo getDatabaseReferences() { ArrayList<String> dbEntries=new ArrayList<String>(); if (uniprotDoc == null) return null; try { Element uniprotElement = uniprotDoc.getDocumentElement(); Element entryElement = XMLHelper.selectSingleElement(uniprotElement, "entry"); ArrayList<Element> dbreferenceElementList = XMLHelper.selectElements(entryElement, "dbReference"); for (Element element : dbreferenceElementList) { String type = element.getAttribute("type"); String id = element.getAttribute("id"); ArrayList<Element> propertyElementList = XMLHelper.selectElements(element, "property"); for (Element propertyElement : propertyElementList) { String propertyType = propertyElement.getAttribute("type"); String propertyValue = propertyElement.getAttribute("value"); <START> System.out.println("here comes a dbxref, with: type: "+type+", id: "+id+", propertyType: "+propertyType+", propertyValue: "+propertyValue); <END> dbEntries.add(propertyType+":"+propertyValue); } } } catch (XPathExpressionException e) { logger.error("Problems while parsing db references in UniProt XML: {}. No db references will be available.",e.getMessage()); return null; } return new DBReferenceInfo(dbEntries.toArray(new String[dbEntries.size()])); }</code><technical_language>a logger (from slf4j api). I guess debug level</technical_language>

Target:
public DBReferenceInfo getDatabaseReferences() { DBReferenceInfo dbRefI=null; if (uniprotDoc == null) return null; try { Element uniprotElement = uniprotDoc.getDocumentElement(); Element entryElement = XMLHelper.selectSingleElement(uniprotElement, "entry"); ArrayList<Element> dbreferenceElementList = XMLHelper.selectElements(entryElement, "dbReference"); for (Element element : dbreferenceElementList) { String type = element.getAttribute("type"); String id = element.getAttribute("id"); if(dbRefI==null) dbRefI = new DBReferenceInfo(type, id); else dbRefI.addDBReferenceInfo(type, id); } } catch (XPathExpressionException e) { logger.error("Problems while parsing db references in UniProt XML: {}. No db references will be available.",e.getMessage()); return null; } return dbRefI; }
Source:
<code>private static void booted(final boolean result) { sBooted = true; sBootResult = result; sBooting = false; if (result) { <START> Utils.d("BOOTED ++++++++++++"); <END> } else { Utils.d("BOOT FAILED } Utils.runOnMain(new Runnable() { @Override public void run() { for (IOnResult<Boolean> callback : mBootCallbacks) { if (callback != null) { callback.onResult(result); } } mBootCallbacks.clear(); } }); }</code><technical_language>line of plusses? booted sufficient right</technical_language>

Target:
private static void booted(final boolean result) { sBooted = true; sBootResult = result; sBooting = false; if (result) { Utils.d("Booted!"); } else { Utils.d("Boot failed..."); } Utils.runOnMain(new Runnable() { @Override public void run() { for (IOnResult<Boolean> callback : mBootCallbacks) { if (callback != null) { callback.onResult(result); } } mBootCallbacks.clear(); } }); }
Source:
<code>public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain filterChain) throws IOException, ServletException { final HttpServletResponse httpResponse = (HttpServletResponse) response; try { filterChain.doFilter(request, response); <START> } catch (final Throwable e) { <END> final Throwable t = extractErrorToCompare(e); ErrorHolder currentMatch = null; for (final ErrorHolder errorHolder : this.errors) { if (errorHolder.exactMatch(t)) { currentMatch = errorHolder; break; } else if (errorHolder.inheritanceMatch(t)) { currentMatch = errorHolder; } } if (currentMatch != null) { httpResponse.sendRedirect(currentMatch.getUrl()); } else { httpResponse.sendRedirect(defaultErrorRedirectPage); } } }</code><technical_language>I find excessive a catch (Throwable. A catch Exception enough</technical_language>

Target:
public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain filterChain) throws IOException, ServletException { final HttpServletResponse httpResponse = (HttpServletResponse) response; try { filterChain.doFilter(request, response); } catch (final Exception e) { final Throwable t = extractErrorToCompare(e); ErrorHolder currentMatch = null; for (final ErrorHolder errorHolder : this.errors) { if (errorHolder.exactMatch(t)) { currentMatch = errorHolder; break; } else if (errorHolder.inheritanceMatch(t)) { currentMatch = errorHolder; } } if (currentMatch != null) { httpResponse.sendRedirect(currentMatch.getUrl()); } else { httpResponse.sendRedirect(defaultErrorRedirectPage); } } }
Source:
<code>public void getImageBytes(ByteBuffer byteBuffer) { DataBuffer dataBuffer = image.getRaster().getDataBuffer(); byte[] pixelData = ((DataBufferByte) dataBuffer).getData(); <START> byteBuffer.wrap(pixelData); <END> }</code><technical_language>return wrapped original buffer copy? changes in underlying buffer affect other threads reading image data</technical_language>

Target:
public void getImageBytes(ByteBuffer byteBuffer) { try { byteBuffer.put(readNextFrame()); } catch (IOException e) { e.printStackTrace(); } }
Source:
<code>public void testCheckLengthVersion_2() throws Exception { System.setProperty("VERSION","1.0.0-1.0.0"); assertThatExceptionOfType(Exception.class).isThrownBy(() -> runontag.checkParams(runontag.getParams("@runOnEnv(VERSION>1.0.0-1.0)"))) <START> .withMessage("Error while parsing params. The versions must have the same numbers of elements"); <END> }</code><technical_language>.. number of elements</technical_language>

Target:
public void testCheckLengthVersion_2() throws Exception { System.setProperty("VERSION","1.0.0-1.0.0"); assertThatExceptionOfType(Exception.class).isThrownBy(() -> runontag.checkParams(runontag.getParams("@runOnEnv(VERSION>1.0.0-1.0)"))) .withMessage("Error while parsing params. The versions must have the same number of elements"); }
Source:
<code>public void testJobCanceledEventOnBoundaryEvent() throws Exception { Clock testClock = new DefaultClockImpl(); <START> assertNotNull(testClock); <END> processEngineConfiguration.setClock(testClock); testClock.setCurrentTime(new Date()); runtimeService.startProcessInstanceByKey("testTimerCancelledEvent"); listener.clearEventsReceived(); Task task = taskService.createTaskQuery().singleResult(); taskService.complete(task.getId()); checkEventCount(1, ActivitiEventType.JOB_CANCELED); }</code><technical_language>This sense.. created instance</technical_language>

Target:
public void testJobCanceledEventOnBoundaryEvent() throws Exception { Clock testClock = new DefaultClockImpl(); processEngineConfiguration.setClock(testClock); testClock.setCurrentTime(new Date()); runtimeService.startProcessInstanceByKey("testTimerCancelledEvent"); listener.clearEventsReceived(); Task task = taskService.createTaskQuery().singleResult(); assertNotNull(task); taskService.complete(task.getId()); checkEventCount(1, ActivitiEventType.JOB_CANCELED); }
Source:
<code>protected void doStop() { if (this.hazelcastInstance.getLifecycleService().isRunning()) { <START> if (this.monitorTypes.contains(ClusterMonitorType.MEMBERSHIP.name())) { <END> this.hazelcastInstance.getCluster().removeMembershipListener( this.hazelcastRegisteredListenerIdMap .get(ClusterMonitorType.MEMBERSHIP)); this.hazelcastRegisteredListenerIdMap .remove(ClusterMonitorType.MEMBERSHIP); } if (this.monitorTypes.contains(ClusterMonitorType.DISTRIBUTED_OBJECT.name())) { this.hazelcastInstance .removeDistributedObjectListener(this.hazelcastRegisteredListenerIdMap .get(ClusterMonitorType.DISTRIBUTED_OBJECT)); this.hazelcastRegisteredListenerIdMap .remove(ClusterMonitorType.DISTRIBUTED_OBJECT); } if (this.monitorTypes.contains(ClusterMonitorType.MIGRATION.name())) { this.hazelcastInstance.getPartitionService().removeMigrationListener( this.hazelcastRegisteredListenerIdMap .get(ClusterMonitorType.MIGRATION)); this.hazelcastRegisteredListenerIdMap .remove(ClusterMonitorType.MIGRATION); } if (this.monitorTypes.contains(ClusterMonitorType.LIFECYCLE.name())) { this.hazelcastInstance.getLifecycleService().removeLifecycleListener( this.hazelcastRegisteredListenerIdMap .get(ClusterMonitorType.LIFECYCLE)); this.hazelcastRegisteredListenerIdMap .remove(ClusterMonitorType.LIFECYCLE); } if (this.monitorTypes.contains(ClusterMonitorType.CLIENT.name())) { this.hazelcastInstance.getClientService().removeClientListener( this.hazelcastRegisteredListenerIdMap .get(ClusterMonitorType.CLIENT)); this.hazelcastRegisteredListenerIdMap.remove(ClusterMonitorType.CLIENT); } } }</code><technical_language>is need do this check. enough String id = this.hazelcastRegisteredListenerIdMap.remove(ClusterMonitorType.MEMBERSHIP); if (id != null) { this.hazelcastInstance.getCluster().removeMembershipListener(id); } if worry performance, is a chance some guy change monitorTypes runtime. other side bit mask int field instead of heavy Map</technical_language>

Target:
protected void doStop() { if (this.hazelcastInstance.getLifecycleService().isRunning()) { String id = this.hazelcastRegisteredListenerIdMap .remove(ClusterMonitorType.MEMBERSHIP); if (id != null) { this.hazelcastInstance.getCluster().removeMembershipListener(id); } id = this.hazelcastRegisteredListenerIdMap .remove(ClusterMonitorType.DISTRIBUTED_OBJECT); if (id != null) { this.hazelcastInstance.removeDistributedObjectListener(id); } id = this.hazelcastRegisteredListenerIdMap .remove(ClusterMonitorType.MIGRATION); if (id != null) { this.hazelcastInstance.getPartitionService().removeMigrationListener(id); } id = this.hazelcastRegisteredListenerIdMap .remove(ClusterMonitorType.LIFECYCLE); if (id != null) { this.hazelcastInstance.getLifecycleService().removeLifecycleListener(id); } id = this.hazelcastRegisteredListenerIdMap.remove(ClusterMonitorType.CLIENT); if (id != null) { this.hazelcastInstance.getClientService().removeClientListener(id); } } }
Source:
<code>public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { <START> if(localName.equalsIgnoreCase("geokret")) { <END> trackable = new Trackable(); trackables.add(trackable); try { final String kretyId = attributes.getValue("id"); if (StringUtils.isNumeric(kretyId)) { trackable.setGeocode(GeokretyConnector.geocode(Integer.parseInt(kretyId))); } final String distance = attributes.getValue("dist"); if (StringUtils.isNotBlank(distance)) { trackable.setDistance(Float.parseFloat(distance)); } final String kretyType = attributes.getValue("type"); if (StringUtils.isNotBlank(kretyType)) { trackable.setType(getType(Integer.parseInt(kretyType))); } final String waypointCode = attributes.getValue("waypoint"); if (StringUtils.isNotBlank(waypointCode)) { trackable.setSpottedName(waypointCode); trackable.setSpottedType(Trackable.SPOTTED_CACHE); } final String imageName = attributes.getValue("image"); if (StringUtils.isNotBlank(imageName)) { trackable.setImage("<LINK_0>" + imageName); } } catch (final NumberFormatException e) { Log.e("Parsing geokret", e); } } }</code><technical_language>Please style rules. try a space a if other constructs (as opposed functions)</technical_language>

Target:
public final void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { if (localName.equalsIgnoreCase("geokret")) { trackable = new Trackable(); trackables.add(trackable); try { final String kretyId = attributes.getValue("id"); if (StringUtils.isNumeric(kretyId)) { trackable.setGeocode(GeokretyConnector.geocode(Integer.parseInt(kretyId))); } final String distance = attributes.getValue("dist"); if (StringUtils.isNotBlank(distance)) { trackable.setDistance(Float.parseFloat(distance)); } final String kretyType = attributes.getValue("type"); if (StringUtils.isNotBlank(kretyType)) { trackable.setType(getType(Integer.parseInt(kretyType))); } final String waypointCode = attributes.getValue("waypoint"); if (StringUtils.isNotBlank(waypointCode)) { trackable.setSpottedName(waypointCode); trackable.setSpottedType(Trackable.SPOTTED_CACHE); } final String imageName = attributes.getValue("image"); if (StringUtils.isNotBlank(imageName)) { trackable.setImage("<LINK_0>" + imageName); } } catch (final NumberFormatException e) { Log.e("Parsing geokret", e); } } }
Source:
<code>public static void refreshBackground() { EclipseUIUtil.displayAsyncExec(new Runnable() { @Override public void run() { IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if (activeWorkbenchWindow != null) { IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage(); if (activePage != null) { IEditorPart activeEditor = activePage.getActiveEditor(); if (activeEditor instanceof DDiagramEditorImpl) { ((DDiagramEditorImpl) <START> activeEditor).getDiagramEditPart().refresh(); <END> } } } } }); }</code><technical_language>careful this update figures contained in diagram. call refreshVisuals setting in public is necessary update Background color</technical_language>

Target:
public static void refreshBackground() { EclipseUIUtil.displayAsyncExec(new Runnable() { @Override public void run() { IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if (activeWorkbenchWindow != null) { IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage(); if (activePage != null) { IEditorPart activeEditor = activePage.getActiveEditor(); if (activeEditor instanceof DDiagramEditorImpl) { DiagramEditPart diagramEditPart = ((DDiagramEditorImpl) activeEditor).getDiagramEditPart(); ((DDiagramEditPart) diagramEditPart).configureBackground(diagramEditPart.getFigure()); } } } } }); }
Source:
<code>public DB2YearWeekFunction() { <START> super("CONCAT(YEAR(DATE_TRUNC('week', ?1)), '-', WEEK_ISO(?1))"); <END> }</code><technical_language>give <LINK_0> a shot</technical_language>

Target:
public DB2YearWeekFunction() { super("VARCHAR_FORMAT(?1, 'IYYY-IW')"); }
Source:
<code>public ObjectBinding<String> getFieldBinding(Field field) { if (field == InternalField.TYPE_HEADER || field == InternalField.OBSOLETE_TYPE_HEADER) { <START> return Bindings.createObjectBinding(() -> { <END> return type.getValue().getDisplayName(); }, type); } return Bindings.valueAt(fields, field); }</code><technical_language>Please EasyBind.map(type, Type::getDisplayName);</technical_language>

Target:
public ObjectBinding<String> getFieldBinding(Field field) { if ((field == InternalField.TYPE_HEADER) || (field == InternalField.OBSOLETE_TYPE_HEADER)) { return (ObjectBinding<String>) EasyBind.map(type, EntryType::getDisplayName); } return Bindings.valueAt(fields, field); }
Source:
<code>private Long appendWithOffset(long offset, boolean isControlRecord, long timestamp, ByteBuffer key, ByteBuffer value, Header[] headers) { try { if (isControlRecord != isControlBatch) throw new IllegalArgumentException("Control records can only be appended to control batches"); if (lastOffset != null && offset <= lastOffset) throw new IllegalArgumentException(String.format("Illegal offset %s following previous offset %s " + "(Offsets must increase monotonically).", offset, lastOffset)); if (timestamp < 0 && timestamp != RecordBatch.NO_TIMESTAMP) throw new IllegalArgumentException("Invalid negative timestamp " + timestamp); if (magic < RecordBatch.MAGIC_VALUE_V2 && headers != null && headers.length > 0) throw new IllegalArgumentException("Magic v" + magic + " does not support record headers"); if (firstTimestamp == null) { if (isDeleteHorizonSet()) { firstTimestamp = deleteHorizonMs; <START> } else { <END> firstTimestamp = timestamp; } } if (magic > RecordBatch.MAGIC_VALUE_V1) { appendDefaultRecord(offset, timestamp, key, value, headers); return null; } else { return appendLegacyRecord(offset, timestamp, key, value, magic); } } catch (IOException e) { throw new KafkaException("I/O exception when writing to the append stream, closing", e); } }</code><technical_language>need for for single line statement</technical_language>

Target:
private Long appendWithOffset(long offset, boolean isControlRecord, long timestamp, ByteBuffer key, ByteBuffer value, Header[] headers) { try { if (isControlRecord != isControlBatch) throw new IllegalArgumentException("Control records can only be appended to control batches"); if (lastOffset != null && offset <= lastOffset) throw new IllegalArgumentException(String.format("Illegal offset %s following previous offset %s " + "(Offsets must increase monotonically).", offset, lastOffset)); if (timestamp < 0 && timestamp != RecordBatch.NO_TIMESTAMP) throw new IllegalArgumentException("Invalid negative timestamp " + timestamp); if (magic < RecordBatch.MAGIC_VALUE_V2 && headers != null && headers.length > 0) throw new IllegalArgumentException("Magic v" + magic + " does not support record headers"); if (firstTimestamp == null) { if (deleteHorizonSet()) firstTimestamp = deleteHorizonMs; else firstTimestamp = timestamp; } if (magic > RecordBatch.MAGIC_VALUE_V1) { appendDefaultRecord(offset, timestamp, key, value, headers); return null; } else { return appendLegacyRecord(offset, timestamp, key, value, magic); } } catch (IOException e) { throw new KafkaException("I/O exception when writing to the append stream, closing", e); } }
Source:
<code>public wyvern.target.corewyvernIL.decl.Declaration generateDecl(GenContext ctx, GenContext thisContext) { String targetName = ((Variable)target).getName(); <START> wyvern.target.corewyvernIL.decl.DelegateDeclaration ILDelegateDecl = new wyvern.target.corewyvernIL.decl.DelegateDeclaration(type.getILType(ctx), targetName); <END> return ILDelegateDecl; }</code><technical_language>name this starting a lowercase variable? I starts IL is abbreviation, name differently conform Java convention</technical_language>

Target:
public wyvern.target.corewyvernIL.decl.Declaration generateDecl(GenContext ctx, GenContext thisContext) { String targetName = ((Variable)target).getName(); wyvern.target.corewyvernIL.decl.DelegateDeclaration iLDelegateDecl = new wyvern.target.corewyvernIL.decl.DelegateDeclaration(type.getILType(ctx), targetName); return iLDelegateDecl; }
Source:
<code>private void stopJobs() { ThingUID thingUID = getThing().getUID(); int jobsRemoved = 0; logger.debug("Stopping Scheduled Jobs for thing {}", thingUID); monitor.lock(); try { if (scheduledExecutor != null) { BlockingQueue<Runnable> queue = scheduledExecutor.getQueue(); int sizeBefore = queue.size(); queue.removeIf(this::isJobAssociatedWithThing); int sizeAfter = queue.size(); jobsRemoved = sizeBefore - sizeAfter; } logger.debug("Stopped Scheduled Jobs for thing {}", jobsRemoved, thingUID); } catch (final Exception ex) { <START> logger.error("{}", ex.getMessage(), ex); <END> } finally { monitor.unlock(); } }</code><technical_language>This needs PR #3603 merged</technical_language>

Target:
private void stopJobs() { ThingUID thingUID = getThing().getUID(); logger.debug("Stopping Scheduled Jobs for thing {}", thingUID); monitor.lock(); try { if (scheduledExecutor != null) { List<Job> jobsToRemove = scheduledJobs.stream().filter(this::isJobAssociatedWithThing) .collect(toList()); Consumer<Job> removalFromExecutor = scheduledExecutor::remove; Consumer<Job> removalFromQueue = scheduledJobs::remove; jobsToRemove.forEach(removalFromExecutor.andThen(removalFromQueue)); logger.debug("Stopped Scheduled Jobs for thing {}", jobsToRemove.size(), thingUID); } } catch (final Exception ex) { logger.error("{}", ex.getMessage(), ex); } finally { monitor.unlock(); } }
Source:
<code>public void destroyAll() throws CachePersistenceException { if (!inMaintenance) { throw new IllegalStateException("Maintenance mode required"); } LOGGER.info("destroyAll called for cluster tiers on {}", this.clusterUri); try { entityFactory.destroy(entityIdentifier); } catch (ClusterTierManagerNotFoundException e) { <START> throw new CachePersistenceException("cluster tiers on " + this.clusterUri + " not found", e); <END> } catch (EntityBusyException e) { throw new CachePersistenceException("Can not delete cluster tiers on " + this.clusterUri, e); } }</code><technical_language>capital letter</technical_language>

Target:
public void destroyAll() throws CachePersistenceException { if (!inMaintenance) { throw new IllegalStateException("Maintenance mode required"); } LOGGER.info("destroyAll called for cluster tiers on {}", this.clusterUri); try { entityFactory.destroy(entityIdentifier); } catch (ClusterTierManagerNotFoundException e) { throw new CachePersistenceException("Cluster tiers on " + this.clusterUri + " not found", e); } catch (EntityBusyException e) { throw new CachePersistenceException("Can not delete cluster tiers on " + this.clusterUri, e); } }
Source:
<code>public String getSemanticObjectLabel(Object object) { <START> final OpaqueElementBodyChange bodyChange = (OpaqueElementBodyChange)object; final EObject discriminant = bodyChange.getDiscriminant(); final ComposedStyledString text = new ComposedStyledString(); text.append(bodyChange.getLanguage()); text.append(" body of "); text.append(itemDelegator.getText(discriminant)); text.append(" "); text.append(getChangeKindLabel(bodyChange)); <END> return text.getString(); }</code><technical_language>common part of getSemanticObjectLabel getStyledText extracted method reused of other methods</technical_language>

Target:
public String getSemanticObjectLabel(Object object) { final OpaqueElementBodyChange bodyChange = (OpaqueElementBodyChange)object; final EObject discriminant = bodyChange.getDiscriminant(); return doGetSemanticObjectLabel(bodyChange, discriminant).getString(); }
Source:
<code>private String getAdvertisedHost() { <START> String host = System.getProperty(TcpSlaveAgentListener.class.getName()+".hostName"); <END> if(isBlank(host)) { try { host = new URL(Jenkins.get().getRootUrl()).getHost(); } catch (MalformedURLException | NullPointerException e) { throw new IllegalStateException("Could not get TcpSlaveAgentListener host name", e); } } return host; }</code><technical_language>suggestion try { return (String) TcpSlaveAgentListener.class.getMethod("getAdvertisedHost").invoke(Jenkins.get().getTcpSlaveAgentListener()); } catch (NoSuchMethodException x) { // 2.197-, fine } catch (Exception x) { LOGGER.log(Level.WARNING, null, x); } String host = System.getProperty(TcpSlaveAgentListener.class.getName()+".hostName");</technical_language>

Target:
private String getAdvertisedHost() { try { return (String) TcpSlaveAgentListener.class.getMethod("getAdvertisedHost").invoke(Jenkins.get().getTcpSlaveAgentListener()); } catch (NoSuchMethodException x) { } catch (Exception x) { LOGGER.log(Level.WARNING, null, x); } String host = System.getProperty(TcpSlaveAgentListener.class.getName()+".hostName"); if(StringUtils.isBlank(host)) { try { host = new URL(Jenkins.get().getRootUrl()).getHost(); } catch (MalformedURLException | NullPointerException e) { throw new IllegalStateException("Could not get TcpSlaveAgentListener host name", e); } } return host; }
Source:
<code>private void checkSynchronizationLevel(boolean isSynchronized) { <START> String synchronizationLabel; <END> if (isSynchronized) { dDiagram = (DDiagram) getRepresentationWithName(localSession.getOpenedSession(), REPRESENTATION_NAME, SYNCHRONIZED_REPRESENTATION_INSTANCE_NAME); assertEquals("The representation should be synchronized", true, dDiagram.isSynchronized()); } else if (!isSynchronized) { dDiagram = (DDiagram) getRepresentationWithName(localSession.getOpenedSession(), REPRESENTATION_NAME, UNSYNCHRONIZED_REPRESENTATION_INSTANCE_NAME); assertEquals("The representation should not be synchronized", false, dDiagram.isSynchronized()); } DiagramElementMapping diagramElementMapping = getMapping(); if (diagramElementMapping instanceof ContainerMapping) { ContainerMapping containerMapping = (ContainerMapping) diagramElementMapping; if (!isSynchronized) { synchronizationLabel = "Unsynchronizable"; assertFalse("The synchronization of the mapping should be '" + synchronizationLabel + "'", containerMapping.isSynchronizationLock()); } } }</code><technical_language>a org.eclipse.sirius.diagram.business.api.query.DiagramElementMappingQuery.isSynchronizedAndCreateElement(DDiagram) diagram mapping synchronization state</technical_language>

Target:
private void checkSynchronizationLevel(boolean isSynchronized) { if (isSynchronized) { dDiagram = (DDiagram) getRepresentationWithName(localSession.getOpenedSession(), REPRESENTATION_NAME, SYNCHRONIZED_REPRESENTATION_INSTANCE_NAME); } else if (!isSynchronized) { dDiagram = (DDiagram) getRepresentationWithName(localSession.getOpenedSession(), REPRESENTATION_NAME, UNSYNCHRONIZED_REPRESENTATION_INSTANCE_NAME); } String containerName = dDiagram.getContainers().get(0).getName(); ContainerMapping containerMapping = dDiagram.getContainers().get(0).getActualMapping(); DiagramElementMappingQuery mappingQuery = new DiagramElementMappingQuery(containerMapping); assertTrue("The mapping of '" + containerName + " element should be a ContainerMapping'", containerMapping instanceof ContainerMapping); if (isSynchronized) { assertTrue("Both 'DDiagram' and 'DiagramElementMapping' attributes of '" + containerName + "' container should be synchronized", mappingQuery.isSynchronizedAndCreateElement(dDiagram)); } else { assertFalse("Both 'DDiagram' and 'DiagramElementMapping' attributes of '" + containerName + "' container should be unsynchronized", mappingQuery.isSynchronizedAndCreateElement(dDiagram)); } }
Source:
<code>private void checkExpiredKeys(int startKey, int endKey) throws Exception { for (int i = startKey; i < endKey; i++) { sbetc.setCurrentKey(Integer.toString(i)); <START> assertTrue(ctx().isOriginalEmptyValue()); <END> } }</code><technical_language>suggestion assertTrue("Original state cleared", ctx().isOriginalEmptyValue());</technical_language>

Target:
private void checkExpiredKeys(int startKey, int endKey) throws Exception { for (int i = startKey; i < endKey; i++) { sbetc.setCurrentKey(Integer.toString(i)); assertTrue("Original state should be cleared", ctx().isOriginalEmptyValue()); } }
Source:
<code>private void getBlobAndCompareContent(String blobId) throws Exception { ByteBufferAsyncWritableChannel getChannel = new ByteBufferAsyncWritableChannel(); router.getBlob(blobId).get().readInto(getChannel, null); int readBytes = 0; do { ByteBuffer buf = getChannel.getNextChunk(); while (buf.hasRemaining()) { <START> Assert.assertEquals("Get and Put blob content should match", putContent[readBytes++], buf.get()); <END> } getChannel.resolveOldestChunk(null); } while (readBytes < putContent.length); }</code><technical_language>this throw IndexOutOfBoundsException if putContent runs out buf not. While argue is problem test fail eventually debug, I find more informative if test check index out of range fail a helpful message indicating root i.e unexpected "extra" data returned</technical_language>

Target:
private void getBlobAndCompareContent(String blobId) throws Exception { ByteBufferAsyncWritableChannel getChannel = new ByteBufferAsyncWritableChannel(); Future<Long> readIntoFuture = router.getBlob(blobId).get().readInto(getChannel, null); int readBytes = 0; do { ByteBuffer buf = getChannel.getNextChunk(); int bufLength = buf.remaining(); Assert.assertTrue("total content read should not be greater than length of put content", readBytes + bufLength <= putContent.length); while (buf.hasRemaining()) { Assert.assertEquals("Get and Put blob content should match", putContent[readBytes++], buf.get()); } getChannel.resolveOldestChunk(null); } while (readBytes < putContent.length); Assert.assertEquals("the returned length in the future should be the length of data written", (long) readBytes, (long) readIntoFuture.get()); Assert.assertNull("There should be no more data in the channel", getChannel.getNextChunk(0)); }
Source:
<code>private void createWindow(final long timestamp) { if (firstTimestamp == Long.MIN_VALUE) { firstTimestamp = timestamp; <START> long temporalWindowSize = emitPeriod; <END> while (temporalWindowSize < windowSize) { final Window<T> window = new WindowImpl<>(firstTimestamp, temporalWindowSize); windowQueue.add(window); temporalWindowSize += emitPeriod; } } final long relativeTimestamp = timestamp - firstTimestamp; while (windowCreationTime <= relativeTimestamp) { final Window<T> window = new WindowImpl<>(windowCreationTime + firstTimestamp, windowSize); windowQueue.add(window); windowCreationTime += emitPeriod; } }</code><technical_language>firstTimestamp + emitPeriod</technical_language>

Target:
private void createWindow(final long timestamp) { if (firstTimestamp == Long.MIN_VALUE) { firstTimestamp = timestamp; windowCreationTime = firstTimestamp; if (emitPeriod <= windowSize) { this.windowEmissionTime = firstTimestamp + emitPeriod; } else { this.windowEmissionTime = firstTimestamp + windowSize; } long temporalWindowSize = emitPeriod; while (temporalWindowSize < windowSize) { final Window<T> window = new WindowImpl<>(firstTimestamp, temporalWindowSize); windowQueue.add(window); temporalWindowSize += emitPeriod; } } while (windowCreationTime <= timestamp) { final Window<T> window = new WindowImpl<>(windowCreationTime, windowSize); windowQueue.add(window); windowCreationTime += emitPeriod; } }