auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
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"); Pager pager = new Pager(); 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; }

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:
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); synchronized (lock) { lock.notify(); } } }); 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"); } }

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:
public void visitNode(Tree tree) { MethodTreeImpl methodTree = (MethodTreeImpl) tree; Symbol.MethodSymbol methodSymbol = methodTree.symbol(); if (methodSymbol.isMethodSymbol()) { JavaSymbol.MethodJavaSymbol overridee = ((JavaSymbol.MethodJavaSymbol) methodSymbol).overriddenSymbol(); if (overridee != null && overridee.isMethodSymbol()) { checkContractChange(methodTree, overridee); } } }

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:
@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().config().getClientConnectorConfiguration().getThinClientConfiguration().showFullStack(); } return new ClientResponse(req.requestId(), status, fullStack ? X.getFullStackTrace(e) : e.getMessage()); }

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:
public void setUp() { try { xmlPullParserFactory = XmlPullParserFactory.newInstance(); xmlPullParserFactory.setNamespaceAware(true); xmlPullParser = xmlPullParserFactory.newPullParser(); } catch (XmlPullParserException e) AbstractSmackInteroperabilityLayer.setImplementationClass( SmackV3InteroperabilityLayer.class); colibriIQProvider = new ColibriIQProvider(); }

Target:
public void setUp() throws Exception { xmlPullParserFactory = XmlPullParserFactory.newInstance(); xmlPullParserFactory.setNamespaceAware(true); xmlPullParser = xmlPullParserFactory.newPullParser(); AbstractSmackInteroperabilityLayer.setImplementationClass( SmackV3InteroperabilityLayer.class); colibriIQProvider = new ColibriIQProvider(); }
Source:
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 (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 '%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); }

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:
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); }

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:
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(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(); } } } }

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:
public void publish(final String subscriptionId, final Map<String, Object> params) throws IOException { ObjectMapper mapper = new ObjectMapper().configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false) .enableDefaultTyping(ObjectMapper.DefaultTyping.OBJECT_AND_NON_CONCRETE); process(JsonRpcEvent.fromByteArray( String.format(MESSAGE_CONTENT, subscriptionId, mapper.writeValueAsString(params)).getBytes())); }

Target:
public void publish(final String subscriptionId, final Map<String, Object> params) throws IOException { process(JsonRpcEvent.fromMethodAndParams(subscriptionId, params)); }
Source:
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, "Put " + value + ON_KEY + QUOTE + key + QUOTE + PREVIOUS_VALUE_WAS + answer + "", Level.DEBUG); return answer; }

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:
public ESHintQueryBuilder newInstance() { try { return getKlass().getDeclaredConstructor().newInstance(); } catch (ReflectiveOperationException e) { log.error("Cannot instantiate esHintQueryBuilder from " + getKlass()); throw new NuxeoException(e); } }

Target:
public ESHintQueryBuilder newInstance() { try { return getKlass().getDeclaredConstructor().newInstance(); } catch (ReflectiveOperationException e) { throw new NuxeoException(e); } }
Source:
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; } 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; }

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:
public OpenshiftAuthHandler(HttpHandler containerHandler) { this.containerHandler = containerHandler; if (SECURITY_OPTION.contains(OPENSHIFT_OAUTH)) { authenticator = new TokenAuthenticator(containerHandler); } else if (SECURITY_OPTION.contains(HTPASSWD)) { authenticator = new BasicAuthenticator(containerHandler); } else if (SECURITY_OPTION.equalsIgnoreCase(DISABLED)) { authenticator = new DisabledAuthenticator(containerHandler); } else { throw new IllegalArgumentException("Unknown security option: " + SECURITY_OPTION); } }

Target:
public OpenshiftAuthHandler(HttpHandler containerHandler) { this.containerHandler = containerHandler; tokenAuthenticator = new TokenAuthenticator(containerHandler); basicAuthenticator = new BasicAuthenticator(containerHandler); }
Source:
public ResponseEntity search(@ApiParam(value = "Search query", required = true) @RequestParam(name = "query", required = true) String query) throws IOException, SearchException { SearchResults result = new SearchResults(); 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); }

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:
public void onText(String text) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { try { responseKit.insertHTML(responseDoc, responseDoc.getLength(), "<i><b><br>" + botName.getText() + "</b>: " + text.replaceAll("\\<.*?\\>", " ").trim(), 0, 0, Tag.I); } catch (Exception e) { log.error("ProgramAB onText error : {}", e); } } }); }

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:
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(); newDiskImage.setDiskAlias(newDiskImage.getDiskAlias() + clonedDiskNameSuffix); MoveOrCopyImageGroupParameters parameters = createCopyParameters(newDiskImage, srcStorageDomainId, diskImage.getId(), diskImage.getImageId(), parentCommandType); parameters.setRevertDbOperationScope(ImageDbOperationScope.IMAGE); ActionReturnValue result = executeChildCopyingCommand(parameters); handleCopyResult(diskImage, newDiskImage, result); }

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:
protected void doStoreIfAbsent(Object id, Object objectToStore) { Assert.notNull(id, "'id' must not be null"); Assert.notNull(objectToStore, "'objectToStore' must not be null"); this.messageStoreRegion.putIfAbsent(id, objectToStore); }

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:
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")) { System.out.println("Ends in 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; } }

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:
public void onSearchOpen() { Callback callback = callback(); if (callback != null) { callback.getActivityToolbar().setVisibility(View.GONE); } }

