auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public DeleteUserResponse deleteUser(DeleteUserRequest input) { LOG.finer("Entering deleteUser"); DeleteUserResponse output = new DeleteUserResponse(); try { if (input == null) throw new InputValidationException(ApiError.InvalidValueNull.getCode(), ApiError.InvalidValueNull.getMessage("DeleteUserRequest: input")); input.accessCode = ValidationHelper.validateAccessCode(input.accessCode, "input.accessCode"); output.session = input.session = ValidationHelper.validateAndExtendSession(input.session, "input.session"); input.user = ValidationHelper.validateExistingUser(input.user, "input.user"); <START> Pager pager = new Pager(); <END> pager.start = 0L; pager.count = Long.MAX_VALUE; List<DataAccount> linkedAccounts = new ArrayList<DataAccount>(); linkedAccounts = UserServiceProvider.provide().getDataAccounts(input.user, pager); for (DataAccount la : linkedAccounts) { if (input.user.id.longValue() == UserServiceProvider.provide().getDataAccountOwner(la).id) { la.active = "n"; DataAccountServiceProvider.provide().updateDataAccount(la); } } UserServiceProvider.provide().deleteAllDataAccounts(input.user); UserServiceProvider.provide().revokeAllPermissions(input.user); UserServiceProvider.provide().revokeAllRoles(input.user); UserServiceProvider.provide().deleteUser(input.user); output.status = StatusType.StatusTypeSuccess; } catch (Exception e) { output.status = StatusType.StatusTypeFailure; output.error = convertToErrorAndLog(LOG, e); } LOG.finer("Exiting deleteUser"); return output; }</code><technical_language>if PagerHelper.infinitePager instead of creating scratch</technical_language>

Target:
public DeleteUserResponse deleteUser(DeleteUserRequest input) { LOG.finer("Entering deleteUser"); DeleteUserResponse output = new DeleteUserResponse(); try { if (input == null) throw new InputValidationException(ApiError.InvalidValueNull.getCode(), ApiError.InvalidValueNull.getMessage("DeleteUserRequest: input")); input.accessCode = ValidationHelper.validateAccessCode(input.accessCode, "input.accessCode"); output.session = input.session = ValidationHelper.validateAndExtendSession(input.session, "input.session"); input.user = ValidationHelper.validateExistingUser(input.user, "input.user"); List<DataAccount> linkedAccounts = new ArrayList<DataAccount>(); linkedAccounts = UserServiceProvider.provide().getDataAccounts(input.user, PagerHelper.infinitePager()); for (DataAccount la : linkedAccounts) { if (input.user.id.longValue() == UserServiceProvider.provide().getDataAccountOwner(la).id) { la.active = DataTypeHelper.INACTIVE_VALUE; DataAccountServiceProvider.provide().updateDataAccount(la); } } UserServiceProvider.provide().deleteAllDataAccounts(input.user); UserServiceProvider.provide().revokeAllPermissions(input.user); UserServiceProvider.provide().revokeAllRoles(input.user); UserServiceProvider.provide().deleteUser(input.user); output.status = StatusType.StatusTypeSuccess; } catch (Exception e) { output.status = StatusType.StatusTypeFailure; output.error = convertToErrorAndLog(LOG, e); } LOG.finer("Exiting deleteUser"); return output; }
Source:
<code>public void testPathMorphing() throws Exception { final Object lock = new Object(); final Bitmap bitmap = Bitmap.createBitmap(IMAGE_WIDTH, IMAGE_HEIGHT, Bitmap.Config.ARGB_8888); final Canvas c = new Canvas(bitmap); final Context context = ApplicationProvider.getApplicationContext(); final SeekableAnimatedVectorDrawable avd = SeekableAnimatedVectorDrawable.create(context, mResId); assertThat(avd).isNotNull(); avd.setBounds(0, 0, IMAGE_WIDTH, IMAGE_HEIGHT); bitmap.eraseColor(0); avd.draw(c); int centerColor = bitmap.getPixel(IMAGE_WIDTH / 2, IMAGE_WIDTH / 2); assertThat(centerColor).isEqualTo(0); if (DBG_DUMP_PNG) { saveVectorDrawableIntoPng(context.getResources(), bitmap, mResId, "start"); } avd.registerAnimationCallback(new Animatable2.AnimationCallback() { @Override public void onAnimationStart(@NonNull Drawable drawable) { } @Override public void onAnimationEnd(@NonNull Drawable drawable) { bitmap.eraseColor(0); drawable.draw(c); int centerColor = bitmap.getPixel(IMAGE_WIDTH / 2, IMAGE_WIDTH / 2); assertThat(centerColor).isEqualTo(0xffff0000); <START> synchronized (lock) { lock.notify(); } <END> } }); InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() { @Override public void run() { avd.start(); } }); synchronized (lock) { lock.wait(1000); } if (DBG_DUMP_PNG) { saveVectorDrawableIntoPng(context.getResources(), bitmap, mResId, "end"); } }</code><technical_language>Is a reason AnimationTestRule advance AVD end</technical_language>

Target:
public void testPathMorphing() throws Exception { final Bitmap bitmap = Bitmap.createBitmap(IMAGE_WIDTH, IMAGE_HEIGHT, Bitmap.Config.ARGB_8888); final Canvas c = new Canvas(bitmap); final Context context = ApplicationProvider.getApplicationContext(); final SeekableAnimatedVectorDrawable avd = SeekableAnimatedVectorDrawable.create(context, mResId); assertThat(avd).isNotNull(); avd.setBounds(0, 0, IMAGE_WIDTH, IMAGE_HEIGHT); bitmap.eraseColor(0); avd.draw(c); int centerColor = bitmap.getPixel(IMAGE_WIDTH / 2, IMAGE_WIDTH / 2); assertThat(centerColor).isEqualTo(0); if (DBG_DUMP_PNG) { saveVectorDrawableIntoPng(context.getResources(), bitmap, mResId, "start"); } final AtomicBoolean ended = new AtomicBoolean(false); avd.registerAnimationCallback(new Animatable2.AnimationCallback() { @Override public void onAnimationStart(@NonNull Drawable drawable) { } @Override public void onAnimationEnd(@NonNull Drawable drawable) { bitmap.eraseColor(0); drawable.draw(c); int centerColor = bitmap.getPixel(IMAGE_WIDTH / 2, IMAGE_WIDTH / 2); assertThat(centerColor).isEqualTo(0xffff0000); ended.set(true); } }); InstrumentationRegistry.getInstrumentation().runOnMainSync(() -> { avd.start(); animationRule.advanceTimeBy(1000); }); assertThat(ended.get()).isTrue(); if (DBG_DUMP_PNG) { saveVectorDrawableIntoPng(context.getResources(), bitmap, mResId, "end"); } }
Source:
<code>public void visitNode(Tree tree) { MethodTreeImpl methodTree = (MethodTreeImpl) tree; Symbol.MethodSymbol methodSymbol = methodTree.symbol(); <START> if (methodSymbol.isMethodSymbol()) { <END> JavaSymbol.MethodJavaSymbol overridee = ((JavaSymbol.MethodJavaSymbol) methodSymbol).overriddenSymbol(); if (overridee != null && overridee.isMethodSymbol()) { checkContractChange(methodTree, overridee); } } }</code><technical_language>a method symbol methodTree, testing again? Is cover case of unknown symbol? If case, I prefer test !methodSymbol.isUnknown(). Moreover, this case is covered test cases. remarks apply overridee below</technical_language>

