auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
static File addLocalMavenRepoInitScriptCommandLineOption(@NotNull List<String> args, @NotNull File repoPath) { try { File file = FileUtil.createTempFile("asLocalRepo", SdkConstants.DOT_GRADLE); file.deleteOnExit(); String[] lines = { "allprojects {", " buildscript {", " repositories {", " maven { url '" + repoPath.getPath() + "'}", " }", " }", "}", }; String contents = StringUtil.join(lines, SystemProperties.getLineSeparator()); FileUtil.writeToFile(file, contents); ContainerUtil.addAll(args, GradleConstants.INIT_SCRIPT_CMD_OPTION, file.getAbsolutePath()); return file; } catch (IOException e) { LOG.warn("Failed to set up 'local repo' Gradle init script", e); } return null; }

Target:
static File addLocalMavenRepoInitScriptCommandLineOption(@NotNull List<String> args, @NotNull File repoPath) { try { File file = FileUtil.createTempFile("asLocalRepo", SdkConstants.DOT_GRADLE); file.deleteOnExit(); String contents ="allprojects {\n" + " buildscript {\n" + " repositories {\n" + " maven { url '" + GradleImport.escapeGroovyStringLiteral(repoPath.getPath()) + "'}\n" + " }\n" + " }\n" + "}\n"; FileUtil.writeToFile(file, contents); ContainerUtil.addAll(args, GradleConstants.INIT_SCRIPT_CMD_OPTION, file.getAbsolutePath()); return file; } catch (IOException e) { LOG.warn("Failed to set up 'local repo' Gradle init script", e); } return null; }
Source:
public synchronized void sendNotification(final T notification) { final SendableApnsPushNotification<T> sendableNotification = new SendableApnsPushNotification<T>(notification, this.sequenceNumber.getAndIncrement()); final ApnsConnection<T> apnsConnection = this; if (this.channel == null) { throw new IllegalStateException(String.format("%s has not connected.", this.name)); } log.trace("{} sending {}", apnsConnection.name, sendableNotification); this.pendingOperationLock.lock(); try { this.pendingOperationCount += 1; this.channel.writeAndFlush(sendableNotification).addListener(new GenericFutureListener<ChannelFuture>() { public void operationComplete(final ChannelFuture writeFuture) { if (writeFuture.isSuccess()) { log.trace("{} successfully wrote notification {}", apnsConnection.name, sendableNotification.getSequenceNumber()); apnsConnection.sentNotificationBuffer.addSentNotification(sendableNotification); } else { log.trace("{} failed to write notification {}", apnsConnection.name, sendableNotification, writeFuture.cause()); apnsConnection.listener.handleWriteFailure(apnsConnection, notification, writeFuture.cause()); } apnsConnection.pendingOperationLock.lock(); try { apnsConnection.pendingOperationCount -= 1; if (apnsConnection.pendingOperationCount == 0) { apnsConnection.pendingOperationsFinished.signalAll(); } } finally { apnsConnection.pendingOperationLock.unlock(); } } }); } finally { this.pendingOperationLock.unlock(); } }

Target:
public void sendNotification(final T notification) { final ApnsConnection<T> apnsConnection = this; if (this.channel == null) { throw new IllegalStateException(String.format("%s has not connected.", this.name)); } this.channel.eventLoop().execute(new Runnable() { public void run() { final SendableApnsPushNotification<T> sendableNotification = new SendableApnsPushNotification<T>(notification, apnsConnection.sequenceNumber++); log.trace("{} sending {}", apnsConnection.name, sendableNotification); apnsConnection.pendingWriteCount += 1; apnsConnection.channel.writeAndFlush(sendableNotification).addListener(new GenericFutureListener<ChannelFuture>() { public void operationComplete(final ChannelFuture writeFuture) { if (writeFuture.isSuccess()) { log.trace("{} successfully wrote notification {}", apnsConnection.name, sendableNotification.getSequenceNumber()); if (apnsConnection.rejectionReceived) { apnsConnection.listener.handleUnprocessedNotifications(apnsConnection, java.util.Collections.singletonList(notification)); } else { apnsConnection.sentNotificationBuffer.addSentNotification(sendableNotification); } } else { log.trace("{} failed to write notification {}", apnsConnection.name, sendableNotification, writeFuture.cause()); apnsConnection.listener.handleWriteFailure(apnsConnection, notification, writeFuture.cause()); } apnsConnection.pendingWriteCount -= 1; assert apnsConnection.pendingWriteCount >= 0; if (apnsConnection.pendingWriteCount == 0) { synchronized (apnsConnection.pendingWriteMonitor) { apnsConnection.pendingWriteMonitor.notifyAll(); } } } }); } }); }
Source:
protected String typeAheadNameTemplateNullSafe(String name) { if (name != null && !name.trim().isEmpty()) { return templates.typeAheadName(name).asString(); } else { return templates.typeAheadEmptyContent().asString(); } }

Target:
protected String typeAheadNameTemplateNullSafe(String name) { if (StringUtils.isNotEmpty(name)) { return templates.typeAheadName(name).asString(); } else { return templates.typeAheadEmptyContent().asString(); } }
Source:
public void execute(Tuple tuple) { tuplesReceived++; String streamID = tuple.getSourceStreamId(); LOG.info("Received a tuple: " + tuple + " ; from: " + streamID); if (streamID.equals(Constants.INTEGRATION_TEST_CONTROL_STREAM_ID)) { terminalsToReceive--; if (terminalsToReceive == 0) { if (IBatchBolt.class.isInstance(delegateBolt)) { LOG.fine("Invoke bolt to do finishBatch!"); ((IBatchBolt) delegateBolt).finishBatch(); } LOG.info("Populating the terminals to downstream"); collector.emit(Constants.INTEGRATION_TEST_CONTROL_STREAM_ID, tuple, new Values(Constants.INTEGRATION_TEST_TERMINAL)); } else { LOG.info(String.format( "Received a terminals, waiting to receive %s more", terminalsToReceive)); } } else { currentTupleProcessing = tuple; delegateBolt.execute(tuple); collector.ack(tuple); } }