Target:
public void onSearchOpen() { Callback callback = callback(); if (callback != null) { callback.onSearchOpen(); } }
Source:
public boolean downloadTemplate() { InputStream in = null; RandomAccessFile out = null; try { client.executeMethod(request); remoteSize = getRemoteSize(request); 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; }

Target:
public boolean downloadTemplate() { try { client.executeMethod(request); } catch (IOException e) { throw new CloudRuntimeException("Error on HTTP request: " + e.getMessage()); } return performDownload(); }
Source:
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", true); 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; } }

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:
public void assessWithDefaultConstructor() { MinificationAssessor assessor = new MinificationAssessor(Charset.defaultCharset()); getAssert(assessor, "file2.js").isFalse(); }

Target:
public void assessWithDefaultConstructor() { MinificationAssessor assessor = new MinificationAssessor(Charset.forName("UTF-8")); getAssert(assessor, "file2.js").isFalse(); }
Source:
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 = this.keyType.createBlockBuilder(null, EXPECTED_ENTRIES, expectedValueSize(keyType, EXPECTED_ENTRY_SIZE)); 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(); }

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:
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 = setDefaultValueIfEmpty(emergencyNumber); }

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:
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("owner", "dummy_owner"); ds.setMetadata(metadata); return ds; }

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:
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()); testResults.forEach(contentlet -> assertTrue(expectedResults.contains(contentlet))); }

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:
public DataRecord addRecord(InputStream stream) throws DataStoreException { return null; }

Target:
public DataRecord addRecord(InputStream stream) throws DataStoreException { return this.addRecord(stream, new BlobOptions()); }
Source:
public Boolean getEnableAcl() { return enableAcl; }

Target:
public boolean getEnableAcl() { return enableAcl; }
Source:
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, this.getClass().getSimpleName(), !running); }

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:
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); } } catch (IllegalArgumentException e) { log.error(e.getMessage()); return 1; } return 0; }

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:
public void mercury_search_navigateToPageUsingSearchResults() { init(); SearchResultsPage searchResults = new SearchResultsPage().openForQuery(SEARCH_PHRASE); searchResults.selectSearchResult(0); Assertion.assertTrue(driver.getCurrentUrl().contains(SEARCH_PHRASE)); }

Target:
public void mercury_search_navigateToPageUsingSearchResults() { String resultLink = new SearchResultsPage() .openForQuery(this.SEARCH_PHRASE) .clickSearchResult(0); Assertion.assertTrue(driver.getCurrentUrl().equals(resultLink)); }
Source:
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("testJpegPngOpaque", image, new Color(255,255,255,0)); }

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:
public List<String> getKeyNames() { return Arrays.asList(UNIQUE_ALT_READ_SET_COUNT_KEY); }

Target:
public List<String> getKeyNames() { return Collections.singletonList(UNIQUE_ALT_READ_SET_COUNT_KEY); }
Source:
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}." + " It may be fulfilled by another earlier response from the server", key); } }

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:
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); 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"); }

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:
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; } } }

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:
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(WORKER_ID, replyData); sspWorkerClockMessageHandler.onNext(aggregationMessage); }

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); }
Source:
public boolean remove(Object attachment) { XWikiAttachment xwikiAttachment = (XWikiAttachment) attachment; if(map.put(xwikiAttachment.getFilename(), xwikiAttachment) == null) return false; map.remove(attachment); updateMap(); return true; }

Target:
public boolean remove(Object attachment) { XWikiAttachment xwikiAttachment = (XWikiAttachment) attachment; if (map.remove(xwikiAttachment.getFilename()) == null) { return false; } updatedMap(); return true; }
Source:
public void connectionPoolMetrics(){ navigation.selectRow().invoke("View"); Application.waitUntilVisible(); MetricsAreaFragment metricsArea = dsPage.getConnectionPoolMetricsArea(); double expectedActivePercentage = metricsArea.getPercentage(ACTIVE, AVAILABLE_CONNECTIONS); double expectedMaxUsedPercentage = metricsArea.getPercentage(MAX_USED, AVAILABLE_CONNECTIONS); MetricsFragment activeMetrics = metricsArea.getMetricsFragment(ACTIVE); MetricsFragment maxUsedMetrics = metricsArea.getMetricsFragment(MAX_USED); assertEquals(expectedActivePercentage, activeMetrics.getPercentage(), DELTA); assertEquals(expectedMaxUsedPercentage, maxUsedMetrics.getPercentage(), DELTA); }

