auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public TestHueChannelTypeProvider() { try { ChannelType ctColor = new ChannelType(COLOR_CHANNEL_TYPE_UID, false, "Color", "colorLabel", "description", null, null, null, new URI("hue", "LCT001:color", null)); ChannelType ctColorTemperature = new ChannelType(COLOR_TEMP_CHANNEL_TYPE_UID, false, "Dimmer", "colorTemperatureLabel", "description", null, null, null, new URI("hue", "LCT001:color_temperature", null)); ChannelType ctColorX = new ChannelType(COLORX_CHANNEL_TYPE_UID, false, "Color", "colorLabel", "description", null, null, null, new URI("Xhue", "XLCT001:Xcolor", null)); ChannelType ctColorTemperatureX = new ChannelType(COLORX_TEMP_CHANNEL_TYPE_UID, false, "Dimmer", "colorTemperatureLabel", "description", null, null, null, new URI("Xhue", "XLCT001:Xcolor_temperature", null)); channelTypes = Arrays.asList(ctColor, ctColorTemperature, ctColorX, ctColorTemperatureX); ChannelGroupType groupX = ChannelGroupTypeBuilder.instance(GROUP_CHANNEL_GROUP_TYPE_UID, "Channel Group") <START> .isAdvanced(false).withDescription("Channel Group") <END> .withChannelDefinitions(Arrays.asList( new ChannelDefinition("foo", TestHueChannelTypeProvider.COLOR_CHANNEL_TYPE_UID), new ChannelDefinition("bar", TestHueChannelTypeProvider.COLOR_CHANNEL_TYPE_UID))) .build(); channelGroupTypes = Arrays.asList(groupX); } catch (Exception willNeverBeThrown) { } }</code><technical_language>isAdvanced(false) is default for ChannelGroupTypeBuilder. skip this one</technical_language>

Target:
public TestHueChannelTypeProvider() { try { ChannelType ctColor = new ChannelType(COLOR_CHANNEL_TYPE_UID, false, "Color", "colorLabel", "description", null, null, null, new URI("hue", "LCT001:color", null)); ChannelType ctColorTemperature = new ChannelType(COLOR_TEMP_CHANNEL_TYPE_UID, false, "Dimmer", "colorTemperatureLabel", "description", null, null, null, new URI("hue", "LCT001:color_temperature", null)); ChannelType ctColorX = new ChannelType(COLORX_CHANNEL_TYPE_UID, false, "Color", "colorLabel", "description", null, null, null, new URI("Xhue", "XLCT001:Xcolor", null)); ChannelType ctColorTemperatureX = new ChannelType(COLORX_TEMP_CHANNEL_TYPE_UID, false, "Dimmer", "colorTemperatureLabel", "description", null, null, null, new URI("Xhue", "XLCT001:Xcolor_temperature", null)); channelTypes = Arrays.asList(ctColor, ctColorTemperature, ctColorX, ctColorTemperatureX); ChannelGroupType groupX = ChannelGroupTypeBuilder.instance(GROUP_CHANNEL_GROUP_TYPE_UID, "Channel Group") .withDescription("Channel Group") .withChannelDefinitions(Arrays.asList( new ChannelDefinition("foo", TestHueChannelTypeProvider.COLOR_CHANNEL_TYPE_UID), new ChannelDefinition("bar", TestHueChannelTypeProvider.COLOR_CHANNEL_TYPE_UID))) .build(); channelGroupTypes = Arrays.asList(groupX); } catch (Exception willNeverBeThrown) { } }
Source:
<code>private List<IRecord> getChangeRecords(BrowserAction action) { String type = action.getType(); if (type.equals(ActionTypes.NEW)) { return create(action); } else if (type.equals(ActionTypes.SET)) { return set(action); } else if (type.equals(ActionTypes.REMOVE)) { return remove(action); } else { LOG.error("undefined action type received: " + type); <START> return new LinkedList<IRecord>(); <END> } }</code><technical_language><LINK_0></technical_language>

Target:
private List<IRecord> getChangeRecords(BrowserAction action) { String type = action.getType(); if (type.equals(RecordType.NEW.toString())) { return create(action); } else if (type.equals(RecordType.SET.toString())) { return set(action); } else if (type.equals(RecordType.REMOVE.toString())) { return remove(action); } else { LOG.error("undefined action type received: " + type); return Collections.emptyList(); } }
Source:
<code>private Map<String, String> updateHeaders(final Map<String, String> headers) { if (headers == null) { throw new IllegalArgumentException("headers"); <START> } <END> if (mRequestCorrelationId != null) { headers.put(AAD.CLIENT_REQUEST_ID, mRequestCorrelationId.toString()); } headers.put(AAD.ADAL_ID_PLATFORM, "Android"); headers.put(AAD.ADAL_ID_VERSION, AuthenticationContext.getVersionName()); headers.put(AAD.ADAL_ID_OS_VER, "" + Build.VERSION.SDK_INT); headers.put(AAD.ADAL_ID_DM, android.os.Build.MODEL); return headers; }</code><technical_language>changing contract here</technical_language>

Target:
private Map<String, String> updateHeaders(final Map<String, String> headers) { if (mRequestCorrelationId != null) { headers.put(AAD.CLIENT_REQUEST_ID, mRequestCorrelationId.toString()); } headers.put(AAD.ADAL_ID_PLATFORM, "Android"); headers.put(AAD.ADAL_ID_VERSION, AuthenticationContext.getVersionName()); headers.put(AAD.ADAL_ID_OS_VER, "" + Build.VERSION.SDK_INT); headers.put(AAD.ADAL_ID_DM, android.os.Build.MODEL); return headers; }
Source:
<code>public Collection<PackFile> gc() throws IOException, ParseException { final GcLog gcLog = background ? new GcLog(repo) : null; if (gcLog != null && !gcLog.lock(background)) { return Collections.emptyList(); } Callable<Collection<PackFile>> gcTask = () -> { try { Collection<PackFile> newPacks = doGc(); if (automatic && tooManyLooseObjects() && gcLog != null) { String message = JGitText.get().gcTooManyUnpruned; gcLog.write(message); gcLog.commit(); } return newPacks; } catch (IOException | ParseException e) { if (background) { if (gcLog == null) { return Collections.emptyList(); } try { gcLog.write(e.getMessage()); StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw)); gcLog.write(sw.toString()); gcLog.commit(); } catch (IOException e2) { e2.addSuppressed(e); LOG.error(e2.getMessage(), e2); } } else { throw new JGitInternalException(e.getMessage(), e); } } finally { if (gcLog != null) { gcLog.unlock(); } } return Collections.emptyList(); }; if (background) { executor.submit(gcTask); return Collections.emptyList(); } else { try { return gcTask.call(); <START> } catch (Exception e) { <END> throw new IOException(e); } } }</code><technical_language>catching generic Exceptions here</technical_language>