Target:
public void execute(Tuple tuple) { tuplesReceived++; String streamID = tuple.getSourceStreamId(); LOG.info("Received a tuple: " + tuple + " ; from: " + streamID); if (streamID.equals(Constants.INTEGRATION_TEST_CONTROL_STREAM_ID)) { terminalsToReceive--; if (terminalsToReceive == 0) { if (IBatchBolt.class.isInstance(delegateBolt)) { LOG.fine("Invoke bolt to do finishBatch!"); ((IBatchBolt) delegateBolt).finishBatch(); } LOG.info("Received the last terminal, populating the terminals to downstream"); collector.emit(Constants.INTEGRATION_TEST_CONTROL_STREAM_ID, tuple, new Values(Constants.INTEGRATION_TEST_TERMINAL)); } else { LOG.info(String.format( "Received a terminal, need to receive %s more", terminalsToReceive)); } } else { currentTupleProcessing = tuple; delegateBolt.execute(tuple); collector.ack(tuple); } }
Source:
public static String generateSetupId() { String setupId = "" + ALPHA_NUMERIC_STRING.charAt((int) (Math.random() * ALPHA_NUMERIC_STRING.length())) + ALPHA_NUMERIC_STRING.charAt((int) (Math.random() * ALPHA_NUMERIC_STRING.length())) + ALPHA_NUMERIC_STRING.charAt((int) (Math.random() * ALPHA_NUMERIC_STRING.length())) + ALPHA_NUMERIC_STRING.charAt((int) (Math.random() * ALPHA_NUMERIC_STRING.length())); return setupId; }

Target:
public static String generateSetupId() { return randomAlphaNumeric(4); }
Source:
public void hook(ExtensionHook extensionHook) { super.hook(extensionHook); API.getInstance().registerApiImplementor(new CodeDxAPI(this)); if (getView() != null) { extensionHook.getHookMenu().addReportMenuItem(getUploadMenu()); extensionHook.getHookMenu().addReportMenuItem(getExportMenu()); } }

Target:
public void hook(ExtensionHook extensionHook) { super.hook(extensionHook); cdxAPIImpl = new CodeDxAPI(this); API.getInstance().registerApiImplementor(cdxAPIImpl); if (getView() != null) { extensionHook.getHookMenu().addReportMenuItem(getUploadMenu()); extensionHook.getHookMenu().addReportMenuItem(getExportMenu()); } }
Source:
public void shouldReturnEmptyArray_whenGetSubcommandSpecified() { List<Slowlog> actualResult = jedis.slowlogGet(); assertThat(actualResult.size()).isEqualTo(0); }

Target:
public void shouldReturnEmptyArray_whenGetSubcommandSpecified() { List<Slowlog> actualResult = jedis.slowlogGet(); assertThat(actualResult.isEmpty()); }
Source:
protected void executeCommand() { beforeUpdate(); removeQuotaFromCache(); setQuotaParameter(); QuotaDAO dao = getQuotaDAO(); dao.update(getParameters().getQuota()); getReturnValue().setSucceeded(true); afterUpdate(); }

Target:
protected void executeCommand() { removeQuotaFromCache(); setQuotaParameter(); QuotaDAO dao = getQuotaDAO(); dao.update(getParameters().getQuota()); getReturnValue().setSucceeded(true); afterUpdate(); }
Source:
public byte[] getSourceIpAddress() { @SuppressWarnings("null") @NonNull byte[] ip = Arrays.copyOf(fSourceIpAddress, fSourceIpAddress.length); return ip; }

Target:
public Inet4Address getSourceIpAddress() { return fSourceIpAddress; }
Source:
protected void initGroups(Class<? extends ITestOrConfiguration> annotationClass) { ITestOrConfiguration annotation = getAnnotationFinder().findAnnotation(getConstructorOrMethod(), annotationClass); ITestOrConfiguration classAnnotation; Object object = getInstance(); if (object == null) { classAnnotation = getAnnotationFinder() .findAnnotation(getConstructorOrMethod().getDeclaringClass(), annotationClass); } else { classAnnotation = getAnnotationFinder().findAnnotation(object.getClass(), annotationClass); } setGroups( getStringArray( null != annotation ? annotation.getGroups() : null, null != classAnnotation ? classAnnotation.getGroups() : null)); initRestOfGroupDependencies(annotationClass); }

Target:
protected void initGroups(Class<? extends ITestOrConfiguration> annotationClass) { ITestOrConfiguration annotation = getAnnotationFinder().findAnnotation(getConstructorOrMethod(), annotationClass); Object object = getInstance(); Class<?> clazz = getConstructorOrMethod().getDeclaringClass(); if (object != null) { clazz = object.getClass(); } ITestOrConfiguration classAnnotation = getAnnotationFinder().findAnnotation(clazz, annotationClass); setGroups( getStringArray( null != annotation ? annotation.getGroups() : null, null != classAnnotation ? classAnnotation.getGroups() : null)); initRestOfGroupDependencies(annotationClass); }
Source:
public static void writeObjectToConfAsBase64(String key, Object obj, Configuration conf) throws IOException { try(ByteArrayOutputStream baos = new ByteArrayOutputStream()) { try (GZIPOutputStream gos = new GZIPOutputStream(baos)) { try (ObjectOutputStream oos = new ObjectOutputStream(gos)) { oos.writeObject(obj); } } conf.set(key, new String(Base64.encodeBase64(baos.toByteArray()), StandardCharsets.UTF_8)); } }

Target:
public static void writeObjectToConfAsBase64(String key, Object obj, Configuration conf) throws IOException { try(ByteArrayOutputStream baos = new ByteArrayOutputStream()) { try(GZIPOutputStream gos = new GZIPOutputStream(baos); ObjectOutputStream oos = new ObjectOutputStream(gos)) { oos.writeObject(obj); } conf.set(key, new String(Base64.encodeBase64(baos.toByteArray()), StandardCharsets.UTF_8)); } }
Source:
public Object[] getChildren(Object parentElement) { RepositoryTreeNode node = (RepositoryTreeNode) parentElement; Repository repo = node.getRepository(); switch (node.getType()) { case BRANCHES: List<RepositoryTreeNode<Ref>> refs = new ArrayList<RepositoryTreeNode<Ref>>(); Repository rep = node.getRepository(); for (Map.Entry<String, Ref> ref : rep.getAllRefs().entrySet()) { refs.add(new RepositoryTreeNode<Ref>(node, RepositoryTreeNodeType.REF, repo, ref.getValue())); } return refs.toArray(); case REPO: List<RepositoryTreeNode<Repository>> branches = new ArrayList<RepositoryTreeNode<Repository>>(); branches.add(new RepositoryTreeNode<Repository>(node, RepositoryTreeNodeType.BRANCHES, node.getRepository(), node.getRepository())); branches.add(new RepositoryTreeNode<Repository>(node, RepositoryTreeNodeType.PROJECTS, node.getRepository(), node.getRepository())); return branches.toArray(); case PROJECTS: List<RepositoryTreeNode<File>> projects = new ArrayList<RepositoryTreeNode<File>>(); Collection<File> result = new HashSet<File>(); Set<String> traversed = new HashSet<String>(); collectProjectFilesFromDirectory(result, repo.getDirectory() .getParentFile(), traversed, new NullProgressMonitor()); for (File file : result) { projects.add(new RepositoryTreeNode<File>(node, RepositoryTreeNodeType.PROJ, repo, file)); } return projects.toArray(); default: return null; } }