Target:
public void visitNode(Tree tree) { MethodTreeImpl methodTree = (MethodTreeImpl) tree; Symbol.MethodSymbol methodSymbol = methodTree.symbol(); JavaSymbol.MethodJavaSymbol overridee = ((JavaSymbol.MethodJavaSymbol) methodSymbol).overriddenSymbol(); if (overridee != null && overridee.isMethodSymbol()) { checkContractChange(methodTree, overridee); } }
Source:
<code>@Override public ClientListenerResponse handleException(Throwable e, ClientListenerRequest req) { assert req != null; assert e != null; int status = e instanceof IgniteClientException ? ((IgniteClientException)e).statusCode() : ClientStatus.FAILED; boolean fullStack = false; if (X.getCause(e) != null || !X.getSuppressedList(e).isEmpty()) { fullStack = <START> ctx.kernalContext().config().getClientConnectorConfiguration().getThinClientConfiguration().showFullStack(); <END> } return new ClientResponse(req.requestId(), status, fullStack ? X.getFullStackTrace(e) : e.getMessage()); }</code><technical_language>want do this in constructor? I static configuration a dynamic, I right too</technical_language>

Target:
@Override public ClientListenerResponse handleException(Throwable e, ClientListenerRequest req) { assert req != null; assert e != null; int status = e instanceof IgniteClientException ? ((IgniteClientException)e).statusCode() : ClientStatus.FAILED; boolean fullStack = false; if (X.getCause(e) != null || !X.getSuppressedList(e).isEmpty()) { fullStack = ctx.kernalContext().sqlListener().showFullStackOnClientSide(); } return new ClientResponse(req.requestId(), status, fullStack ? e.getMessage() + U.nl() + X.getFullStackTrace(e) : e.getMessage()); }
Source:
<code>public void setUp() { try { xmlPullParserFactory = XmlPullParserFactory.newInstance(); xmlPullParserFactory.setNamespaceAware(true); xmlPullParser = xmlPullParserFactory.newPullParser(); } catch (XmlPullParserException e) <START> AbstractSmackInteroperabilityLayer.setImplementationClass( <END> SmackV3InteroperabilityLayer.class); colibriIQProvider = new ColibriIQProvider(); }</code><technical_language>While it, please move braces new lines (and identation is wrong too)</technical_language>

Target:
public void setUp() throws Exception { xmlPullParserFactory = XmlPullParserFactory.newInstance(); xmlPullParserFactory.setNamespaceAware(true); xmlPullParser = xmlPullParserFactory.newPullParser(); AbstractSmackInteroperabilityLayer.setImplementationClass( SmackV3InteroperabilityLayer.class); colibriIQProvider = new ColibriIQProvider(); }
Source:
<code>public synchronized void publish(String topic, byte[] payload) throws TTransportException { if (!isOpen()) { throw new TTransportException(TTransportException.NOT_OPEN, "failed to publish, jms client not open"); } if (topic == null || "".equals(topic)) { throw new TTransportException("publish topic cannot be empty"); } <START> if (payload.length > getPublishSizeLimit()) { <END> throw new TTransportException(TTransportExceptionType.REQUEST_TOO_LARGE, String.format("message exceeds %d bytes, was %d bytes", getPublishSizeLimit(), payload.length)); } String formattedTopic = getFormattedTopic(topic); LOGGER.debug("publishing message to '%s'", formattedTopic); try { Topic destination = session.createTopic(formattedTopic); BytesMessage message = session.createBytesMessage(); message.writeBytes(payload); producer.send(destination, message); } catch (JMSException e) { throw new TTransportException(e); } LOGGER.debug("published message to '%s'", formattedTopic); }</code><technical_language>suggestion if (payload.length > getPublishSizeLimit() && getPublishSizeLimit() > 0) {</technical_language>

Target:
public synchronized void publish(String topic, byte[] payload) throws TTransportException { if (!isOpen()) { throw new TTransportException(TTransportException.NOT_OPEN, "failed to publish, jms client not open"); } if (topic == null || "".equals(topic)) { throw new TTransportException("publish topic cannot be empty"); } if (getPublishSizeLimit() > 0 && payload.length > getPublishSizeLimit()) { throw new TTransportException(TTransportExceptionType.REQUEST_TOO_LARGE, String.format("message exceeds %d bytes, was %d bytes", getPublishSizeLimit(), payload.length)); } String formattedTopic = getFormattedTopic(topic); LOGGER.debug("publishing message to '{}'", formattedTopic); try { Topic destination = session.createTopic(formattedTopic); BytesMessage message = session.createBytesMessage(); message.writeBytes(payload); producer.send(destination, message); } catch (JMSException e) { throw new TTransportException(e); } LOGGER.debug("published message to '{}'", formattedTopic); }
Source:
<code>public void putCustomEventMapping(final String eventType, final Type eventDataType) { if (eventType == null || eventType.isEmpty()) { throw new IllegalArgumentException("eventType parameter is required and cannot be null or empty"); } <START> if (eventDataType == null) { <END> throw new IllegalArgumentException("eventDataType parameter is required and cannot be null."); } this.eventTypeToEventDataMapping.put(canonicalizeEventType(eventType), eventDataType); }</code><technical_language>change this Objects.requireNotnull</technical_language>

Target:
public void putCustomEventMapping(final String eventType, final Type eventDataType) { if (eventType == null || eventType.isEmpty()) { throw new IllegalArgumentException("eventType parameter is required and cannot be null or empty"); } if (eventDataType == null) { throw new IllegalArgumentException("eventDataType parameter is required and cannot be null"); } this.eventTypeToEventDataMapping.put(canonicalizeEventType(eventType), eventDataType); }
Source:
<code>public VdsDeploy(VDS vds) { _vds = vds; _messages = new InstallerMessages(_vds); _dialog = new EngineSSHDialog(); _parser = new MachineDialogParser(); _thread = new Thread( new Runnable() { @Override public void run() { _threadMain(); } }, "VdsDeploy" ); if (s_bootstrapPackage == null) { String cachedir = System.getenv("ENGINE_CACHE"); if (cachedir == null) { log.warn("ENGINE_CACHE environment not found using tmpdir"); cachedir = System.getProperty("java.io.tmpdir"); <START> } <END> s_bootstrapPackage = new CachedTar( new File(cachedir, Config.<String> GetValue(ConfigValues.BootstrapPackageName)), new File(Config.<String> GetValue(ConfigValues.BootstrapPackageDirectory)) ); } if (s_bootstrapLogDir == null) { String logdir = System.getenv("ENGINE_LOG"); if (logdir == null) { log.warn("ENGINE_LOG environment not found using tmpdir"); s_bootstrapLogDir = new File(System.getProperty("java.io.tmpdir")); } else { s_bootstrapLogDir = new File(logdir, "bootstrap"); if (!s_bootstrapLogDir.exists()) { s_bootstrapLogDir.mkdirs(); } } } }</code><technical_language>Replace LocalConfig.getInstance().getCacheDir()</technical_language>

Target:
public VdsDeploy(VDS vds) { _vds = vds; _messages = new InstallerMessages(_vds); _dialog = new EngineSSHDialog(); _parser = new MachineDialogParser(); _thread = new Thread( new Runnable() { @Override public void run() { _threadMain(); } }, "VdsDeploy" ); if (s_bootstrapPackage == null) { String cachedir = System.getenv("ENGINE_CACHE"); if (cachedir == null) { log.warn("ENGINE_CACHE environment not found using tmpdir"); cachedir = System.getProperty("java.io.tmpdir"); } s_bootstrapPackage = new CachedTar( new File( LocalConfig.getInstance().getCacheDir(), Config.<String> GetValue(ConfigValues.BootstrapPackageName) ), new File(Config.<String> GetValue(ConfigValues.BootstrapPackageDirectory)) ); } }
Source:
<code>public void publish(final String subscriptionId, final Map<String, Object> params) throws IOException { <START> ObjectMapper mapper = new ObjectMapper().configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false) .enableDefaultTyping(ObjectMapper.DefaultTyping.OBJECT_AND_NON_CONCRETE); <END> process(JsonRpcEvent.fromByteArray( String.format(MESSAGE_CONTENT, subscriptionId, mapper.writeValueAsString(params)).getBytes())); }</code><technical_language>hide details in JsonRpcEvent class. new factory method</technical_language>