Target:
public Collection<PackFile> gc() throws IOException, ParseException { if (!background) { return doGc(); } final GcLog gcLog = new GcLog(repo); if (!gcLog.lock()) { return Collections.emptyList(); } Callable<Collection<PackFile>> gcTask = () -> { try { Collection<PackFile> newPacks = doGc(); if (automatic && tooManyLooseObjects()) { String message = JGitText.get().gcTooManyUnpruned; gcLog.write(message); gcLog.commit(); } return newPacks; } catch (IOException | ParseException e) { try { gcLog.write(e.getMessage()); StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw)); gcLog.write(sw.toString()); gcLog.commit(); } catch (IOException e2) { e2.addSuppressed(e); LOG.error(e2.getMessage(), e2); } } finally { gcLog.unlock(); } return Collections.emptyList(); }; executor.submit(gcTask); return Collections.emptyList(); }
Source:
<code>public CompletableFuture<Acknowledge> archiveExecutionGraph(AccessExecutionGraph executionGraph) { <START> final CompletableFuture<Acknowledge> ackFuture = new CompletableFuture<>(); ioExecutor.execute(() -> { try { FsJobArchivist.archiveJob(archivePath, executionGraph.getJobID(), jsonArchivist.archiveJsonWithPath(executionGraph)); ackFuture.complete(Acknowledge.get()); } catch (IOException e) { ackFuture.completeExceptionally(e); } }); return ackFuture; <END> }</code><technical_language>suggestion return CompletableFuture .runAsync( ThrowingRunnable.unchecked(() -> FsJobArchivist.archiveJob( archivePath, executionGraph.getJobID(), jsonArchivist.archiveJsonWithPath(executionGraph))), ioExecutor) .thenApply(ignored -> Acknowledge.get());</technical_language>

Target:
public CompletableFuture<Acknowledge> archiveExecutionGraph(AccessExecutionGraph executionGraph) { return CompletableFuture .runAsync( ThrowingRunnable.unchecked(() -> FsJobArchivist.archiveJob(archivePath, executionGraph.getJobID(), jsonArchivist.archiveJsonWithPath(executionGraph))), ioExecutor) .thenApply(ignored -> Acknowledge.get()); }
Source:
<code>protected boolean isInterestingFolder(IFolder folder) { <START> return !findProductFiles(folder, false).isEmpty(); <END> }</code><technical_language>Is this correct? deleting a product, I assume this reports parent interesting file delta</technical_language>

Target:
protected boolean isInterestingFolder(IFolder folder) { return true; }
Source:
<code>static void checkGetter(Method getter) { checkNotNull(getter); checkArgument(GETTER_PREFIX_PATTERN.matcher(getter.getName()) .find() && getter.getParameterTypes().length == 0, "Method `%s` is not a getter.", getter); checkArgument(getAnnotatedVersion(getter).isPresent(), <START> format("Entity column getter should be annotated with `%s`.", <END> Column.class.getName())); int modifiers = getter.getModifiers(); checkArgument(isPublic(modifiers) && !isStatic(modifiers), "Entity column getter should be public instance method."); Class<?> returnType = getter.getReturnType(); Class<?> wrapped = wrap(returnType); checkArgument(Serializable.class.isAssignableFrom(wrapped), format("Cannot create column of non-serializable type %s by method %s.", returnType, getter)); }</code><technical_language>Please remove redundant format, checkArgument is capable of string formatting own</technical_language>

Target:
static void checkGetter(Method getter) { checkNotNull(getter); checkArgument(GETTER_PREFIX_PATTERN.matcher(getter.getName()) .find() && getter.getParameterTypes().length == 0, "Method `%s` is not a getter.", getter); checkArgument(getAnnotatedVersion(getter).isPresent(), "Entity column getter should be annotated with `%s`.", Column.class.getName()); int modifiers = getter.getModifiers(); checkArgument(isPublic(modifiers) && !isStatic(modifiers), "Entity column getter should be public instance method."); Class<?> returnType = getter.getReturnType(); Class<?> wrapped = wrap(returnType); checkArgument(Serializable.class.isAssignableFrom(wrapped), "Cannot create column of non-serializable type %s by method %s.", returnType, getter); }
Source:
<code>public String getTimestamp() { <START> return timestamp; <END> }</code><technical_language>if StringUtils.defaultString() string methods</technical_language>

Target:
public String getTimestamp() { return StringUtils.defaultString(timestamp); }
Source:
<code>private int importAtlasMetadata(AtlasReplInfo atlasReplInfo) throws Exception { AtlasImportRequest importRequest = atlasRequestBuilder.createImportRequest(atlasReplInfo.getSrcDB(), atlasReplInfo.getTgtDB(), atlasRequestBuilder.getAtlasClusterName(atlasReplInfo.getSrcCluster()), atlasRequestBuilder.getAtlasClusterName(atlasReplInfo.getTgtCluster()), atlasReplInfo.getSrcFsUri(), atlasReplInfo.getTgtFsUri(), atlasReplInfo.getSrcCluster()); AtlasImportResult result = clientBuilder.getClient(atlasReplInfo.getAtlasEndpoint(), atlasReplInfo.getConf()) .importData(importRequest, atlasReplInfo); if (result == null || result.getProcessedEntities() == null) { <START> LOG.info("HiveAtlasPlugin: No entities found"); <END> return 0; } return result.getProcessedEntities().size(); }</code><technical_language>HiveAtlasPlugin tag is needed</technical_language>

Target:
private int importAtlasMetadata(AtlasReplInfo atlasReplInfo) throws Exception { AtlasRequestBuilder atlasRequestBuilder = new AtlasRequestBuilder(); AtlasImportRequest importRequest = atlasRequestBuilder.createImportRequest( atlasReplInfo.getSrcDB(), atlasReplInfo.getTgtDB(), atlasReplInfo.getSrcCluster(), atlasReplInfo.getTgtCluster(), atlasReplInfo.getSrcFsUri(), atlasReplInfo.getTgtFsUri()); AtlasImportResult result = new AtlasRestClientBuilder(atlasReplInfo.getAtlasEndpoint()) .getClient(atlasReplInfo.getConf()).importData(importRequest, atlasReplInfo); if (result == null || result.getProcessedEntities() == null) { LOG.info("No Atlas entity found"); return 0; } return result.getProcessedEntities().size(); }
Source:
<code>public void setUp(String testOutputDir, String... processNames) { mProcessNames = processNames; mTestOutputDir = testOutputDir; mDropCacheOption = 0; mUiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()); <START> mGarbageCollectionHelper.setUp(processNames); <END> }</code><technical_language>In current setup collecting rss for processes running in system. In case user supplied processNames null. dynamically query process PS -A.Can inititlaize initialize garbage collection helper in getMetrics() method query for process names</technical_language>