Target:
public Object[] getChildren(Object parentElement) { RepositoryTreeNode node = (RepositoryTreeNode) parentElement; Repository repo = node.getRepository(); switch (node.getType()) { case BRANCHES: List<RepositoryTreeNode<Ref>> refs = new ArrayList<RepositoryTreeNode<Ref>>(); Repository rep = node.getRepository(); for (Ref ref : rep.getAllRefs().values()) { refs.add(new RepositoryTreeNode<Ref>(node, RepositoryTreeNodeType.REF, repo, ref)); } return refs.toArray(); case REPO: List<RepositoryTreeNode<Repository>> branches = new ArrayList<RepositoryTreeNode<Repository>>(); branches.add(new RepositoryTreeNode<Repository>(node, RepositoryTreeNodeType.BRANCHES, node.getRepository(), node.getRepository())); branches.add(new RepositoryTreeNode<Repository>(node, RepositoryTreeNodeType.PROJECTS, node.getRepository(), node.getRepository())); return branches.toArray(); case PROJECTS: List<RepositoryTreeNode<File>> projects = new ArrayList<RepositoryTreeNode<File>>(); Collection<File> result = new HashSet<File>(); Set<String> traversed = new HashSet<String>(); collectProjectFilesFromDirectory(result, repo.getDirectory() .getParentFile(), traversed, new NullProgressMonitor()); for (File file : result) { projects.add(new RepositoryTreeNode<File>(node, RepositoryTreeNodeType.PROJ, repo, file)); } Comparator<RepositoryTreeNode<File>> sorter = new Comparator<RepositoryTreeNode<File>>() { public int compare(RepositoryTreeNode<File> o1, RepositoryTreeNode<File> o2) { return o1.getObject().getName().compareTo( o2.getObject().getName()); } }; Collections.sort(projects, sorter); return projects.toArray(); default: return null; } }
Source:
public Status update(String table, String key, HashMap<String, ByteIterator> values) { try { SolrInputDocument updatedDoc = new SolrInputDocument(); updatedDoc.addField("id", key); for (Entry<String, String> entry : StringByteIterator.getStringMap(values).entrySet()) { Map<String, Object> fieldModifier = new HashMap<>(1); fieldModifier.put("set", entry.getValue()); updatedDoc.addField(entry.getKey(), fieldModifier); } UpdateResponse writeResponse; if (batchMode) { writeResponse = client.add(table, updatedDoc, commitTime); } else { writeResponse = client.add(table, updatedDoc); client.commit(table); } return checkStatus(writeResponse.getStatus()); } catch (IOException | SolrServerException e) { e.printStackTrace(); } return Status.ERROR; }

Target:
public Status update(String table, String key, HashMap<String, ByteIterator> values) { try { SolrInputDocument updatedDoc = new SolrInputDocument(); updatedDoc.addField("id", key); for (Entry<String, String> entry : StringByteIterator.getStringMap(values).entrySet()) { updatedDoc.addField(entry.getKey(), Collections.singletonMap("set", entry.getValue())); } UpdateResponse writeResponse; if (batchMode) { writeResponse = client.add(table, updatedDoc, commitTime); } else { writeResponse = client.add(table, updatedDoc); client.commit(table); } return checkStatus(writeResponse.getStatus()); } catch (IOException | SolrServerException e) { e.printStackTrace(); } return Status.ERROR; }
Source:
public void onSuccess(final LoginResult loginResult) { GraphRequest request = GraphRequest.newMeRequest( loginResult.getAccessToken(), new GraphRequest.GraphJSONObjectCallback() { @Override public void onCompleted(JSONObject object, GraphResponse response) { FacebookRequestError requestError = response.getError(); if (requestError != null) { Log.e(TAG, "Received Facebook error: " + requestError.getErrorMessage()); onFailure(); return; } if (object == null) { Log.w(TAG, "Received null response from Facebook GraphRequest"); onFailure(); } else { String email = null; String name = null; Uri photoUri = null; try { email = object.getString("email"); } catch (JSONException ignored) { } try { name = object.getString("name"); } catch (JSONException ignored) { } try { photoUri = Uri.parse(object.getJSONObject("picture") .getJSONObject("data") .getString("url")); } catch (JSONException ignored) { } onSuccess(loginResult, email, name, photoUri); } } }); Bundle parameters = new Bundle(); parameters.putString("fields", "id,name,email,picture"); request.setParameters(parameters); request.executeAsync(); }

Target:
public void onSuccess(final LoginResult loginResult) { GraphRequest request = GraphRequest.newMeRequest( loginResult.getAccessToken(), new GraphRequest.GraphJSONObjectCallback() { @Override public void onCompleted(JSONObject object, GraphResponse response) { FacebookRequestError requestError = response.getError(); if (requestError != null) { Log.e(TAG, "Received Facebook error: " + requestError.getErrorMessage()); onFailure(); return; } if (object == null) { Log.w(TAG, "Received null response from Facebook GraphRequest"); onFailure(); } else { String email = null; String name = null; Uri photoUri = null; try { email = object.getString("email"); } catch (JSONException e) { Log.e(TAG, "Failure retrieving Facebook email", e); } try { name = object.getString("name"); } catch (JSONException ignored) try { photoUri = Uri.parse(object.getJSONObject("picture") .getJSONObject("data") .getString("url")); } catch (JSONException ignored) onSuccess(loginResult, email, name, photoUri); } } }); Bundle parameters = new Bundle(); parameters.putString("fields", "id,name,email,picture"); request.setParameters(parameters); request.executeAsync(); }
Source:
private TypeDefinition buildProtobufTypeDefinition(Class<?> clazz, GeneratedMessageV3.Builder builder, Map<Class<?>, TypeDefinition> typeCache) { TypeDefinition typeDefinition = new TypeDefinition(clazz.getName()); if (builder == null) { return typeDefinition; } Map<String, TypeDefinition> properties = new HashMap(); Method[] methods = builder.getClass().getDeclaredMethods(); for (Method method : methods) { String methodName = method.getName(); if (isSimplePropertySettingMethod(method)) { properties.put(generateSimpleFiledName(methodName), TypeDefinitionBuilder.build(method.getGenericParameterTypes()[0], method.getParameterTypes()[0], typeCache)); continue; } else if (isMapPropertySettingMethod(method)) { Type type = method.getGenericParameterTypes()[0]; String fieldName = generateMapFieldName(methodName); validateMapType(fieldName, type.toString()); properties.put(fieldName, TypeDefinitionBuilder.build(type, method.getParameterTypes()[0], typeCache)); continue; } else if (isListPropertySettingMethod(method)) { Type type = method.getGenericReturnType(); String fieldName = generateListFieldName(methodName); validateListType(fieldName, type.toString()); TypeDefinition td; if (ProtocolStringList.class.isAssignableFrom(method.getReturnType())) { td = TypeDefinitionBuilder.build(STRING_LIST_TYPE, List.class, typeCache); } else { td = TypeDefinitionBuilder.build(type, method.getReturnType(), typeCache); } properties.put(fieldName, td); continue; } } typeDefinition.setProperties(properties); typeCache.put(clazz, typeDefinition); return typeDefinition; }