Target:
public void publish(final String subscriptionId, final Map<String, Object> params) throws IOException { process(JsonRpcEvent.fromMethodAndParams(subscriptionId, params)); }
Source:
<code>public Serializable put(String originator, TaskId taskid, String channel, String key, Serializable value) throws InvalidChannelException, IOException { Serializable answer = (getChannel(channel)).put(key, value); commitIfNeeded(channel); logWithContext(taskid, channel, <START> "Put " + value + ON_KEY + QUOTE + key + QUOTE + PREVIOUS_VALUE_WAS + answer + "", <END> Level.DEBUG); return answer; }</code><technical_language>Instead of calling commit time work persisted channels (at risk of forgetting call it), a handler takes action perform commits automatically end of action</technical_language>

Target:
public Serializable put(String originator, TaskId taskid, String channel, String key, Serializable value) throws InvalidChannelException, IOException { Serializable answer = getChannel(channel).put(key, value); logWithContextAndPersist(taskid, channel, "Put " + value + ON_KEY + QUOTE + key + QUOTE + PREVIOUS_VALUE_WAS + answer + "", Level.DEBUG); return answer; }
Source:
<code>public ESHintQueryBuilder newInstance() { try { <START> return getKlass().getDeclaredConstructor().newInstance(); <END> } catch (ReflectiveOperationException e) { log.error("Cannot instantiate esHintQueryBuilder from " + getKlass()); throw new NuxeoException(e); } }</code><technical_language>for specific cases, log throw caught exception. In this case throwing exception message put in log is enough</technical_language>

Target:
public ESHintQueryBuilder newInstance() { try { return getKlass().getDeclaredConstructor().newInstance(); } catch (ReflectiveOperationException e) { throw new NuxeoException(e); } }
Source:
<code>protected boolean moduleRequiresRestart(IModule m) { boolean debugMode = ILaunchManager.DEBUG_MODE.equals(getServer().getMode()); Iterator<IModule[]> it = publishType.keySet().iterator(); while(it.hasNext()) { IModule[] fromMap = it.next(); if( debugMode ) { if( fromMap.length == 1 && fromMap[0] == m) { int type = publishType.get(fromMap); return type == PublishControllerUtil.FULL_PUBLISH; } continue; <START> } <END> if( fromMap.length > 0 && fromMap[0] == m) { int type = publishType.get(fromMap); Object t = requiresRestart.get(fromMap); boolean matchesPattern = t != null && ((Boolean)t).booleanValue(); boolean isRemovedChild = (fromMap.length > 1 && type == PublishControllerUtility.REMOVE_PUBLISH); if( matchesPattern || type == PublishControllerUtility.FULL_PUBLISH || isRemovedChild) return true; } } return false; }</code><technical_language>"else" instead of more risky "continue"</technical_language>

Target:
protected boolean moduleRequiresRestart(IModule m) { boolean minimizeRedeployments = shouldMinimizeRedeployments(); Iterator<IModule[]> it = publishType.keySet().iterator(); while(it.hasNext()) { IModule[] fromMap = it.next(); if( minimizeRedeployments ) { if( fromMap.length == 1 && fromMap[0] == m) { int type = publishType.get(fromMap); return type == PublishControllerUtil.FULL_PUBLISH; } } else { if( fromMap.length > 0 && fromMap[0] == m) { int type = publishType.get(fromMap); Object t = requiresRestart.get(fromMap); boolean matchesPattern = t != null && ((Boolean)t).booleanValue(); boolean isRemovedChild = (fromMap.length > 1 && type == PublishControllerUtility.REMOVE_PUBLISH); if( matchesPattern || type == PublishControllerUtility.FULL_PUBLISH || isRemovedChild) return true; } } } return false; }
Source:
<code>public OpenshiftAuthHandler(HttpHandler containerHandler) { this.containerHandler = containerHandler; if (SECURITY_OPTION.contains(OPENSHIFT_OAUTH)) { authenticator = new TokenAuthenticator(containerHandler); } else if (SECURITY_OPTION.contains(HTPASSWD)) { <START> authenticator = new BasicAuthenticator(containerHandler); <END> } else if (SECURITY_OPTION.equalsIgnoreCase(DISABLED)) { authenticator = new DisabledAuthenticator(containerHandler); } else { throw new IllegalArgumentException("Unknown security option: " + SECURITY_OPTION); } }</code><technical_language>basic auth and/or token auth enabled time. considered other</technical_language>