Target:
public void setUp(String testOutputDir, String... processNames) { mProcessNames = processNames; mTestOutputDir = testOutputDir; mDropCacheOption = 0; mUiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()); }
Source:
<code>@Override public boolean process(Set<? extends TypeElement> types, RoundEnvironment env) { try { <START> Set<InjectedClass> injectedClasses = new HashSet<InjectedClass>(); <END> injectedClasses.addAll(getInjectedClasses(env)); for (String e : delayedInjectedClassNames) { injectedClasses.add(getInjectedClass(processingEnv.getElementUtils().getTypeElement(e))); } for (InjectedClass injectedClass : injectedClasses) { String injectedClassName = injectedClass.type.toString(); boolean missingDependentClasses = !allTypesExist(injectedClass.fields) || (injectedClass.constructor != null && !allTypesExist(injectedClass.constructor .getParameters())) || !allTypesExist(injectedClass.staticFields); if (missingDependentClasses) { delayedInjectedClassNames.add(injectedClassName); } else { writeInjectionsForClass(injectedClass); delayedInjectedClassNames.remove(injectedClassName); } } } catch (IOException e) { error("Code gen failed: %s", e); } if (env.processingOver() && delayedInjectedClassNames.size() > 0) { error("Could not find injection type required by %s!", delayedInjectedClassNames.toString()); } return true; }</code><technical_language>HS --> LHS</technical_language>

Target:
@Override public boolean process(Set<? extends TypeElement> types, RoundEnvironment env) { try { remainingTypeNames.addAll(getInjectedClassNames(env)); for (Iterator<String> i = remainingTypeNames.iterator(); i.hasNext();) { InjectedClass injectedClass = getInjectedClass(i.next()); boolean missingDependentClasses = !allTypesExist(injectedClass.fields) || (injectedClass.constructor != null && !allTypesExist(injectedClass.constructor .getParameters())) || !allTypesExist(injectedClass.staticFields); if (!missingDependentClasses) { writeInjectionsForClass(injectedClass); i.remove(); } } } catch (IOException e) { error("Code gen failed: %s", e); } if (env.processingOver() && !remainingTypeNames.isEmpty()) { error("Could not find injection type required by %s!", remainingTypeNames); } return true; }
Source:
<code>public void setChannelSendOptions(String channelSendOptions) { int value = Channel.parseChannelSendOptions(channelSendOptions); <START> if (value > 0) <END> this.setChannelSendOptions(value); }</code><technical_language>Hi, code format point of view: curly braces is statement in "if", "for" blocks. Regards, Violeta</technical_language>

Target:
public void setChannelSendOptions(String channelSendOptions) { int value = Channel.parseSendOptions(channelSendOptions); if (value > 0) { this.setChannelSendOptions(value); } }
Source:
<code>public TaskDefinition getTaskByUuid(String uuid) { if (log.isDebugEnabled()) { <START> log.debug("get task " + uuid); <END> } return getSchedulerDAO().getTaskByUuid(uuid); }</code><technical_language>suggestion log.debug("get-task uuid:" + uuid);</technical_language>

Target:
public TaskDefinition getTaskByUuid(String uuid) { return getSchedulerDAO().getTaskByUuid(uuid); }
Source:
<code>private Map<String, Path> videoContentPaths(Map<String, Map<String, Path>> tmpContentPaths, ContentItem contentItem) { if (!isVideo(contentItem)) { return null; } final long contentItemSizeBytes; try { contentItemSizeBytes = contentItem.getSize(); } catch (IOException e) { <START> LOGGER.warn( <END> "Error retrieving size for ContentItem (id={}). Unable to create thumbnail for metacard (id={})", contentItem.getId(), contentItem.getMetacard().getId()); return null; } final long bytesPerMegabyte = 1024L * 1024L; final long maxFileSizeBytes = maxFileSizeMB * bytesPerMegabyte; if (contentItemSizeBytes > maxFileSizeBytes) { LOGGER.debug( "ContentItem (id={} size={} MB) is larger than the configured max file size to process ({} MB). Skipping creating thumbnail for metacard (id={})", contentItem.getId(), contentItemSizeBytes, maxFileSizeBytes, contentItem.getMetacard().getId()); return null; } Map<String, Path> contentPaths = tmpContentPaths.get(contentItem.getId()); if (contentPaths == null || contentPaths.isEmpty()) { LOGGER.warn( "No path for ContentItem (id={}). Unable to create thumbnail for metacard (id={})", contentItem.getId(), contentItem.getMetacard().getId()); return null; } return contentPaths; }</code><technical_language>I change of logging statements in this PR I warn logs warn level. This debug. other info debug</technical_language>

Target:
private Map<String, Path> videoContentPaths( Map<String, Map<String, Path>> tmpContentPaths, ContentItem contentItem) { if (!isVideo(contentItem)) { return null; } final long contentItemSizeBytes; try { contentItemSizeBytes = contentItem.getSize(); } catch (IOException e) { LOGGER.debug( "Error retrieving size for ContentItem (id={}). Unable to create thumbnail for metacard (id={})", contentItem.getId(), contentItem.getMetacard().getId()); return null; } final long bytesPerMegabyte = 1024L * 1024L; final long maxFileSizeBytes = maxFileSizeMB * bytesPerMegabyte; if (contentItemSizeBytes > maxFileSizeBytes) { LOGGER.debug( "ContentItem (id={} size={} MB) is larger than the configured max file size to process ({} MB). Skipping creating thumbnail for metacard (id={})", contentItem.getId(), contentItemSizeBytes, maxFileSizeBytes, contentItem.getMetacard().getId()); return null; } Map<String, Path> contentPaths = tmpContentPaths.get(contentItem.getId()); if (contentPaths == null || contentPaths.isEmpty()) { LOGGER.debug( "No path for ContentItem (id={}). Unable to create thumbnail for metacard (id={})", contentItem.getId(), contentItem.getMetacard().getId()); return null; } return contentPaths; }
Source:
<code>public DiscordRPCSubSystem() throws IllegalStateException { if (instance != null) { throw new IllegalStateException("More then one instance in the DiscordRPC"); } lastRichPresence = null; <START> ipcClient = new IPCClient(515274721080639504L); <END> ipcClient.setListener(this); logger = LoggerFactory.getLogger(DiscordRPCSubSystem.class); autoReconnect = true; reconnectThread = new Thread(this); reconnectThread.setName("DISCORD-RPC-RECONNECT"); reconnectThread.start(); instance = this; }</code><technical_language>good extract this a constant named is (the client id for Discord app)</technical_language>