Target:
private TypeDefinition buildProtobufTypeDefinition(Class<?> clazz, GeneratedMessageV3.Builder builder, Map<Class<?>, TypeDefinition> typeCache) { TypeDefinition typeDefinition = new TypeDefinition(clazz.getName()); if (builder == null) { return typeDefinition; } Map<String, TypeDefinition> properties = new HashMap<>(); Method[] methods = builder.getClass().getDeclaredMethods(); for (Method method : methods) { String methodName = method.getName(); if (isSimplePropertySettingMethod(method)) { properties.put(generateSimpleFiledName(methodName), TypeDefinitionBuilder.build(method.getGenericParameterTypes()[0], method.getParameterTypes()[0], typeCache)); } else if (isMapPropertySettingMethod(method)) { Type type = method.getGenericParameterTypes()[0]; String fieldName = generateMapFieldName(methodName); validateMapType(fieldName, type.toString()); properties.put(fieldName, TypeDefinitionBuilder.build(type, method.getParameterTypes()[0], typeCache)); } else if (isListPropertySettingMethod(method)) { Type type = method.getGenericReturnType(); String fieldName = generateListFieldName(methodName); validateListType(fieldName, type.toString()); TypeDefinition td; if (ProtocolStringList.class.isAssignableFrom(method.getReturnType())) { td = TypeDefinitionBuilder.build(STRING_LIST_TYPE, List.class, typeCache); } else { td = TypeDefinitionBuilder.build(type, method.getReturnType(), typeCache); } properties.put(fieldName, td); } } typeDefinition.setProperties(properties); typeCache.put(clazz, typeDefinition); return typeDefinition; }
Source:
public void commitMarker(int count) throws IOException { String key = TxConstants.TransactionLog.NUM_ENTRIES_APPENDED; internalWriter.appendRaw(key.getBytes(), 0, key.getBytes().length, new CommitEntriesCount(count)); }

Target:
public void commitMarker(int count) throws IOException { CommitMarkerCodec.writeMarker(internalWriter, count); }
Source:
void removeWatchers() { HashSet<WrappedWatcher> localEntries; synchronized(this) { localEntries = Sets.newHashSet(entries); } for ( WrappedWatcher entry : localEntries ) { try { log.debug("Removing watcher for path: " + entry.path); RemoveWatchesBuilderImpl builder = new RemoveWatchesBuilderImpl(client); builder.prepInternalRemoval(entry); builder.pathInForeground(entry.path); } catch ( Exception e ) { log.error("Could not remove watcher for path: " + entry.path); } } }

Target:
void removeWatchers() { HashSet<WrappedWatcher> localEntries; synchronized(this) { localEntries = Sets.newHashSet(entries); } for ( WrappedWatcher entry : localEntries ) { try { log.debug("Removing watcher for path: " + entry.path); RemoveWatchesBuilderImpl builder = new RemoveWatchesBuilderImpl(client); builder.internalRemoval(entry, entry.path); } catch ( Exception e ) { log.error("Could not remove watcher for path: " + entry.path); } } }
Source:
protected boolean set(TileEntityStructure container, Map<Key<?>, Object> map) { @Nullable String author = (String) map.get(Keys.STRUCTURE_AUTHOR); if (author != null) { ((IMixinTileEntityStructure) container).setAuthor(author); } @Nullable Boolean ignoreEntities = (Boolean) map.get(Keys.STRUCTURE_IGNORE_ENTITIES); if (ignoreEntities != null) { container.setIgnoresEntities(ignoreEntities); } @Nullable Float integrity = (Float) map.get(Keys.STRUCTURE_INTEGRITY); if (integrity != null) { container.setIntegrity(integrity); } @Nullable StructureMode mode = (StructureMode) map.get(Keys.STRUCTURE_MODE); if (mode != null) { ((IMixinTileEntityStructure) container).setMode(mode); } @Nullable Vector3i position = (Vector3i) map.get(Keys.STRUCTURE_POSITION); if (position != null) { ((IMixinTileEntityStructure) container).setPosition(position); } @Nullable Boolean powered = (Boolean) map.get(Keys.STRUCTURE_POWERED); if (powered != null) { container.setPowered(powered); } @Nullable Long seed = (Long) map.get(Keys.STRUCTURE_SEED); if (seed != null) { container.setSeed(seed); } @Nullable Boolean showAir = (Boolean) map.get(Keys.STRUCTURE_SHOW_AIR); if (showAir != null) { container.setShowAir(showAir); } @Nullable Boolean showBoundingBox = (Boolean) map.get(Keys.STRUCTURE_SHOW_BOUNDING_BOX); if (showBoundingBox != null) { container.setShowBoundingBox(showBoundingBox); } @Nullable Vector3i size = (Vector3i) map.get(Keys.STRUCTURE_SIZE); if (size != null) { ((IMixinTileEntityStructure) container).setSize(size); } return true; }