Target:
public OpenshiftAuthHandler(HttpHandler containerHandler) { this.containerHandler = containerHandler; tokenAuthenticator = new TokenAuthenticator(containerHandler); basicAuthenticator = new BasicAuthenticator(containerHandler); }
Source:
<code>public ResponseEntity search(@ApiParam(value = "Search query", required = true) @RequestParam(name = "query", required = true) String query) throws IOException, SearchException { SearchResults result = new SearchResults(); <START> <END> AqlQueryParser parser = new AqlQueryParser(query); Selector<ArtifactEntry> selector; try { selector = parser.parseQuery(); } catch (QueryParserException e) { return ResponseEntity.badRequest().build(); } OQueryTemplate<List<ArtifactEntry>, ArtifactEntry> queryTemplate = new OQueryTemplate<>(entityManager); for (ArtifactEntry artifactEntry : queryTemplate.select(selector)) { SearchResult r = new SearchResult(); result.getResults().add(r); r.setStorageId(artifactEntry.getStorageId()); r.setStorageId(artifactEntry.getRepositoryId()); r.setArtifactCoordinates(artifactEntry.getArtifactCoordinates()); RepositoryPath repositoryPath = artifactResolutionService.resolvePath(artifactEntry.getStorageId(), artifactEntry.getRepositoryId(), artifactEntry.getArtifactPath()); URL artifactResource = artifactResolutionService.resolveResource(repositoryPath); r.setUrl(artifactResource.toString()); } return ResponseEntity.ok(result); }</code><technical_language>of methods in BaseController getBadRequestResponseEntity depend acceptHeader able figure out return response client (i.e. text/plain application/json). However, in this case controller producing JSON, pass application/json acceptHeader :)</technical_language>

Target:
public ResponseEntity search(@ApiParam(value = "Search query", required = true) @RequestParam(name = "query", required = true) String query) throws IOException, SearchException { AqlQueryParser parser = new AqlQueryParser(query); Selector<ArtifactEntry> selector = parser.parseQuery(); SearchResults result = aqlSearchService.search(selector); return ResponseEntity.ok(result); }
Source:
<code>public void onText(String text) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { try { <START> responseKit.insertHTML(responseDoc, responseDoc.getLength(), "<i><b><br>" + botName.getText() + "</b>: " + text.replaceAll("\\<.*?\\>", " ").trim(), 0, 0, Tag.I); <END> } catch (Exception e) { log.error("ProgramAB onText error : {}", e); } } }); }</code><technical_language>I miss close &lt;i&gt; tag</technical_language>

Target:
public void onText(String text) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { try { responseKit.insertHTML(responseDoc, responseDoc.getLength(), "<i><b>" + botName.getSelectedItem().toString() + "</b>: " + HtmlFilter.stripHtml(text).trim() + "</i>", 0, 0, null); } catch (Exception e) { log.error("ProgramAB onText error : {}", e); } } }); }
Source:
<code>protected void copyDiskImage( DiskImage diskImage, Guid srcStorageDomainId, Guid destStorageDomainId, Guid diskProfileId, ActionType parentCommandType) { DiskImage newDiskImage = imagesHandler.cloneDiskImage(destStorageDomainId, Guid.newGuid(), Guid.newGuid(), diskImage, diskProfileId, getVmSnapshotId(), diskInfoDestinationMap != null ? diskInfoDestinationMap.get(diskImage.getId()) : null); ImagesHandler.setDiskAlias(newDiskImage, getVm()); String clonedDiskNameSuffix = "_" + getVm().getName(); <START> newDiskImage.setDiskAlias(newDiskImage.getDiskAlias() + clonedDiskNameSuffix); <END> MoveOrCopyImageGroupParameters parameters = createCopyParameters(newDiskImage, srcStorageDomainId, diskImage.getId(), diskImage.getImageId(), parentCommandType); parameters.setRevertDbOperationScope(ImageDbOperationScope.IMAGE); ActionReturnValue result = executeChildCopyingCommand(parameters); handleCopyResult(diskImage, newDiskImage, result); }</code><technical_language>I personally hate "+" concatenation, prefer cleaner String.format("%s_%s", newDiskImage.getDiskAlias(), getVm().getName()) call</technical_language>

Target:
protected void copyDiskImage( DiskImage diskImage, Guid srcStorageDomainId, Guid destStorageDomainId, Guid diskProfileId, ActionType parentCommandType) { DiskImage newDiskImage = imagesHandler.cloneDiskImage(destStorageDomainId, Guid.newGuid(), Guid.newGuid(), diskImage, diskProfileId, getVmSnapshotId(), diskInfoDestinationMap != null ? diskInfoDestinationMap.get(diskImage.getId()) : null); ImagesHandler.setDiskAlias(newDiskImage, getVm()); newDiskImage.setDiskAlias(String.format("%s_%s", newDiskImage.getDiskAlias(), getVm().getName())); MoveOrCopyImageGroupParameters parameters = createCopyParameters(newDiskImage, srcStorageDomainId, diskImage.getId(), diskImage.getImageId(), parentCommandType); parameters.setRevertDbOperationScope(ImageDbOperationScope.IMAGE); ActionReturnValue result = executeChildCopyingCommand(parameters); handleCopyResult(diskImage, newDiskImage, result); }
Source:
<code>protected void doStoreIfAbsent(Object id, Object objectToStore) { Assert.notNull(id, "'id' must not be null"); Assert.notNull(objectToStore, "'objectToStore' must not be null"); <START> this.messageStoreRegion.putIfAbsent(id, objectToStore); <END> }</code><technical_language>Debug log if null returned</technical_language>