Target:
public DiscordRPCSubSystem() throws IllegalStateException { if (instance != null) { throw new IllegalStateException("More then one instance in the DiscordRPC"); } lastRichPresence = null; ipcClient = new IPCClient(DISCORD_APP_CLIENT_ID); ipcClient.setListener(this); autoReconnect = true; reconnectThread = new Thread(this); reconnectThread.setName("DISCORD-RPC-RECONNECT"); reconnectThread.start(); instance = this; enabled = false; dontTryAgain = true; }
Source:
<code>protected void fillTitle(final ChangePasswordPageContent viewModel, final Void input, final Form<? extends ChangePasswordFormData> form) { <START> viewModel.setTitle(pageTitleResolver.getOrEmpty("my-account:changePassword.title")); END> }</code><technical_language>a translation for title in [my-account.yaml](<LINK_0>, called changePasswordTitle. rename title, for I suggest my-account:changePassword.changePasswordTitle here</technical_language>

Target:
protected void fillTitle(final ChangePasswordPageContent viewModel, final Void input, final Form<? extends ChangePasswordFormData> form) { viewModel.setTitle(pageTitleResolver.getOrEmpty("my-account:changePassword.changePasswordTitle")); }
Source:
<code>private void save() throws IOException, GeneralSecurityException { System.out.println("Write to temp file"); try (FileOutputStream fos = new FileOutputStream(tempFile)) { workingKeyStore.store(fos, STORE_PASSWORD); } System.out.println("Delete real file"); if (keystoreFile.exists()) { <START> if (keystoreFile.delete() == false) { <END> fail("Unable to delete KeyStore"); } } System.out.println("Rename temp to real"); if (tempFile.renameTo(keystoreFile) == false) { fail("Unable to rename temporary keystore to test keystore."); } }</code><technical_language>Files.delete(keystorefile.toPath()) give proper error</technical_language>

Target:
private void save() throws IOException, GeneralSecurityException { System.out.println("Write to temp file"); try (FileOutputStream fos = new FileOutputStream(tempFile)) { workingKeyStore.store(fos, STORE_PASSWORD); } System.out.println("Rename temp to real"); Files.move(tempFile.toPath(), keystoreFile.toPath(), StandardCopyOption.ATOMIC_MOVE, StandardCopyOption.REPLACE_EXISTING); }
Source:
<code>public DefaultCacheLoaderWriterConfigurationParser() { super(DefaultCacheLoaderWriterConfiguration.class, CacheTemplate::loaderWriter, (config, loader) -> new DefaultCacheLoaderWriterConfiguration((Class<? extends CacheLoaderWriter<?, ?>>) getClassForName(config, loader)), CacheType::getLoaderWriter, CacheType::setLoaderWriter, config -> { <START> if (config.getInstance() != null) { <END> throw new XmlConfigurationException("XML translation when instance is provided is not supported"); } return new CacheLoaderWriterType().withClazz(config.getClazz().getName()); }); }</code><technical_language>I agree @albinsuresh a checkNoConcreteInstance util method</technical_language>

Target:
public DefaultCacheLoaderWriterConfigurationParser() { super(DefaultCacheLoaderWriterConfiguration.class, CacheTemplate::loaderWriter, (config, loader) -> new DefaultCacheLoaderWriterConfiguration((Class<? extends CacheLoaderWriter<?, ?>>) getClassForName(config, loader)), CacheType::getLoaderWriter, CacheType::setLoaderWriter, config -> { checkNoConcreteInstance(config); return new CacheLoaderWriterType().withClazz(config.getClazz().getName()); }); }
Source:
<code>public void testUpdateStmtBuilder() { printStatement("update foo set \"column['looks_like_nested']\"=1"); printStatement("update foo set foo.a='b'"); printStatement("update bar.foo set bar.foo.t=3"); printStatement("update foo set col['x'] = 3"); printStatement("update foo set col['x'] = 3 where foo['x'] = 2"); printStatement("update schemah.foo set foo.a='b', foo.b=foo.a"); printStatement("update schemah.foo set foo.a=abs(-6.3334), x=true where x=false"); printStatement("update foo set foo='a' returning id"); printStatement("update foo set foo='a' where x=false returning id"); printStatement("update foo set foo='a' returning id AS foo"); printStatement("update foo set foo='a' returning id + 1 AS foo, id -1 as bar"); <START> } <END></code><technical_language>separate test cases for returning clause</technical_language>

Target:
public void testUpdateStmtBuilder() { printStatement("update foo set \"column['looks_like_nested']\"=1"); printStatement("update foo set foo.a='b'"); printStatement("update bar.foo set bar.foo.t=3"); printStatement("update foo set col['x'] = 3"); printStatement("update foo set col['x'] = 3 where foo['x'] = 2"); printStatement("update schemah.foo set foo.a='b', foo.b=foo.a"); printStatement("update schemah.foo set foo.a=abs(-6.3334), x=true where x=false"); }
Source:
<code>private static void parseOsStanza(ClientInfo.Builder builder, String stanza) { String[] components = null; if (stanza.matches(OLD_OS_FORMAT_REGEXP)) { components = new String[] { stanza.substring(0, stanza.lastIndexOf(" ")), stanza.substring(stanza.lastIndexOf(" ")), }; } else { components = stanza.split("/"); } if (components.length == 2) { builder.withOsName(parseString(components[0])); <START> builder.withOsVersion(parseString(components[1])).build(); <END> } else if (components.length == 1) { if (components[0].trim().matches(SEMANTIC_VERSION_REGEXP)) { builder.withOsVersion(parseString(components[0])); } else { builder.withOsName(parseString(components[0])); } } }</code><technical_language>Stray .build()</technical_language>

Target:
private static void parseOsStanza(ClientInfo.Builder builder, String stanza) { String[] components = null; if (stanza.matches(OLD_OS_FORMAT_REGEXP)) { components = new String[] { stanza.substring(0, stanza.lastIndexOf(" ")), stanza.substring(stanza.lastIndexOf(" ")), }; } else { components = stanza.split("/"); } if (components.length == 2) { builder.withOsName(parseString(components[0])); builder.withOsVersion(parseString(components[1])); } else if (components.length == 1) { if (components[0].trim().matches(SEMANTIC_VERSION_REGEXP)) { builder.withOsVersion(parseString(components[0])); } else { builder.withOsName(parseString(components[0])); } } }
Source:
<code>private static boolean canAssignFrom(RelDataType type1, RelDataType type2, RelDataTypeFactory typeFactory) { final SqlTypeName name1 = type1.getSqlTypeName(); final SqlTypeName name2 = type2.getSqlTypeName(); if (name1.getFamily() == name2.getFamily()) { switch (name1.getFamily()) { case NUMERIC: if (SqlTypeUtil.isExactNumeric(type1) && SqlTypeUtil.isExactNumeric(type2)) { int precision1; int scale1; if (name1 == SqlTypeName.DECIMAL) { <START> precision1 = type1.getPrecision(); <END> scale1 = type1.getScale(); } else { precision1 = typeFactory.getTypeSystem().getMaxPrecision(name1); scale1 = typeFactory.getTypeSystem().getMaxScale(name1); } int precision2; int scale2; if (name2 == SqlTypeName.DECIMAL) { precision2 = type2.getPrecision(); scale2 = type2.getScale(); } else { precision2 = typeFactory.getTypeSystem().getMaxPrecision(name2); scale2 = typeFactory.getTypeSystem().getMaxScale(name2); } return precision1 >= precision2 && scale1 >= scale2; } else if (SqlTypeUtil.isApproximateNumeric(type1) && SqlTypeUtil.isApproximateNumeric(type2)) { return type1.getPrecision() >= type2.getPrecision() && type1.getScale() >= type2.getScale(); } break; default: return type1.getPrecision() >= type2.getPrecision(); } } return false; }</code><technical_language>Do need consider JavaType, returns invalid precision scale. is specially handled in places, e.g., RelDataTypeSystem#deriveDecimalPlusType/deriveDecimalMultiplyType...</technical_language>

Target:
private static boolean canAssignFrom(RelDataType type1, RelDataType type2, RelDataTypeFactory typeFactory) { final SqlTypeName name1 = type1.getSqlTypeName(); final SqlTypeName name2 = type2.getSqlTypeName(); if (name1.getFamily() == name2.getFamily()) { switch (name1.getFamily()) { case NUMERIC: if (SqlTypeUtil.isExactNumeric(type1) && SqlTypeUtil.isExactNumeric(type2)) { int precision1; int scale1; if (name1 == SqlTypeName.DECIMAL) { type1 = typeFactory.decimalOf(type1); precision1 = type1.getPrecision(); scale1 = type1.getScale(); } else { precision1 = typeFactory.getTypeSystem().getMaxPrecision(name1); scale1 = typeFactory.getTypeSystem().getMaxScale(name1); } int precision2; int scale2; if (name2 == SqlTypeName.DECIMAL) { type2 = typeFactory.decimalOf(type2); precision2 = type2.getPrecision(); scale2 = type2.getScale(); } else { precision2 = typeFactory.getTypeSystem().getMaxPrecision(name2); scale2 = typeFactory.getTypeSystem().getMaxScale(name2); } return precision1 >= precision2 && scale1 >= scale2; } else if (SqlTypeUtil.isApproximateNumeric(type1) && SqlTypeUtil.isApproximateNumeric(type2)) { return type1.getPrecision() >= type2.getPrecision() && type1.getScale() >= type2.getScale(); } break; default: return type1.getPrecision() >= type2.getPrecision(); } } return false; }
Source:
<code>public ScriptEntryData getScriptEntryData() { return new BukkitScriptEntryData( hitBy.isPlayer() ? hitBy.getDenizenPlayer() : (entity.isPlayer() ? entity.getDenizenPlayer() : null), <START> <END> hitBy.isCitizensNPC() ? hitBy.getDenizenNPC() : (entity.isCitizensNPC() ? entity.getDenizenNPC() : null) ); }</code><technical_language>Stray doublenewline ^ newlines individual parts confused this formatted EntityDamaged event, I is referencing anyway? java return new BukkitScriptEntryData(damager != null && damager.isPlayer() ? damager.getDenizenPlayer() : entity.isPlayer() ? entity.getDenizenPlayer() : null, damager != null && damager.isCitizensNPC() ? damager.getDenizenNPC() : entity.isCitizensNPC() ? entity.getDenizenNPC() : null);</technical_language>

Target:
public ScriptEntryData getScriptEntryData() { return new BukkitScriptEntryData( hitBy.isPlayer() ? hitBy.getDenizenPlayer() : entity.isPlayer() ? entity.getDenizenPlayer() : null, hitBy.isCitizensNPC() ? hitBy.getDenizenNPC() : entity.isCitizensNPC() ? entity.getDenizenNPC() : null); }
Source:
<code>public String commitMessage(GitRepositoryManager repoManager, Provider<ReviewDb> db) { if (commitMessage == null) { try { <START> PatchSet.Id psId = change.currentPatchSetId(); <END> String sha1 = db.get().patchSets().get(psId).getRevision().get(); Project.NameKey name = change.getProject(); Repository repo = repoManager.openRepository(name); RevWalk walk = new RevWalk(repo); RevCommit c = walk.parseCommit(ObjectId.fromString(sha1)); commitMessage = c.getFullMessage(); walk.release(); } catch (RepositoryNotFoundException e) { } catch (IOException e) { } catch (OrmException e) { } } return commitMessage; }</code><technical_language>change(db) ensure Change object loaded null</technical_language>

Target:
public String commitMessage(GitRepositoryManager repoManager, Provider<ReviewDb> db) { if (commitMessage == null) { try { PatchSet.Id psId = change(db).currentPatchSetId(); String sha1 = db.get().patchSets().get(psId).getRevision().get(); Project.NameKey name = change.getProject(); Repository repo = repoManager.openRepository(name); RevWalk walk = new RevWalk(repo); try { RevCommit c = walk.parseCommit(ObjectId.fromString(sha1)); commitMessage = c.getFullMessage(); } finally { walk.release(); } } catch (RepositoryNotFoundException e) { log.error("Problem opening change repository", e); } catch (IOException e) { log.error("Problem finding commit message", e); } catch (OrmException e) { log.error("Problem requesting sha1 from database", e); } } return commitMessage; }
Source:
<code>private Map<String, String> getStringStringMap(final File sampleMapFile, final String inputFieldName) { final Map<String, String> sampleMap = new HashMap<>(); final TabbedInputParser parser = new TabbedInputParser(false, sampleMapFile); for (final String[] strings : parser) { if (strings.length != 2) { throw new IllegalArgumentException("Each line of the " + inputFieldName + " must have exactly two strings separated by a tab. " + "Found: " + Arrays.toString(strings) + <START> "] right before [" + parser.getCurrentLine() + "], in " + sampleMapFile.getAbsolutePath()); <END> } if (sampleMap.containsKey(strings[0])) { throw new IllegalArgumentException("Strings in first column of the " + inputFieldName + " must be unique. found [" + strings[0] + "] twice. Right before [" + parser.getCurrentLine() + "] in " + sampleMapFile.getAbsolutePath()); } sampleMap.put(strings[0], strings[1]); } return sampleMap; }</code><technical_language>unbalanced closing ] start of string</technical_language>