Target:
protected boolean set(TileEntityStructure container, Map<Key<?>, Object> map) { @Nullable String author = (String) map.get(Keys.STRUCTURE_AUTHOR); if (author != null) { ((IMixinTileEntityStructure) container).setAuthor(author); } container.setIgnoresEntities((Boolean) map.get(Keys.STRUCTURE_IGNORE_ENTITIES)); container.setIntegrity((Float) map.get(Keys.STRUCTURE_INTEGRITY)); @Nullable StructureMode mode = (StructureMode) map.get(Keys.STRUCTURE_MODE); if (mode != null) { ((IMixinTileEntityStructure) container).setMode(mode); } @Nullable Vector3i position = (Vector3i) map.get(Keys.STRUCTURE_POSITION); if (position != null) { ((IMixinTileEntityStructure) container).setPosition(position); } container.setPowered((Boolean) map.get(Keys.STRUCTURE_POWERED)); @Nullable Long seed = (Long) map.get(Keys.STRUCTURE_SEED); if (seed != null) { container.setSeed(seed); } container.setShowAir((Boolean) map.get(Keys.STRUCTURE_SHOW_AIR)); container.setShowBoundingBox((Boolean) map.get(Keys.STRUCTURE_SHOW_BOUNDING_BOX)); @Nullable Boolean showBoundingBox = (Boolean) map.get(Keys.STRUCTURE_SHOW_BOUNDING_BOX); if (showBoundingBox != null) { } @Nullable Vector3i size = (Vector3i) map.get(Keys.STRUCTURE_SIZE); if (size != null) { ((IMixinTileEntityStructure) container).setSize(size); } return true; }
Source:
protected void removeTagsFromVm(long vmId) { UserVmVO vm = _vmDao.findById(vmId); Long resourceId = _taggedResourceService.getResourceId(vm.getUuid(), ResourceTag.ResourceObjectType.UserVm); List<? extends ResourceTag> resourceTags = _taggedResourceService.listByResourceTypeAndId(ResourceTag.ResourceObjectType.UserVm, resourceId); if (resourceTags.size() > 0) { List<String> resourceIds = Arrays.asList(vm.getUuid()); Map<String, String> tags = new HashMap<>(); _taggedResourceService.deleteTags(resourceIds, ResourceTag.ResourceObjectType.UserVm, tags); s_logger.debug("Tags from vm id: " + vmId + " has been removed."); } }

Target:
protected void removeTagsFromVm(long vmId) { UserVmVO vm = _vmDao.findById(vmId); Long resourceId = _taggedResourceService.getResourceId(vm.getUuid(), ResourceTag.ResourceObjectType.UserVm); List<? extends ResourceTag> resourceTags = _taggedResourceService.listByResourceTypeAndId(ResourceTag.ResourceObjectType.UserVm, resourceId); if (resourceTags.size() > 0) { List<String> resourceIds = Arrays.asList(vm.getUuid()); _taggedResourceService.deleteTags(resourceIds, ResourceTag.ResourceObjectType.UserVm, null); } }
Source:
public List<EventTypeAuthorizationAttribute> getAdmins() { return admins == null ? null : Collections.unmodifiableList(admins); }

Target:
public List<AuthorizationAttribute> getAdmins() { return admins; }
Source:
public void setStackName(String stackName) { WebElement stackNameField = seleniumWebDriverHelper.waitVisibility(By.name(Locators.NEW_STACK_NAME)); stackNameField.click(); stackNameField.clear(); stackNameField.sendKeys(stackName); WaitUtils.sleepQuietly(1); }

Target:
public void setStackName(String stackName) { seleniumWebDriverHelper.waitAndClick(stackNameField); seleniumWebDriverHelper.setValue(stackNameField, stackName); }
Source:
protected CourseAttributes makeAttributes(Course entity) { Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, entity); return CourseAttributes.builder(entity.getUniqueId(), entity.getName(), ZoneId.of(entity.getTimeZone())) .withCreatedAt(entity.getCreatedAt()).build(); }

Target:
protected CourseAttributes makeAttributes(Course entity) { Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, entity); ZoneId courseTimeZone; try { courseTimeZone = ZoneId.of(entity.getTimeZone()); } catch (DateTimeException e) { log.severe("Timezone '" + entity.getTimeZone() + "' of course '" + entity.getUniqueId() + "' is not supported. UTC will be used instead."); courseTimeZone = ZoneId.of("UTC"); } return CourseAttributes.builder(entity.getUniqueId(), entity.getName(), courseTimeZone) .withCreatedAt(entity.getCreatedAt()).build(); }
Source:
private static String syntheticName(String base) { return "__$$_" + base + "_" + System.currentTimeMillis(); }

Target:
private static String syntheticName(String base) { return "__$$_" + base + "_" + syntheticNameCounter.getAndIncrement(); }
Source:
protected void updateEnablement(IAction action) { boolean enabled = isEnabled(); action.setEnabled(enabled); }

Target:
protected void updateEnablement(IAction action) { action.setEnabled(isEnabled()); }
Source:
private String baseUrl() { try { final ServiceInstance instance = serviceProvider.getInstance(); if (instance == null) { throw new ISE("Cannot find instance of indexingService"); } return String.format("http://%s:%s/mmx/indexer/v1", instance.getAddress(), instance.getPort()); } catch (Exception e) { throw Throwables.propagate(e); } }

Target:
private String baseUrl() { try { final ServiceInstance instance = serviceProvider.getInstance(); if (instance == null) { throw new ISE("Cannot find instance of indexingService"); } return String.format("http://%s:%s/druid/indexer/v1", instance.getAddress(), instance.getPort()); } catch (Exception e) { throw Throwables.propagate(e); } }
Source:
private boolean canChangeDefaultCallScreening() { boolean canChange = false; try { TelecomManager.from(this).isDefaultCallScreeningApp(mNewComponentName); } catch (SecurityException e) { canChange = true; } return canChange; }

Target:
private boolean canChangeDefaultCallScreening() { boolean canChange; String defaultComponentName = Settings.Secure .getStringForUser(getApplicationContext().getContentResolver(), Settings.Secure.CALL_SCREENING_DEFAULT_COMPONENT, UserHandle.USER_CURRENT); ComponentName oldComponentName = TextUtils.isEmpty(defaultComponentName) ? null : ComponentName.unflattenFromString(defaultComponentName); canChange = oldComponentName == null || !oldComponentName.getPackageName() .equals(mNewComponentName.getPackageName()) || !oldComponentName.flattenToString() .equals(mNewComponentName.flattenToString()); return canChange; }
Source:
public void testGroupBy3() throws Exception { QueryFactory qf = getQueryFactory(); Query q = qf.from(getModelFactory().getUserImplClass()) .select("name") .groupBy("name") .orderBy("surname", SortOrder.ASC) .build(); q.list(); }