Target:
public void connectionPoolMetrics(){ MetricsAreaFragment metricsArea = dsPage.getConnectionPoolMetricsArea(); double expectedActivePercentage = metricsArea.getPercentage(ACTIVE, AVAILABLE_CONNECTIONS); double expectedMaxUsedPercentage = metricsArea.getPercentage(MAX_USED, AVAILABLE_CONNECTIONS); MetricsFragment activeMetrics = metricsArea.getMetricsFragment(ACTIVE); MetricsFragment maxUsedMetrics = metricsArea.getMetricsFragment(MAX_USED); assertEquals(expectedActivePercentage, activeMetrics.getPercentage(), DELTA); assertEquals(expectedMaxUsedPercentage, maxUsedMetrics.getPercentage(), DELTA); }
Source:
public void run() { try { File tempFile = File.createTempFile("tempFile", "fileshare"); tempFile.deleteOnExit(); cloudFile.downloadToFile(tempFile.getAbsolutePath()); } catch (StorageException | IOException e) { throw new RuntimeException(e); } }

Target:
public void run() { try { cloudFile.downloadToFile(targetFilePath); } catch (StorageException | IOException e) { throw new RuntimeException(e); } }
Source:
private boolean isActiveVds() { VDS vds = vdsDao.get(getParameters().getId()); if (vds == null) { getQueryReturnValue().setExceptionString( "Cannot fetch storage devices, host doesn't exist anymore."); } else if (vds.getStatus() != VDSStatus.Up) { getQueryReturnValue().setExceptionString(String.format( "Cannot fetch storage devices, host %s is not UP.", vds.getHostName())); } else { return true; } getQueryReturnValue().setSucceeded(false); return false; }

Target:
private boolean isActiveVds() { VDS vds = vdsDao.get(getParameters().getId()); if (vds == null) { getQueryReturnValue() .setExceptionString(EngineMessage.CANNOT_FETCH_STORAGE_DEVICES_HOST_DOESNT_EXIST_ANYMORE.name()); } else if (vds.getStatus() != VDSStatus.Up) { getQueryReturnValue().setExceptionString(String.format( "Cannot fetch storage devices, host %s is not UP.", vds.getHostName())); } else { return true; } getQueryReturnValue().setSucceeded(false); return false; }
Source:
public JpaStoreConfigurationBuilder batchSize(long batchSize) { attributes.attribute(MAX_BATCH_SIZE).set((int) batchSize); return self(); }

Target:
public JpaStoreConfigurationBuilder batchSize(long batchSize) { int size = batchSize > Integer.MAX_VALUE ? Integer.MAX_VALUE : (batchSize < Integer.MIN_VALUE ? Integer.MIN_VALUE : (int) batchSize); maxBatchSize(size); return self(); }
Source:
public HashMap<String, Integer> getVisualizationWikisSetup() { List<String> wikiList = new ArrayList<String>(); HashMap<String, Integer> visualizationSetup = new HashMap<String, Integer>(); for (WebElement element : visualizationWikis) { wikiList.add(element.getAttribute("href")); } int video = 0; int entertainment = 0; int lifestyle = 0; for (String URL : wikiList) { getUrl(URL); String hubName = hubIndicator.getText().toLowerCase(); hubName = hubName.substring(2, hubName.length() - 2).replace(" ", "_"); if (hubName.equals(HubName.Video_Games.toString().toLowerCase())) { video += 1; } if (hubName.equals(HubName.Entertainment.toString().toLowerCase())) { entertainment += 1; } if (hubName.equals(HubName.Lifestyle.toString().toLowerCase())) { lifestyle += 1; } } visualizationSetup.put(HubName.Video_Games.toString(), video); visualizationSetup.put(HubName.Entertainment.toString(), entertainment); visualizationSetup.put(HubName.Lifestyle.toString(), lifestyle); return visualizationSetup; }

Target:
public HashMap<String, Integer> getVisualizationWikisSetup() { List<String> wikiList = new ArrayList<String>(); HashMap<String, Integer> visualizationSetup = new HashMap<String, Integer>(); for (WebElement element : visualizationWikis) { wikiList.add(element.getAttribute("href")); } int video = 0; int entertainment = 0; int lifestyle = 0; for (String URL : wikiList) { getUrl(URL); String hubName = hubIndicator.getText().toLowerCase(); hubName = hubName.substring(2, hubName.length() - 2).replace(" ", "_"); switch (hubName) { case "video_games": video += 1; break; case "entertainment": entertainment += 1; break; case "lifestyle": lifestyle += 1; break; } } visualizationSetup.put(HubName.Video_Games.toString(), video); visualizationSetup.put(HubName.Entertainment.toString(), entertainment); visualizationSetup.put(HubName.Lifestyle.toString(), lifestyle); return visualizationSetup; }