Target:
private Map<String, String> getStringStringMap(final File sampleMapFile, final String inputFieldName) { final Map<String, String> sampleMap = new HashMap<>(); final TabbedInputParser parser = new TabbedInputParser(false, sampleMapFile); for (final String[] strings : parser) { if (strings.length != 2) { throw new IllegalArgumentException("Each line of the " + inputFieldName + " must have exactly two strings separated by a tab. " + "Found: [" + Arrays.toString(strings) + "] right before [" + parser.getCurrentLine() + "], in " + sampleMapFile.getAbsolutePath()); } if (sampleMap.containsKey(strings[0])) { throw new IllegalArgumentException("Strings in first column of the " + inputFieldName + " must be unique. found [" + strings[0] + "] twice. Right before [" + parser.getCurrentLine() + "] in " + sampleMapFile.getAbsolutePath()); } sampleMap.put(strings[0], strings[1]); } return sampleMap; }
Source:
<code><START> protected void validateBillingPeriodDateRange(ContractsGrantsInvoiceDocument contractsGrantsInvoiceDocument, List<String> warningMessages) throws ParseException { <END> Pair<Date, Date> billingPeriodDates = parseDateRange(contractsGrantsInvoiceDocument.getInvoiceGeneralDetail().getBillingPeriod()); validateBillingPeriodDateRangeAgainstLastBilledDate(contractsGrantsInvoiceDocument, billingPeriodDates, warningMessages); validateBillingPeriodDateRangeStartBeforeEnd(contractsGrantsInvoiceDocument, billingPeriodDates, warningMessages); validateBillingPeriodStartDateAgainstAwardDate(contractsGrantsInvoiceDocument, billingPeriodDates.getLeft(), warningMessages); }</code><technical_language>code duplication a minimum while keeping method length reasonable, I suggest code date validation methods combining this "validateBillingPeriodDateRange" method. way, repeating variable initialization for start/end dates service references</technical_language>