Target:
public void testGroupBy3() throws Exception { QueryFactory qf = getQueryFactory(); Query q = qf.from(getModelFactory().getUserImplClass()) .select("name") .groupBy("name") .orderBy("surname") .build(); q.list(); }
Source:
public static FileObject getFileObject( String vfsFilename, VariableSpace space, FileSystemOptions fsOptions ) throws KettleFileException { try { FileSystemManager fsManager = getInstance().getFileSystemManager(); boolean relativeFilename = true; String[] initialSchemes = fsManager.getSchemes(); relativeFilename = checkForScheme( initialSchemes, relativeFilename, vfsFilename, space, fsOptions ); int timeOut = timeOutLimit; boolean hasScheme = vfsFilename != null && vfsFilename.contains( "://" ); while ( relativeFilename && hasScheme && timeOut > 0 ) { String[] schemes = fsManager.getSchemes(); try { Thread.sleep( timeToSleepStep ); timeOut -= timeToSleepStep; relativeFilename = checkForScheme( schemes, relativeFilename, vfsFilename, space, fsOptions ); } catch ( InterruptedException e ) { relativeFilename = false; Thread.currentThread().interrupt(); break; } } String filename; if ( vfsFilename.startsWith( "\\\\" ) ) { File file = new File( vfsFilename ); filename = file.toURI().toString(); } else { if ( relativeFilename ) { File file = new File( vfsFilename ); filename = file.getAbsolutePath(); } else { filename = vfsFilename; } } if ( fsOptions != null ) { return fsManager.resolveFile( filename, fsOptions ); } else { return fsManager.resolveFile( filename ); } } catch ( IOException e ) { throw new KettleFileException( "Unable to get VFS File object for filename '" + cleanseFilename( vfsFilename ) + "' : " + e.getMessage(), e ); } }

Target:
public static FileObject getFileObject( String vfsFilename, VariableSpace space, FileSystemOptions fsOptions ) throws KettleFileException { try { fsOptionsForScheme = fsOptions; FileSystemManager fsManager = getInstance().getFileSystemManager(); boolean relativeFilename = true; String[] initialSchemes = fsManager.getSchemes(); relativeFilename = checkForScheme( initialSchemes, relativeFilename, vfsFilename, space, fsOptionsForScheme ); int timeOut = TIMEOUT_LIMIT; boolean hasScheme = vfsFilename != null && vfsFilename.contains( "://" ); while ( relativeFilename && hasScheme && timeOut > 0 ) { String[] schemes = fsManager.getSchemes(); try { Thread.sleep( TIME_TO_SLEEP_STEP ); timeOut -= TIME_TO_SLEEP_STEP; relativeFilename = checkForScheme( schemes, relativeFilename, vfsFilename, space, fsOptionsForScheme ); } catch ( InterruptedException e ) { relativeFilename = false; Thread.currentThread().interrupt(); break; } } String filename; if ( vfsFilename.startsWith( "\\\\" ) ) { File file = new File( vfsFilename ); filename = file.toURI().toString(); } else { if ( relativeFilename ) { File file = new File( vfsFilename ); filename = file.getAbsolutePath(); } else { filename = vfsFilename; } } if ( fsOptionsForScheme != null ) { return fsManager.resolveFile( filename, fsOptionsForScheme ); } else { return fsManager.resolveFile( filename ); } } catch ( IOException e ) { throw new KettleFileException( "Unable to get VFS File object for filename '" + cleanseFilename( vfsFilename ) + "' : " + e.getMessage(), e ); } }
Source:
public static Credential retrieveOverridingCredentialFromProject(AbstractProject project) { Credential overridingCredential = null; DeployitNotifier notifier = retrieveDeployitNotifierFromProject(project); if (null != notifier) { overridingCredential = notifier.getOverridingCredential(); if ((null == overridingCredential.getUsername() || "".equals(overridingCredential.getUsername())) && null != overridingCredential.getCredentialsId()) { DeployitNotifier.DeployitDescriptor descriptor = (DeployitNotifier.DeployitDescriptor) notifier.getDescriptor(); String secondaryProxyUrl = overridingCredential.resolveProxyUrl(descriptor.getDeployitClientProxyUrl()); String secondaryServerUrl = overridingCredential.resolveServerUrl(descriptor.getDeployitServerUrl()); SecondaryServerInfo serverInfo = new SecondaryServerInfo(secondaryServerUrl, secondaryProxyUrl); StandardUsernamePasswordCredentials cred = Credential.lookupSystemCredentials(overridingCredential.getCredentialsId(), project); if (null != cred) { overridingCredential = new Credential(overridingCredential.getName(), cred.getUsername(), cred.getPassword(), overridingCredential.getCredentialsId(), serverInfo, false); } } } return overridingCredential; }

Target:
public static Credential retrieveOverridingCredentialFromProject(AbstractProject project) { Credential overridingCredential = null; DeployitNotifier notifier = retrieveDeployitNotifierFromProject(project); if (null != notifier) { overridingCredential = notifier.getOverridingCredential(); if (StringUtils.isEmpty(overridingCredential.getUsername()) && null != overridingCredential.getCredentialsId()) { DeployitDescriptor descriptor = (DeployitDescriptor) notifier.getDescriptor(); String secondaryProxyUrl = overridingCredential.resolveProxyUrl(descriptor.getDeployitClientProxyUrl()); String secondaryServerUrl = overridingCredential.resolveServerUrl(descriptor.getDeployitServerUrl()); SecondaryServerInfo serverInfo = new SecondaryServerInfo(secondaryServerUrl, secondaryProxyUrl); StandardUsernamePasswordCredentials cred = Credential.lookupSystemCredentials(overridingCredential.getCredentialsId(), project); if (null != cred) { overridingCredential = new Credential(overridingCredential.getName(), cred.getUsername(), cred.getPassword(), overridingCredential.getCredentialsId(), serverInfo, false); } } } return overridingCredential; }
Source:
private boolean pluginNotStarted(String pluginId) { if (pluginId != null) { PluginWrapper pluginWrapper = pluginManager.getPlugin(pluginId); if (PluginState.STARTED != pluginWrapper.getPluginState()) { return true; } log.trace("Checking extensions from plugin '{}'", pluginId); } else { log.trace("Checking extensions from classpath"); } return false; }

Target:
private boolean pluginNotStarted(String pluginId) { if (pluginId != null) { PluginWrapper pluginWrapper = pluginManager.getPlugin(pluginId); return PluginState.STARTED != pluginWrapper.getPluginState(); } return false; }
Source:
public void setApiUrl(String apiUrl) { if (custom) { this.apiUrl = defaultIfBlank(apiUrl, GITHUB_URL); } else { this.apiUrl = GITHUB_URL; } }

Target:
public void setApiUrl(String apiUrl) { if (customApiUrl) { this.apiUrl = defaultIfBlank(apiUrl, GITHUB_URL); } else { this.apiUrl = GITHUB_URL; } }
Source:
public List<InetAddress> lookup(String hostname) throws UnknownHostException { Domain domain = new Domain(hostname); List<InetAddress> inetAddressList = null; try { inetAddressList = Arrays.asList(dnsManager.queryInetAdress(domain)); } catch (IOException ignored) { } return inetAddressList; }