Target:
protected void doStoreIfAbsent(Object id, Object objectToStore) { Assert.notNull(id, "'id' must not be null"); Assert.notNull(objectToStore, "'objectToStore' must not be null"); Object present = this.messageStoreRegion.putIfAbsent(id, objectToStore); if (present != null && logger.isDebugEnabled()) { logger.debug("The message: [" + present + "] is already present in the store. " + "The [" + objectToStore + "] is ignored."); } }
Source:
<code>public static Entity spawnCreature(World worldIn, @Nullable String entityID, double x, double y, double z) { if (entityID != null) { Entity entity = null; EntityTreeFrog.Type frogType = null; if(entityID.endsWith("frog")) { <START> System.out.println("Ends in frog"); <END> for(EntityTreeFrog.Type type : EntityTreeFrog.Type.values()) { if(entityID.equals(TropicraftRegistry.getNamePrefixed(type.getColor()+"frog"))) { entityID = TropicraftRegistry.getNamePrefixed("treefrog"); frogType = type; } } } for (int i = 0; i < 1; ++i) { entity = EntityList.createEntityByIDFromName(entityID, worldIn); if(entity instanceof EntityTreeFrog && frogType != null) { ((EntityTreeFrog)entity).setType(frogType.ordinal()); ((EntityTreeFrog)entity).initialSet = true; } if (entity instanceof EntityLivingBase) { EntityLiving entityliving = (EntityLiving)entity; entity.setLocationAndAngles(x, y, z, MathHelper.wrapDegrees(worldIn.rand.nextFloat() * 360.0F), 0.0F); entityliving.rotationYawHead = entityliving.rotationYaw; entityliving.renderYawOffset = entityliving.rotationYaw; entityliving.onInitialSpawn(worldIn.getDifficultyForLocation(new BlockPos(entityliving)), (IEntityLivingData)null); worldIn.spawnEntity(entity); entityliving.playLivingSound(); } } return entity; } else { return null; } }</code><technical_language>get rid of this sysout</technical_language>

Target:
public static Entity spawnCreature(World worldIn, @Nullable String entityID, double x, double y, double z) { if (entityID != null) { Entity entity = null; EntityTreeFrog.Type frogType = null; if(entityID.endsWith("frog")) { for(EntityTreeFrog.Type type : EntityTreeFrog.Type.values()) { if(entityID.equals(TropicraftRegistry.getNamePrefixed(type.getColor()+"frog"))) { entityID = TropicraftRegistry.getNamePrefixed("treefrog"); frogType = type; } } } for (int i = 0; i < 1; ++i) { entity = EntityList.createEntityByIDFromName(entityID, worldIn); if(entity instanceof EntityTreeFrog && frogType != null) { ((EntityTreeFrog)entity).setType(frogType.ordinal()); ((EntityTreeFrog)entity).initialSet = true; } if (entity instanceof EntityLivingBase) { EntityLiving entityliving = (EntityLiving)entity; entity.setLocationAndAngles(x, y, z, MathHelper.wrapDegrees(worldIn.rand.nextFloat() * 360.0F), 0.0F); entityliving.rotationYawHead = entityliving.rotationYaw; entityliving.renderYawOffset = entityliving.rotationYaw; entityliving.onInitialSpawn(worldIn.getDifficultyForLocation(new BlockPos(entityliving)), (IEntityLivingData)null); worldIn.spawnEntity(entity); entityliving.playLivingSound(); } } return entity; } else { return null; } }
Source:
<code>public void onSearchOpen() { Callback callback = callback(); if (callback != null) { <START> callback.getActivityToolbar().setVisibility(View.GONE); <END> } }</code><technical_language>elsewhere, Fragment force host do internals changing them. dependency a toolbar is clear of callback pattern exposing toolbar allows Fragment change it. ok defer consider pushing onSearchOpen() host allow hide / show toolbar</technical_language>

Target:
public void onSearchOpen() { Callback callback = callback(); if (callback != null) { callback.onSearchOpen(); } }
Source:
<code>public boolean downloadTemplate() { InputStream in = null; RandomAccessFile out = null; try { client.executeMethod(request); <START> remoteSize = getRemoteSize(request); <END> in = request.getResponseBodyAsStream(); File f = new File(getDownloadedFilePath()); out = new RandomAccessFile(f, "rw"); out.seek(0); copyBytes(in, out); } catch (IOException e) { s_logger.error("Error downloading template " + getTemplateId() + e.getMessage()); return false; } finally { try { out.close(); in.close(); } catch (IOException e) { e.printStackTrace(); } } return true; }</code><technical_language>remoteSize is read. If line is remove, function removed used</technical_language>

Target:
public boolean downloadTemplate() { try { client.executeMethod(request); } catch (IOException e) { throw new CloudRuntimeException("Error on HTTP request: " + e.getMessage()); } return performDownload(); }
Source:
<code>public PluginLoader(SitePaths sitePaths, PluginGuiceEnvironment pe, ServerInformationImpl sii, PluginUser.Factory puf, Provider<PluginCleanerTask> pct, @GerritServerConfig Config cfg, @CanonicalWebUrl Provider<String> provider) { pluginsDir = sitePaths.plugins_dir; dataDir = sitePaths.data_dir; tmpDir = sitePaths.tmp_dir; env = pe; srvInfoImpl = sii; pluginUserFactory = puf; running = Maps.newConcurrentMap(); disabled = Maps.newConcurrentMap(); broken = Maps.newHashMap(); toCleanup = Queues.newArrayDeque(); cleanupHandles = Maps.newConcurrentMap(); cleaner = pct; urlProvider = provider; remoteInstall = cfg.getBoolean("plugins", null, "remoteInstall", <START> true); <END> long checkFrequency = ConfigUtil.getTimeUnit(cfg, "plugins", null, "checkFrequency", TimeUnit.MINUTES.toMillis(1), TimeUnit.MILLISECONDS); if (checkFrequency > 0) { scanner = new PluginScannerThread(this, checkFrequency); } else { scanner = null; } }</code><technical_language>I expect default false. allow remote installation</technical_language>

Target:
public PluginLoader(SitePaths sitePaths, PluginGuiceEnvironment pe, ServerInformationImpl sii, PluginUser.Factory puf, Provider<PluginCleanerTask> pct, @GerritServerConfig Config cfg, @CanonicalWebUrl Provider<String> provider) { pluginsDir = sitePaths.plugins_dir; dataDir = sitePaths.data_dir; tmpDir = sitePaths.tmp_dir; env = pe; srvInfoImpl = sii; pluginUserFactory = puf; running = Maps.newConcurrentMap(); disabled = Maps.newConcurrentMap(); broken = Maps.newHashMap(); toCleanup = Queues.newArrayDeque(); cleanupHandles = Maps.newConcurrentMap(); cleaner = pct; urlProvider = provider; remoteInstall = cfg.getBoolean("plugins", null, "allowRemoteInstall", false); long checkFrequency = ConfigUtil.getTimeUnit(cfg, "plugins", null, "checkFrequency", TimeUnit.MINUTES.toMillis(1), TimeUnit.MILLISECONDS); if (checkFrequency > 0) { scanner = new PluginScannerThread(this, checkFrequency); } else { scanner = null; } }
Source:
<code>public void assessWithDefaultConstructor() { <START> MinificationAssessor assessor = new MinificationAssessor(Charset.defaultCharset()); <END> getAssert(assessor, "file2.js").isFalse(); }</code><technical_language>@ivandalbosco a predefined charset UTF8 default charset of platform running test. issues of that</technical_language>