Target:
protected void validateBillingPeriodDateRange(ContractsGrantsInvoiceDocument contractsGrantsInvoiceDocument, List<String> warningMessages) throws ParseException { Pair<Date, Date> billingPeriodDates = parseDateRange(contractsGrantsInvoiceDocument.getInvoiceGeneralDetail().getBillingPeriod()); DateTimeService dateTimeService = SpringContext.getBean(DateTimeService.class); ConfigurationService configurationService = SpringContext.getBean(ConfigurationService.class); Date billingPeriodStartDate = billingPeriodDates.getLeft(); Date billingPeriodEndDate = billingPeriodDates.getRight(); if (dateTimeService.dateDiff(billingPeriodEndDate, billingPeriodStartDate, false) >= 1) { warningMessages.add(configurationService.getPropertyValueAsString(CUKFSKeyConstants.WARNING_CINV_BILLING_PERIOD_END_DATE_BEFORE_BILLING_PERIOD_START_DATE)); } Date lastBilledDate = contractsGrantsInvoiceDocument.getInvoiceGeneralDetail().getLastBilledDate(); if (dateTimeService.dateDiff(billingPeriodEndDate, lastBilledDate, false) >= 1) { warningMessages.add(configurationService.getPropertyValueAsString(CUKFSKeyConstants.WARNING_CINV_BILLING_PERIOD_END_DATE_BEFORE_LAST_BILLED_DATE)); } if (dateTimeService.dateDiff(billingPeriodStartDate, lastBilledDate, false) >= 1) { warningMessages.add(configurationService.getPropertyValueAsString(CUKFSKeyConstants.WARNING_CINV_BILLING_PERIOD_START_DATE_BEFORE_LAST_BILLED_DATE)); } Pair<Date, Date> awardDateRange = parseDateRange(contractsGrantsInvoiceDocument.getInvoiceGeneralDetail().getAwardDateRange()); if (dateTimeService.dateDiff(billingPeriodStartDate, awardDateRange.getLeft(), false) >= 1) { warningMessages.add(configurationService.getPropertyValueAsString(CUKFSKeyConstants.WARNING_CINV_BILLING_PERIOD_START_DATE_BEFORE_AWARD_START_DATE)); } }
Source:
<code>private void performPrimaryAction() { switch (getPrimaryAction()) { case PUBLISH_NOW: case UPDATE: case SCHEDULE: <START> case SUBMIT_FOR_REVIEW: <END> mAnalyticsTrackerWrapper.track(Stat.EDITOR_POST_PUBLISH_TAPPED); showPrepublishingNudgeBottomSheet(); return; case SAVE: uploadPost(false); break; } }</code><technical_language>I asked this already, I forgot explanation, sorry. Is track EDITOR_POST_PUBLISH_TAPPED for actions (not "publish")</technical_language>

Target:
private void performPrimaryAction() { switch (getPrimaryAction()) { case PUBLISH_NOW: mAnalyticsTrackerWrapper.track(Stat.EDITOR_POST_PUBLISH_TAPPED); showPrepublishingNudgeBottomSheet(); return; case UPDATE: case SCHEDULE: case SUBMIT_FOR_REVIEW: showPrepublishingNudgeBottomSheet(); return; case SAVE: uploadPost(false); break; } }
Source:
<code>private Map<String, Object> pojoToMap(Object input, int streamIndex) { Map<String, Object> map = new HashMap<>(); List<KeyValPair<String,PojoUtils.Getter>> gettersStream; if (streamIndex == 1) { gettersStream = gettersStream1; } else { gettersStream = gettersStream2; <START> } <END> for (KeyValPair<String,PojoUtils.Getter> getter : gettersStream) { try { Object value = getter.getValue().get(input); map.put(getter.getKey(), value); } catch (Exception e) { throw Throwables.propagate(e); } } return map; }</code><technical_language>done in conditional List<KeyValPair<String,PojoUtils.Getter>> gettersStream = streamIndex == 1? gettersStream1 : getterStream2;</technical_language>