Target:
public List<IDnsNetworkAddress> lookup(String hostname) throws UnknownHostException { Domain domain = new Domain(hostname); List<IDnsNetworkAddress> addressList = null; try { Record[] records = dnsManager.queryRecords(domain); if (records != null && records.length > 0){ addressList = new ArrayList<>(); for (Record record : records) { String source = ""; if (record.source == Record.Source.System) { source = "system"; } else if (record.source == Record.Source.DnspodFree || record.source == Record.Source.DnspodEnterprise) { source = "httpdns"; } else if (record.source == Record.Source.Unknown) { source = "none"; } else { source = "customized"; } DnsNetworkAddress address = new DnsNetworkAddress(hostname, record.value, (long)record.ttl, source, record.timeStamp); addressList.add(address); } } } catch (IOException ignored) { } return addressList; }
Source:
public GHMatrixResponse calculateMatrix(GHMatrixRequest request){ AlgorithmOptions.Builder algoOptsBuilder = buildOptions(request, hopper); AlgorithmOptions tmpOptions = algoOptsBuilder.build(); Graph routingGraph = hopper.getGraphHopperStorage(); if(hopper.isCHEnabled()) { routingGraph = hopper.getGraphHopperStorage().getGraph(CHGraph.class, tmpOptions.getWeighting()); } QueryGraph queryGraph = new QueryGraph(routingGraph); Weighting weighting = hopper.createTurnWeighting(tmpOptions.getWeighting(), queryGraph, tmpOptions.getFlagEncoder()); AlgorithmOptions algoOpts = algoOptsBuilder.weighting(weighting).build(); List<QueryResult> originQNodes = lookupNodes(request.getOrigins(), algoOpts.getFlagEncoder()); List<QueryResult> destinationQNodes = lookupNodes(request.getDestinations(), algoOpts.getFlagEncoder()); List<QueryResult> merged = new ArrayList<>(originQNodes); merged.addAll(destinationQNodes); queryGraph.lookup(merged); List<Integer> originNodes = mapToNodes(originQNodes); List<Integer> destinationNodes = mapToNodes(destinationQNodes); MatrixAlgorithm algorithm = matrixAlgorithmFactory.build(queryGraph, algoOpts); DistanceMatrix matrix = algorithm.calcMatrix(originNodes, destinationNodes); GHMatrixResponse response = toResponse(matrix, request); return response; }

Target:
public GHMatrixResponse calculateMatrix(GHMatrixRequest request){ AlgorithmOptions.Builder algoOptsBuilder = buildOptions(request, hopper); AlgorithmOptions tmpOptions = algoOptsBuilder.build(); Graph routingGraph = hopper.getGraphHopperStorage(); if(hopper.isCHEnabled()) { routingGraph = hopper.getGraphHopperStorage().getGraph(CHGraph.class, tmpOptions.getWeighting()); } QueryGraph queryGraph = new QueryGraph(routingGraph); Weighting weighting = hopper.createTurnWeighting( queryGraph, tmpOptions.getFlagEncoder(), tmpOptions.getWeighting(), tmpOptions.getTraversalMode()); AlgorithmOptions algoOpts = algoOptsBuilder.weighting(weighting).build(); List<QueryResult> originQNodes = lookupNodes(request.getOrigins(), algoOpts.getFlagEncoder()); List<QueryResult> destinationQNodes = lookupNodes(request.getDestinations(), algoOpts.getFlagEncoder()); List<QueryResult> merged = new ArrayList<>(originQNodes); merged.addAll(destinationQNodes); queryGraph.lookup(merged); int[] originNodes = mapToNodes(originQNodes); int[] destinationNodes = mapToNodes(destinationQNodes); MatrixAlgorithm algorithm = matrixAlgorithmFactory.createAlgo(queryGraph, algoOpts); DistanceMatrix matrix = algorithm.calcMatrix(originNodes, destinationNodes); GHMatrixResponse response = toResponse(matrix, request); return response; }
Source:
private FirmwareProvider createFirmwareProvider(Firmware... firmwares) { return new FirmwareProvider() { @Override public Set<Firmware> getFirmwares(ThingTypeUID thingTypeUID, Locale locale) { if (thingTypeUID.equals(thingType.getUID())) { return new HashSet<>(Arrays.asList(firmwares)); } else { return new HashSet<>(); } } @Override public Set<Firmware> getFirmwares(ThingTypeUID thingTypeUID) { return getFirmwares(thingTypeUID, null); } @Override public Firmware getFirmware(FirmwareUID firmwareUID, Locale locale) { for (Firmware firmware : getFirmwares(firmwareUID.getThingTypeUID(), locale)) { if (firmware.getUID().equals(firmwareUID)) { return firmware; } } return null; } @Override public Firmware getFirmware(FirmwareUID firmwareUID) { return getFirmware(firmwareUID, null); } }; }

Target:
private FirmwareProvider createFirmwareProvider(Firmware... firmwares) { return new FirmwareProvider() { @Override public Set<Firmware> getFirmwares(ThingTypeUID thingTypeUID, Locale locale) { if (thingTypeUID.equals(thingType.getUID())) { return new HashSet<>(Arrays.asList(firmwares)); } else { return Collections.emptySet(); } } @Override public Set<Firmware> getFirmwares(ThingTypeUID thingTypeUID) { return getFirmwares(thingTypeUID, null); } @Override public Firmware getFirmware(FirmwareUID firmwareUID, Locale locale) { for (Firmware firmware : getFirmwares(firmwareUID.getThingTypeUID(), locale)) { if (firmware.getUID().equals(firmwareUID)) { return firmware; } } return null; } @Override public Firmware getFirmware(FirmwareUID firmwareUID) { return getFirmware(firmwareUID, null); } }; }
Source:
public V get(Object key) { if (singleKey != null) return singleKey.equals(key) ? singleValue : null; if (inner != null) return inner.get(key); return null; }

Target:
public V get(Object key) { switch (type) { case EMPTY: return null; case SINGLE: return key == null ? (singleKey == null ? singleValue : null) : (key.equals(singleKey) ? singleValue : null); case MAP: return inner.get(key); } throw new IllegalStateException(); }
Source:
protected void onDraw(Canvas canvas) { super.onDraw(canvas); float centerX = mCanvasWidth / 2; float centerY = mCanvasHeight / 2; canvas.drawCircle(centerX, centerY, 0.7f * Math.min(centerX, centerY), mWhitePaint); }

Target:
protected void onDraw(Canvas canvas) { super.onDraw(canvas); final float centerX = mCanvasWidth / 2; final float centerY = mCanvasHeight / 2; final float radius = 0.7f * Math.min(centerX, centerY); canvas.drawCircle(centerX, centerY, radius, mWhitePaint); }
Source:
protected boolean validateVM(VmValidator vmValidator) { return canDoSnapshot(getVm()) && validate(vmValidator.vmNotSavingRestoring()) && validate(vmValidator.vmNotSuspended()); }