Target:
public void assessWithDefaultConstructor() { MinificationAssessor assessor = new MinificationAssessor(Charset.forName("UTF-8")); getAssert(assessor, "file2.js").isFalse(); }
Source:
<code>public void add(Block key, Block value, int position) { BlockBuilder keyBlockBuilder = keyBlockBuilders.get(getGroupId()); BlockBuilder valueBlockBuilder = valueBlockBuilders.get(getGroupId()); if (keyBlockBuilder != null) { size -= keyBlockBuilder.getRetainedSizeInBytes(); size -= valueBlockBuilder.getRetainedSizeInBytes(); } else { <START> keyBlockBuilder = this.keyType.createBlockBuilder(null, EXPECTED_ENTRIES, expectedValueSize(keyType, EXPECTED_ENTRY_SIZE)); <END> valueBlockBuilder = this.valueType.createBlockBuilder(null, EXPECTED_ENTRIES, expectedValueSize(valueType, EXPECTED_ENTRY_SIZE)); keyBlockBuilders.set(getGroupId(), keyBlockBuilder); valueBlockBuilders.set(getGroupId(), valueBlockBuilder); } keyType.appendTo(key, position, keyBlockBuilder); valueType.appendTo(value, position, valueBlockBuilder); size += keyBlockBuilder.getRetainedSizeInBytes(); size += valueBlockBuilder.getRetainedSizeInBytes(); }</code><technical_language>nit: omit this</technical_language>

Target:
public void add(Block key, Block value, int position) { BlockBuilder keyBlockBuilder = keyBlockBuilders.get(getGroupId()); BlockBuilder valueBlockBuilder = valueBlockBuilders.get(getGroupId()); if (keyBlockBuilder != null) { size -= keyBlockBuilder.getRetainedSizeInBytes(); size -= valueBlockBuilder.getRetainedSizeInBytes(); } else { keyBlockBuilder = keyType.createBlockBuilder(null, EXPECTED_ENTRIES, expectedValueSize(keyType, EXPECTED_ENTRY_SIZE)); valueBlockBuilder = valueType.createBlockBuilder(null, EXPECTED_ENTRIES, expectedValueSize(valueType, EXPECTED_ENTRY_SIZE)); keyBlockBuilders.set(getGroupId(), keyBlockBuilder); valueBlockBuilders.set(getGroupId(), valueBlockBuilder); } keyType.appendTo(key, position, keyBlockBuilder); valueType.appendTo(value, position, valueBlockBuilder); size += keyBlockBuilder.getRetainedSizeInBytes(); size += valueBlockBuilder.getRetainedSizeInBytes(); }
Source:
<code>OperatorDTO(Object id, String name, String description, String domainName, String friendlyName, String emergencyNumber) { this.id = id; this.name = name; this.description = description; this.domainName = domainName; this.friendlyName = friendlyName; <START> this.emergencyNumber = setDefaultValueIfEmpty(emergencyNumber); <END> }</code><technical_language>This done persistence level, i.e. in entity object</technical_language>

Target:
OperatorDTO(Object id, String name, String description, String domainName, String friendlyName, String emergencyNumber) { this.id = id; this.name = name; this.description = description; this.domainName = domainName; this.friendlyName = friendlyName; this.emergencyNumber = emergencyNumber; }
Source:
<code>public static Datastream createDatastream(String connectorType, String datastreamName, String source) { Datastream ds = new Datastream(); ds.setName(datastreamName); ds.setConnectorName(connectorType); ds.setSource(new DatastreamSource()); ds.getSource().setConnectionString(source); StringMap metadata = new StringMap(); <START> metadata.put("owner", "dummy_owner"); <END> ds.setMetadata(metadata); return ds; }</code><technical_language>DatastreamMetadataConstants.OWNER_KEY</technical_language>

Target:
public static Datastream createDatastream(String connectorType, String datastreamName, String source) { Datastream ds = new Datastream(); ds.setName(datastreamName); ds.setConnectorName(connectorType); ds.setSource(new DatastreamSource()); ds.getSource().setConnectionString(source); StringMap metadata = new StringMap(); metadata.put(DatastreamMetadataConstants.OWNER_KEY, "dummy_owner"); ds.setMetadata(metadata); return ds; }
Source:
<code>public void testFilterContentletWithLuceneQuery() throws DotSecurityException, DotDataException { final String filter = "+contentType:Youtube +(conhost:" + host.getIdentifier() + " conhost:SYSTEM_HOST) +catchall:how*"; final List<Contentlet> testResults = RelationshipUtil .filterContentlet(languageID, filter, user); final List<Contentlet> expectedResults = contentletAPI .search(filter + " +languageId:" + languageID, 0, 0, null, user, false); assertNotNull(testResults); assertNotNull(expectedResults); assertEquals(expectedResults.size(), testResults.size()); <START> testResults.forEach(contentlet -> assertTrue(expectedResults.contains(contentlet))); <END> }</code><technical_language>This is alternative assert: aList.stream().allMatch(num - > bList.contains(num)));</technical_language>

Target:
public void testFilterContentletWithLuceneQuery() throws DotSecurityException, DotDataException { final String filter = "+contentType:Youtube +(conhost:" + host.getIdentifier() + " conhost:SYSTEM_HOST) +catchall:how*"; final List<Contentlet> testResults = RelationshipUtil .filterContentlet(languageID, filter, user); final List<Contentlet> expectedResults = contentletAPI .search(filter + " +languageId:" + languageID, 0, 0, null, user, false); assertNotNull(testResults); assertNotNull(expectedResults); assertEquals(expectedResults.size(), testResults.size()); assertTrue(testResults.stream().allMatch(contentlet -> expectedResults.contains(contentlet))); }
Source:
<code><START> public DataRecord addRecord(InputStream stream) throws DataStoreException { <END> return null; }</code><technical_language>Need implement</technical_language>