Target:
private Map<String, Object> pojoToMap(Object input, int streamIndex) { Map<String, Object> map = new HashMap<>(); List<KeyValPair<String,PojoUtils.Getter>> gettersStream = streamIndex == 1 ? gettersStream1 : gettersStream2; for (KeyValPair<String,PojoUtils.Getter> getter : gettersStream) { try { Object value = getter.getValue().get(input); map.put(getter.getKey(), value); } catch (Exception e) { throw Throwables.propagate(e); } } return map; }
Source:
<code>public byte[] getResultsByID(String asyncQueryID) { log.debug("getAsyncResultsByID"); AsyncQuery asyncQuery = null; byte[] byteResult = null; try { <START> asyncQuery = (AsyncQuery) DBUtil.executeInTransaction(elideSettings, <END> dataStore, (tx, scope) -> { EntityProjection asyncQueryCollection = EntityProjection.builder() .type(AsyncQuery.class) .build(); Object loaded = tx.loadObject(asyncQueryCollection, asyncQueryID, scope); return loaded; }); if (asyncQuery != null && asyncQuery.getResult().getAttachment() != null) { Blob result = asyncQuery.getResult().getAttachment(); byteResult = result.getBytes(1, (int) result.length()); } } catch (SQLException e) { log.error("Exception: {}", e); throw new IllegalStateException(e); } return byteResult; }</code><technical_language>Instead of DBUtil, this DefaultAysyncQueryDAO - load object method there</technical_language>

Target:
public Observable<String> getResultsByID(String asyncQueryID) { log.debug("getAsyncResultsByID"); Optional<AsyncQuery> asyncQuery = null; Observable<String> observableResult = Observable.empty(); PathElement idPathElement = new PathElement(AsyncQuery.class, String.class, "id"); List<String> idList = Collections.singletonList(asyncQueryID); FilterExpression fltStatusExpression = new InPredicate(idPathElement, idList); Collection<AsyncQuery> asyncQueryCollection = defaultAsyncQueryDAO.loadAsyncQueryCollection(fltStatusExpression); if (asyncQueryCollection != null && asyncQueryCollection.size() > 0) { asyncQuery = asyncQueryCollection.stream().findAny(); AsyncQueryResult queryResult = asyncQuery.get().getResult(); if (queryResult != null && queryResult.getAttachment() != null) { observableResult = Observable.fromArray(queryResult.getAttachment().split(NEW_LINE_REGEX)); } } return observableResult; }
Source:
<code><START> int getZoneId() { <END> int zoneValue = -1; String value = dataMap.get(ZONE_ID); if (value != null) { zoneValue = Integer.parseInt(value); } return zoneValue; }</code><technical_language>ZoneIdentifierInfo is a private class this point is debatable, codacy suggests accessor methods of ZoneIdentifierInfo private</technical_language>

Target:
private int getZoneId() { int zoneValue = -1; String value = properties.getProperty(ZONE_ID); if (value != null) { zoneValue = Integer.parseInt(value); } return zoneValue; }
Source:
<code>public static void main(String[] args) { long maxMem = Runtime.getRuntime().maxMemory(); Object[] holder = new Object[(int)maxMem / 16]; int count = 0; try { while (true) { holder[count++] = <START> new byte[7000]; <END> } } catch (OutOfMemoryError e) for (int i = 0; i < count; ++i) { holder[i] = null; } holder[0] = new Object[(int)maxMem / 8]; }</code><technical_language>object array accidentally LOS for (though size is current LOS threshold)</technical_language>

Target:
public static void main(String[] args) { long maxMem = Runtime.getRuntime().maxMemory(); Object[] holder = new Object[(int)maxMem / 16]; int count = 0; try { while (true) { holder[count++] = new Object[1025]; } } catch (OutOfMemoryError e) for (int i = 0; i < count; ++i) { holder[i] = null; } holder[0] = new Object[(int)maxMem / 8]; }
Source:
<code>public static void skipFully(final InputStream fd, long toSkip) throws IOException { while (toSkip > 0) { final long r = fd.skip(toSkip); if (r <= 0) <START> throw new EOFException(JGitText.get().shortReadOfBlock); <END> toSkip -= r; } }</code><technical_language>shortSkipOfBlock</technical_language>

Target:
public static void skipFully(final InputStream fd, long toSkip) throws IOException { while (toSkip > 0) { final long r = fd.skip(toSkip); if (r <= 0) throw new EOFException(JGitText.get().shortSkipOfBlock); toSkip -= r; } }
Source:
<code>public void testBasicCopy() throws Throwable { describe("Checks whether S3A FS supports native copy" + " and copies a file from one location to another." + " File deletion taken care in teardown."); assertPathExists(srcFile + " does not exist", srcFile); fs.delete(dstFile, false); fs.copyFile(srcFile.toUri(), dstFile.toUri()); <START> assertIsFile(dstFile); <END> }</code><technical_language>need * verify data * assert source file is stil</technical_language>

Target:
public void testBasicCopy() throws Throwable { describe("Checks whether S3A FS supports native copy" + " and copies a file from one location to another." + " File deletion taken care in teardown."); assertPathExists(srcFile + " does not exist", srcFile); fs.delete(dstFile, false); fs.copyFile(srcFile.toUri(), dstFile.toUri()).get(); assertIsFile(srcFile); assertIsFile(dstFile); verifyFileContents(fs, dstFile, srcData); }
Source:
<code>AbstractLock addAGrantedLock(String user, LockingMode which, StreamManagement streamManagement, ImmutableReadFileManagement immutableReadFileManagement, GrantedAccess rights) { Collection<AbstractLock> locksForUser = locks.get(user); <START> if (locksForUser == null) { <END> locksForUser = new LinkedList<>(); locks.put(user, locksForUser); } AbstractLock lock; if (Objects.nonNull(rights) && which.equals(LockingMode.UPGRADE_WRITE_ONCE) && rights.getLock(uri) instanceof UpgradeableReadLock) { lock = rights.getLock(uri); ((UpgradeableReadLock) lock).upgradeForAOneTimeWrite(); } else { lock = AbstractLock.createLock(uri, which, user, streamManagement, immutableReadFileManagement); } locksForUser.add(lock); return lock; }</code><technical_language>Map.computeIfAbsent method replace code this: List<String> list = map.get(key); if (list == null) { list = new ArrayList<>(); map.put(key, list); }</technical_language>