Target:
protected boolean validateVM(VmValidator vmValidator) { return canDoSnapshot(getVm()) && validate(vmValidator.vmNotSavingRestoring()) && validate(vmValidator.validateVmStatusUsingMatrix(VdcActionType.CreateAllSnapshotsFromVm)); }
Source:
private void setDepth(N node, N parent) { if (parent == null) { depths.put(node, 0); height = Optional.of(0); } else { int nodeDepth = depths.get(parent) + 1; height = Optional.of(Math.max(nodeDepth, (height.equals(Optional.empty()) ? 0 : height.get()))); depths.put(node, nodeDepth); } }

Target:
private void setDepth(N node, N parent) { if (parent == null) { depths.put(node, 0); height = Optional.of(0); } else { int nodeDepth = depths.get(parent) + 1; height = Optional.of(Math.max(nodeDepth, height.orElse(0))); depths.put(node, nodeDepth); } }
Source:
public FileMode getMode(File f, FS.Attributes attributes) { if (attributes.isSymbolicLink()) return FileMode.SYMLINK; else if (attributes.isDirectory()) { if (new File(f, Constants.DOT_GIT).exists()) return FileMode.GITLINK; else return FileMode.TREE; } else if (attributes.isExecutable()) return FileMode.EXECUTABLE_FILE; else return FileMode.REGULAR_FILE; }

Target:
public FileMode getMode(File f, FS.Attributes attributes) { if (attributes.isSymbolicLink()) { return FileMode.SYMLINK; } else if (attributes.isDirectory()) { if (new File(f, Constants.DOT_GIT).exists()) { return FileMode.GITLINK; } else { return FileMode.TREE; } } else if (attributes.isExecutable()) { return FileMode.EXECUTABLE_FILE; } else { return FileMode.REGULAR_FILE; } }
Source:
public AddDeviceResponse getSetConfigurationObjectResponse( @OrganisationIdentification final String organisationIdentification, @RequestPayload final AddDeviceAsyncRequest request) throws OsgpException { final MeterResponseData meterResponseData = this.installationService.dequeueAddSmartMeterResponse(request .getCorrelationUid()); final AddDeviceResponse response = new AddDeviceResponse(); if (meterResponseData != null) { response.setResult(OsgpResultType.fromValue(meterResponseData.getResultType().getValue())); if (meterResponseData.getMessageData() instanceof String) { response.setDescription((String) meterResponseData.getMessageData()); } } else { response.setResult(OsgpResultType.NOT_FOUND); } return response; }

Target:
public AddDeviceResponse getSetConfigurationObjectResponse( @OrganisationIdentification final String organisationIdentification, @RequestPayload final AddDeviceAsyncRequest request) { final AddDeviceResponse response = new AddDeviceResponse(); try { final MeterResponseData meterResponseData = this.installationService.dequeueAddSmartMeterResponse(request .getCorrelationUid()); response.setResult(OsgpResultType.fromValue(meterResponseData.getResultType().getValue())); if (meterResponseData.getMessageData() instanceof String) { response.setDescription((String) meterResponseData.getMessageData()); } } catch (final FunctionalException e) { if (e.getExceptionType() == FunctionalExceptionType.UNKNOWN_CORRELATION_UID) { response.setResult(OsgpResultType.NOT_FOUND); } else { response.setResult(OsgpResultType.NOT_OK); } } return response; }
Source:
private void createXsToolsISO() { VMTemplateVO tmplt = _tmpltDao.findByTemplateName(_toolsIsoName); Long id; if (tmplt == null) { id = _tmpltDao.getNextInSequence(Long.class, "id"); VMTemplateVO template = VMTemplateVO.createPreHostIso(id, _toolsIsoName, _toolsIsoName, ImageFormat.ISO, true, true, TemplateType.PERHOST, null, null, true, 64, Account.ACCOUNT_ID_SYSTEM, null, "xen-pv-drv-iso", false, 1, false, HypervisorType.XenServer); _tmpltDao.persist(template); } else { id = tmplt.getId(); tmplt.setTemplateType(TemplateType.PERHOST); tmplt.setUrl(null); _tmpltDao.update(id, tmplt); } }

Target:
private void createXsToolsISO() { String isoName = "xs-tools.iso"; VMTemplateVO tmplt = _tmpltDao.findByTemplateName(isoName); Long id; if (tmplt == null) { id = _tmpltDao.getNextInSequence(Long.class, "id"); VMTemplateVO template = VMTemplateVO.createPreHostIso(id, isoName, isoName, ImageFormat.ISO, true, true, TemplateType.PERHOST, null, null, true, 64, Account.ACCOUNT_ID_SYSTEM, null, "XenServer Tools Installer ISO (xen-pv-drv-iso)", false, 1, false, HypervisorType.XenServer); _tmpltDao.persist(template); } else { id = tmplt.getId(); tmplt.setTemplateType(TemplateType.PERHOST); tmplt.setUrl(null); _tmpltDao.update(id, tmplt); } }
Source:
public static ExtensionInfo fromPacketExtInfo(PacketExtInfo packetExtInfo) { String rawAlgs = packetExtInfo.getExtNameToValue().get("server-sig-algs"); if (rawAlgs == null) { return new ExtensionInfo(Collections.emptySet()); } Set<String> algsSet = new HashSet<>(); Collections.addAll(algsSet, rawAlgs.split(",")); return new ExtensionInfo(algsSet); }

Target:
public static ExtensionInfo fromPacketExtInfo(PacketExtInfo packetExtInfo) { String rawAlgs = packetExtInfo.getExtNameToValue().get("server-sig-algs"); if (rawAlgs == null) { return new ExtensionInfo(Collections.<String>emptySet()); } Set<String> algsSet = new HashSet<>(); Collections.addAll(algsSet, rawAlgs.split(",")); return new ExtensionInfo(algsSet); }
Source:
SuggestReviewerInfo(GroupBaseInfo g) { this.account = null; this.group = g; }

Target:
SuggestReviewerInfo(GroupBaseInfo g) { this.group = g; }
Source:
public void setUpClass() throws Exception { Thread.sleep(5000); properties.setProperty("server.ip", "localhost"); properties.setProperty("server.port", aerospikeContainer.getMappedPort(3000).toString()); }

Target:
public void setUpClass() throws Exception { log.info("Setting up Aerospike test driver"); properties.setProperty("gora.aerospikestore.server.ip", "localhost"); properties.setProperty("gora.aerospikestore.server.port", aerospikeContainer.getMappedPort(3000).toString()); }