Target:
public DataRecord addRecord(InputStream stream) throws DataStoreException { return this.addRecord(stream, new BlobOptions()); }
Source:
<code><START> public Boolean getEnableAcl() <END> { return enableAcl; }</code><technical_language>this boolean instead of Boolean</technical_language>

Target:
public boolean getEnableAcl() { return enableAcl; }
Source:
<code>public void start() { this.cacheName = cache.getName(); this.localAddress = rpcManager.getAddress(); this.installedTopology = distributionManager.getCacheTopology(); PartitionHandlingConfiguration config = cache.getCacheConfiguration().clustering().partitionHandling(); this.entryMergePolicy = mergePolicyRegistry.createInstance(config); this.conflictTimeout = cache.getCacheConfiguration().clustering().stateTransfer().timeout(); this.running = true; <START> if (trace) log.tracef("Cache %s Starting %s. isRunning=%s", cacheName, this.getClass().getSimpleName(), !running); <END> }</code><technical_language>I cache name work NDC set CacheImpl.start() ComponentRegistry.start(). this.getClass().getSimpleName() here, do expect DefaultConflictManager subclassed</technical_language>

Target:
public void start() { this.cacheName = cache.getName(); this.localAddress = rpcManager.getAddress(); this.installedTopology = distributionManager.getCacheTopology(); PartitionHandlingConfiguration config = cache.getCacheConfiguration().clustering().partitionHandling(); this.entryMergePolicy = mergePolicyRegistry.createInstance(config); this.conflictTimeout = cache.getCacheConfiguration().clustering().stateTransfer().timeout(); this.running = true; if (trace) log.tracef("Cache %s starting %s. isRunning=%s", cacheName, getClass().getSimpleName(), !running); }
Source:
<code>protected int doWork() { log.info("Checking inputs."); INPUT = IOUtil.unrollFiles(INPUT, IOUtil.VCF_EXTENSIONS); for (final File f : INPUT) IOUtil.assertFileIsReadable(f); IOUtil.assertFileIsWritable(OUTPUT); final SAMSequenceDictionary sequenceDictionary = VCFFileReader.getSequenceDictionary(INPUT.get(0)); if (CREATE_INDEX && sequenceDictionary == null) { throw new PicardException("In order to index the resulting VCF input VCFs must contain ##contig lines."); } log.info("Checking file headers and first records to ensure compatibility."); try { assertSameSamplesAndValidOrdering(INPUT); if (areAllBlockCompressed(INPUT) && areAllBlockCompressed(CollectionUtil.makeList(OUTPUT))) { log.info("Gathering by copying gzip blocks. Will not be able to validate position non-overlap of files."); if (CREATE_INDEX) log.warn("Index creation not currently supported when gathering block compressed VCFs."); gatherWithBlockCopying(INPUT, OUTPUT); } else { log.info("Gathering by conventional means."); gatherConventionally(sequenceDictionary, CREATE_INDEX, INPUT, OUTPUT); } <START> } catch (IllegalArgumentException e) { <END> log.error(e.getMessage()); return 1; } return 0; }</code><technical_language>is important catch this runtime exception throw another runtime exception, PicardException, above? familiar doWork() works; some errors OK catch return 1; others crash program</technical_language>

Target:
protected int doWork() { log.info("Checking inputs."); INPUT = IOUtil.unrollFiles(INPUT, IOUtil.VCF_EXTENSIONS); for (final File f : INPUT) IOUtil.assertFileIsReadable(f); IOUtil.assertFileIsWritable(OUTPUT); final SAMSequenceDictionary sequenceDictionary = VCFFileReader.getSequenceDictionary(INPUT.get(0)); if (CREATE_INDEX && sequenceDictionary == null) { throw new PicardException("In order to index the resulting VCF input VCFs must contain ##contig lines."); } log.info("Checking file headers and first records to ensure compatibility."); try { assertSameSamplesAndValidOrdering(INPUT); if (areAllBlockCompressed(INPUT) && areAllBlockCompressed(Collections.singletonList(OUTPUT))) { log.info("Gathering by copying gzip blocks. Will not be able to validate position non-overlap of files."); if (CREATE_INDEX) { log.warn("Index creation not currently supported when gathering block compressed VCFs."); } gatherWithBlockCopying(INPUT, OUTPUT); } else { log.info("Gathering by conventional means."); gatherConventionally(sequenceDictionary, CREATE_INDEX, INPUT, OUTPUT); } } catch (RuntimeException e) { log.error("There was a problem with gathering the INPUT.", e); try { Files.deleteIfExists(OUTPUT.toPath()); } catch (Exception ignored) { } return 1; } return 0; }
Source:
<code>public void mercury_search_navigateToPageUsingSearchResults() { init(); SearchResultsPage searchResults = new SearchResultsPage().openForQuery(SEARCH_PHRASE); <START> searchResults.selectSearchResult(0); <END> Assertion.assertTrue(driver.getCurrentUrl().contains(SEARCH_PHRASE)); }</code><technical_language>(purity alert) This written inline</technical_language>

Target:
public void mercury_search_navigateToPageUsingSearchResults() { String resultLink = new SearchResultsPage() .openForQuery(this.SEARCH_PHRASE) .clickSearchResult(0); Assertion.assertTrue(driver.getCurrentUrl().equals(resultLink)); }
Source:
<code>public void testJpegPngEmpty() throws Exception { String request = "wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fvnd.jpeg-png&TRANSPARENT=true&STYLES" + "&LAYERS=cite%3ABasicPolygons&SRS=EPSG%3A4326&WIDTH=256&HEIGHT=256&BBOX=-1.9%2C1.8%2C-1.3%2C2.5"; BufferedImage image = getAsImage(request, "image/png"); <START> assertBlank("testJpegPngOpaque", image, new Color(255,255,255,0)); <END> }</code><technical_language>a big deal update message in assertion text "testJpegPngEmpty" reflect name of test. I is a simple copy paste typo</technical_language>

Target:
public void testJpegPngEmpty() throws Exception { String request = "wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fvnd.jpeg-png&TRANSPARENT=true&STYLES" + "&LAYERS=cite%3ABasicPolygons&SRS=EPSG%3A4326&WIDTH=256&HEIGHT=256&BBOX=-1.9%2C1.8%2C-1.3%2C2.5"; BufferedImage image = getAsImage(request, "image/png"); assertBlank("testJpegPngEmpty", image, new Color(255,255,255,0)); }
Source:
<code>public List<String> getKeyNames() { <START> return Arrays.asList(UNIQUE_ALT_READ_SET_COUNT_KEY); <END> }</code><technical_language>Collections.singletonList() is slightly more efficient long result need modified, is true for getDescription()</technical_language>