Target:
AbstractLock addAGrantedLock(String user, LockingMode which, StreamManagement streamManagement, ImmutableReadFileManagement immutableReadFileManagement, GrantedAccess rights) { locks.computeIfAbsent(user, create -> new LinkedList<>()); Collection<AbstractLock> locksForUser = locks.get(user); AbstractLock lock; if (Objects.nonNull(rights) && which.equals(LockingMode.UPGRADE_WRITE_ONCE) && rights.getLock(uri) instanceof UpgradeableReadLock) { lock = rights.getLock(uri); ((UpgradeableReadLock) lock).upgradeForAOneTimeWrite(); } else { lock = AbstractLock.createLock(uri, which, user, streamManagement, immutableReadFileManagement); } locksForUser.add(lock); return lock; }
Source:
<code>public void getParameterName_NoAnnotations() throws NoSuchMethodException { <START> String actualResult = getParameterNameWithMethodNameAndParamIndex(TEST_METHOD_10, FIRST_INDEX); <END> assertEquals(NAME, actualResult); }</code><technical_language>Abbreviation for variable name: Result -> res. abbreviation rules</technical_language>

Target:
public void getParameterName_NoAnnotations() throws NoSuchMethodException { String actualRes = getParameterNameWithMethodNameAndParamIndex(TEST_METHOD_10, FIRST_INDEX); assertEquals(NAME, actualRes); }
Source:
<code>TaskData getTaskData(AbstractRepositoryConnector connector, IProgressMonitor monitor) throws CoreException { if (taskId != null) { try { return connector.getTaskData(repository, taskId, monitor); <START> } catch (Exception e) { <END> TaskData taskData = getTaskDataByKey(connector, monitor); if (taskData != null) { return taskData; } else { throw e; } } } else { return getTaskDataByKey(connector, monitor); } }</code><technical_language>Do need catch Exception catch CoreException</technical_language>

Target:
TaskData getTaskData(AbstractRepositoryConnector connector, IProgressMonitor monitor) throws CoreException { if (taskId != null) { return connector.getTaskData(repository, taskId, monitor); } else if (taskKey != null && connector.supportsSearchByTaskKey(repository)) { TaskData searchTaskData = connector.searchByTaskKey(repository, taskKey, monitor); if (searchTaskData.isPartial()) { return connector.getTaskData(repository, searchTaskData.getTaskId(), monitor); } else { return searchTaskData; } } return null; }
Source:
<code>@Override public void implementNotNullAdd(AggContext info, AggAddContext add) { Expression acc = add.accumulator().get(0); Expression arg = add.arguments().get(0); SqlAggFunction aggregation = info.aggregation(); final Method method = (aggregation == BIT_AND ? BuiltInMethod.BIT_AND <START> : (aggregation == BIT_OR <END> ? BuiltInMethod.BIT_OR : BuiltInMethod.BIT_XOR)).method; Expression next = Expressions.call( method.getDeclaringClass(), method.getName(), acc, Expressions.unbox(arg)); accAdvance(add, acc, next); }</code><technical_language>nice if this is simplified :)</technical_language>

Target:
@Override public void implementNotNullAdd(AggContext info, AggAddContext add) { Expression acc = add.accumulator().get(0); Expression arg = add.arguments().get(0); SqlAggFunction aggregation = info.aggregation(); final BuiltInMethod builtInMethod; switch (aggregation.kind) { case BIT_AND: builtInMethod = BuiltInMethod.BIT_AND; break; case BIT_OR: builtInMethod = BuiltInMethod.BIT_OR; break; case BIT_XOR: builtInMethod = BuiltInMethod.BIT_XOR; break; default: throw new IllegalArgumentException("Unknown " + aggregation.getName() + ". Only support bit_and, bit_or and bit_xor for bit aggregation function"); } final Method method = builtInMethod.method; Expression next = Expressions.call( method.getDeclaringClass(), method.getName(), acc, Expressions.unbox(arg)); accAdvance(add, acc, next); }
Source:
<code>public final void stop() { List<Runnable> pending = null; synchronized (this) { if (running.compareAndSet(true, false)) { LOGGER.info("Stopping DTLS connector on [{}]", lastBindAddress); receiver.interrupt(); if (socket != null) { socket.close(); socket = null; <START> } <END> maximumTransmissionUnit = 0; if (externalExecutor == null) { pending = executor.shutdownNow(); executor = null; } if (externalExecutor != timer) { timer.shutdownNow(); timer = null; } } } if (pending != null) { for (Runnable job : pending) { job.run(); } } }</code><technical_language>add this received.interrupt</technical_language>

Target:
public final void stop() { ExecutorService shutdown = null; List<Runnable> pending = null; synchronized (this) { if (running.compareAndSet(true, false)) { LOGGER.info("Stopping DTLS connector on [{}]", lastBindAddress); receiver.interrupt(); if (socket != null) { socket.close(); socket = null; } maximumTransmissionUnit = 0; if (externalExecutor == null) { pending = executor.shutdownNow(); shutdown = executor; executor = null; } if (externalExecutor != timer) { timer.shutdownNow(); timer = null; } } } if (shutdown != null) { try { if (!shutdown.awaitTermination(500, TimeUnit.MILLISECONDS)) { LOGGER.warn("Shutdown DTLS connector on not terminated in time!", lastBindAddress); } } catch (InterruptedException e) { } } if (pending != null) { for (Runnable job : pending) { job.run(); } } }
Source:
<code>public void onEntityCollidedWithBlock(IAlchemyArray array, World world, BlockPos pos, IBlockState state, Entity entity) { double motionY = 1; double motionYGlowstoneMod = 0.1; double motionYFeatherMod = 0.05; entity.fallDistance = 0; TileAlchemyArray tileArray = (TileAlchemyArray) array; <START> entity.motionY = motionY + motionYGlowstoneMod * (tileArray.getStackInSlot(0).getCount() - 1) + motionYFeatherMod * (tileArray.getStackInSlot(1).getCount() - 1); <END> }</code><technical_language>This line is a bit long, do math another line in movement array</technical_language>

Target:
public void onEntityCollidedWithBlock(IAlchemyArray array, World world, BlockPos pos, IBlockState state, Entity entity) { double motionY = 1; double motionYGlowstoneMod = 0.1; double motionYFeatherMod = 0.05; entity.fallDistance = 0; TileAlchemyArray tileArray = (TileAlchemyArray) array; motionY += motionYGlowstoneMod * (tileArray.getStackInSlot(0).getCount() - 1); motionY += motionYFeatherMod * (tileArray.getStackInSlot(1).getCount() - 1); entity.motionY = motionY; }