Target:
public List<String> getKeyNames() { return Collections.singletonList(UNIQUE_ALT_READ_SET_COUNT_KEY); }
Source:
<code>void processPullReject(final K key) { final PullFuture<V> future = pendingPulls.get(key); if (future != null) { LOG.log(Level.INFO, "Pull operation for key {0} is rejected." + " It means that the corresponding server is closing or already closed.", key); future.reject(); } else { LOG.log(Level.WARNING, "Pending pull was not found for key {0}." + <START> " It may be fulfilled by another earlier response from the server", key); <END> } }</code><technical_language>sound: _Response for key arrived earlier another server_</technical_language>

Target:
void processPullReject(final K key) { final PullFuture<V> future = pendingPulls.get(key); if (future != null) { LOG.log(Level.INFO, "Pull operation for key {0} is rejected." + " It means that the corresponding server is closing or already closed.", key); future.reject(); } else { LOG.log(Level.WARNING, "Pending pull was not found for key {0}." + " Response for the key may have arrived earlier from another server", key); } }
Source:
<code><START> public SpatialJoinNode(@JsonProperty("id") PlanNodeId id, <END> @JsonProperty("type") Type type, @JsonProperty("left") PlanNode left, @JsonProperty("right") PlanNode right, @JsonProperty("outputSymbols") List<Symbol> outputSymbols, @JsonProperty("filter") Expression filter) { super(id); requireNonNull(filter, "filter is null"); this.type = requireNonNull(type, "type is null"); this.left = requireNonNull(left, "left is null"); this.right = requireNonNull(right, "right is null"); this.outputSymbols = ImmutableList.copyOf(requireNonNull(outputSymbols, "outputSymbols is null")); this.filter = requireNonNull(filter, "filter is null"); Set<Symbol> inputSymbols = ImmutableSet.<Symbol>builder() .addAll(left.getOutputSymbols()) .addAll(right.getOutputSymbols()) .build(); checkArgument(inputSymbols.containsAll(outputSymbols), "Left and right join inputs do not contain all output symbols"); }</code><technical_language>new line</technical_language>

Target:
public SpatialJoinNode( @JsonProperty("id") PlanNodeId id, @JsonProperty("type") Type type, @JsonProperty("left") PlanNode left, @JsonProperty("right") PlanNode right, @JsonProperty("outputSymbols") List<Symbol> outputSymbols, @JsonProperty("filter") Expression filter) { super(id); this.type = requireNonNull(type, "type is null"); this.left = requireNonNull(left, "left is null"); this.right = requireNonNull(right, "right is null"); this.outputSymbols = ImmutableList.copyOf(requireNonNull(outputSymbols, "outputSymbols is null")); this.filter = requireNonNull(filter, "filter is null"); Set<Symbol> inputSymbols = ImmutableSet.<Symbol>builder() .addAll(left.getOutputSymbols()) .addAll(right.getOutputSymbols()) .build(); checkArgument(inputSymbols.containsAll(outputSymbols), "Left and right join inputs do not contain all output symbols"); }
Source:
<code>public static boolean abilityBlockCheck(Block block) { if (customBlocksEnabled && CustomBlocksConfig.getInstance().customAbilityBlocks.contains(new ItemStack(block.getTypeId(), 1, (short) 0, block.getData()))) { return false; } switch (block.getType()) { case BED_BLOCK: case BREWING_STAND: case BOOKSHELF: case BURNING_FURNACE: case CAKE_BLOCK: case CHEST: case DISPENSER: case ENCHANTMENT_TABLE: case ENDER_CHEST: case FENCE_GATE: case FURNACE: case IRON_DOOR_BLOCK: case JUKEBOX: case LEVER: case NOTE_BLOCK: case STONE_BUTTON: case TRAP_DOOR: case WALL_SIGN: case WOODEN_DOOR: case WORKBENCH: case BEACON: case ANVIL: return false; default: <START> if (block.getTypeId() == Config.getInstance().getRepairAnvilId() | block.getTypeId() == Config.getInstance().getSalvageAnvilId()) { <END> return false; } else { return true; } } }</code><technical_language>pretty this line compile. bitwise function | booleans, if compile treating if (block.getTypeId() == (Config.getInstance().getRepairAnvilId() | block.getTypeId()) == Config.getInstance().getSalvageAnvilId()) Regardless, pretty meant || instead</technical_language>

Target:
public static boolean abilityBlockCheck(Block block) { if (customBlocksEnabled && CustomBlocksConfig.getInstance().customAbilityBlocks.contains(new ItemStack(block.getTypeId(), 1, (short) 0, block.getData()))) { return false; } switch (block.getType()) { case BED_BLOCK: case BREWING_STAND: case BOOKSHELF: case BURNING_FURNACE: case CAKE_BLOCK: case CHEST: case DISPENSER: case ENCHANTMENT_TABLE: case ENDER_CHEST: case FENCE_GATE: case FURNACE: case IRON_DOOR_BLOCK: case JUKEBOX: case LEVER: case NOTE_BLOCK: case STONE_BUTTON: case TRAP_DOOR: case WALL_SIGN: case WOODEN_DOOR: case WORKBENCH: case BEACON: case ANVIL: return false; default: if (block.getTypeId() == Config.getInstance().getRepairAnvilId() || block.getTypeId() == Config.getInstance().getSalvageAnvilId()) { return false; } else { return true; } } }
Source:
<code>private void initWorkerClock() { final AvroClockMsg initClockMsg = ClockManager.getReplyInitialClockMessage(INIT_GLOBAL_MIN_CLOCK, INIT_WORKER_CLOCK); final byte[] replyData = codec.encode(initClockMsg); <START> final AggregationMessage aggregationMessage = getTestAggregationMessage(WORKER_ID, replyData); <END> sspWorkerClockMessageHandler.onNext(aggregationMessage); }</code><technical_language>serverId instead of workerId in getTestAggregationMessage(). Please fix this parameter name(workerId) of getTestAggregationMessage</technical_language>

Target:
private void initWorkerClock() { final AvroClockMsg initClockMsg = ClockManager.getReplyInitialClockMessage(INIT_GLOBAL_MIN_CLOCK, INIT_WORKER_CLOCK); final byte[] replyData = codec.encode(initClockMsg); final AggregationMessage aggregationMessage = getTestAggregationMessage(DRIVER_ID, replyData); sspWorkerClockMessageHandler.onNext(aggregationMessage); }