auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void deleteExistingLinkLocalRouteTable(String linkLocalBr) { Script command = new Script("/bin/bash", _timeout); command.add("-c"); command.add("ip route | grep " + _controlCidr); OutputInterpreter.AllLinesParser parser = new OutputInterpreter.AllLinesParser(); String result = command.execute(parser); boolean foundLinkLocalBr = false; if (result == null && parser.getLines() != null) { String[] lines = parser.getLines().split("\\n"); for (String line : lines) { String[] tokens = line.split(" "); if (tokens != null && tokens.length < 2) { continue; } final String device = tokens[2]; if (!Strings.isNullOrEmpty(device) && !device.equalsIgnoreCase(linkLocalBr)) { Script.runSimpleBashScript("ip route del " + _controlCidr + " dev " + tokens[2]); } else { foundLinkLocalBr = true; } } } if (!foundLinkLocalBr) { Script.runSimpleBashScript("ip address add " + NetUtils.getLinkLocalAddressFromCIDR(_controlCidr) + " dev " + linkLocalBr); Script.runSimpleBashScript("ip route add " + _controlCidr + " dev " + linkLocalBr + " src " + NetUtils.getLinkLocalFirstAddressFromCIDR(_controlCidr)); } }

Target:
private void deleteExistingLinkLocalRouteTable(String linkLocalBr) { Script command = new Script("/bin/bash", _timeout); command.add("-c"); command.add("ip route | grep " + _controlCidr); OutputInterpreter.AllLinesParser parser = new OutputInterpreter.AllLinesParser(); String result = command.execute(parser); boolean foundLinkLocalBr = false; if (result == null && parser.getLines() != null) { String[] lines = parser.getLines().split("\\n"); for (String line : lines) { String[] tokens = line.split(" "); if (tokens != null && tokens.length < 2) { continue; } final String device = tokens[2]; if (!Strings.isNullOrEmpty(device) && !device.equalsIgnoreCase(linkLocalBr)) { Script.runSimpleBashScript("ip route del " + _controlCidr + " dev " + tokens[2]); } else { foundLinkLocalBr = true; } } } if (!foundLinkLocalBr) { Script.runSimpleBashScript("ip address add " + NetUtils.getLinkLocalAddressFromCIDR(_controlCidr) + " dev " + linkLocalBr); Script.runSimpleBashScript("ip route add " + _controlCidr + " dev " + linkLocalBr + " src " + NetUtils.getLinkLocalGateway(_controlCidr)); } }
Source:
public Optional<Response> handleWithObaData(final ObaUserDataItem obaUserDataItem, final ObaUserClient obaUserClient) { try { final ObaStopResponse stop = obaUserClient.getStopDetails(obaUserDataItem.getStopId()); final String stopName = replaceSpecialCharactersFromAddress(stop.getName()); final String speech = promptHelper.getPrompt(GET_STOP, Integer.toString(stop.getCode()), String.format(ADDRESS_SSML_FORMAT, stopName)); StorageUtil.saveOutputForRepeat(speech, obaDao, obaUserDataItem); return promptHelper.getResponse(speech); } catch (IOException e) { log.error(e); throw new OneBusAwayException(promptHelper.getPrompt(COMMUNICATION_ERROR_MESSAGE)); } }

Target:
public Optional<Response> handleWithObaData(final ObaUserDataItem obaUserDataItem, final ObaUserClient obaUserClient) { try { final ObaStopResponse stop = obaUserClient.getStopDetails(obaUserDataItem.getStopId()); final String stopName = replaceSpecialCharactersFromAddress(stop.getName()); final String speech = promptHelper.getPrompt(GET_STOP, stop.getStopCode(), String.format(ADDRESS_SSML_FORMAT, stopName)); StorageUtil.saveOutputForRepeat(speech, obaDao, obaUserDataItem); return promptHelper.getResponse(speech); } catch (IOException e) { log.error(e); throw new OneBusAwayException(promptHelper.getPrompt(COMMUNICATION_ERROR_MESSAGE)); } }
Source:
public void endSpanAmqpException() { final Tracer tracer1 = mock(Tracer.class); List<Tracer> tracers = Arrays.asList(tracer1); final TracerProvider tracerProvider = new TracerProvider(tracers); final Exception exception = new AmqpException(true, ErrorCondition.NOT_FOUND, "", null); Context sendContext = new Context(OPENTELEMETRY_SPAN_KEY, "value"); tracerProvider.endSpan(sendContext, Signal.error(exception)); verify(tracer1, times(1)).end("amqp:not-found", exception, sendContext); }

Target:
public void endSpanAmqpException() { final ErrorCondition errorCondition = ErrorCondition.NOT_FOUND; final Exception exception = new AmqpException(true, errorCondition, "", null); Context sendContext = new Context(OPENTELEMETRY_SPAN_KEY, "value"); tracerProvider.endSpan(sendContext, Signal.error(exception)); for (Tracer t : tracers) { verify(t, times(1)) .end(errorCondition.getErrorCondition(), exception, sendContext); } }
Source:
public List<String> getStudentsWhoResponded() { studentsWhoResponded.sort(compareByTeamNameStudentName); return studentsWhoResponded; }

Target:
public List<String> getStudentsWhoResponded() { return studentsWhoResponded; }
Source:
private IgniteBiTuple<Integer, IgniteBiTuple<Integer, Double>> findBestSplitIndexForFeatures(int featuresCnt, IgniteBiFunction<Integer, Ignite, Object> affinity, UUID trainingUUID) { Set<Integer> featureIndexes = IntStream.range(0, featuresCnt).boxed().collect(Collectors.toSet()); return CacheUtils.reduce(COLUMN_DECISION_TREE_TRAINER_SPLIT_CACHE_NAME, ignite, (Object ctx, Cache.Entry<SplitKey, IgniteBiTuple<Integer, Double>> e, IgniteBiTuple<Integer, IgniteBiTuple<Integer, Double>> r) -> Functions.MAX_GENERIC(new IgniteBiTuple<>(e.getKey().featureIdx(), e.getValue()), r, comparator()), () -> null, () -> SplitCache.localEntries(featureIndexes, affinity, trainingUUID), (i1, i2) -> Functions.MAX_GENERIC(i1, i2, Comparator.comparingDouble(bt -> bt.get2().get2())), () -> new IgniteBiTuple<>(-1, new IgniteBiTuple<>(-1, Double.NEGATIVE_INFINITY)) ); }

Target:
private IgniteBiTuple<Integer, IgniteBiTuple<Integer, Double>> findBestSplitIndexForFeatures(int featuresCnt, IgniteBiFunction<Integer, Ignite, Object> affinity, UUID trainingUUID) { Set<Integer> featureIndexes = IntStream.range(0, featuresCnt).boxed().collect(Collectors.toSet()); return CacheUtils.reduce(SplitCache.CACHE_NAME, ignite, (Object ctx, Cache.Entry<SplitKey, IgniteBiTuple<Integer, Double>> e, IgniteBiTuple<Integer, IgniteBiTuple<Integer, Double>> r) -> Functions.MAX_GENERIC(new IgniteBiTuple<>(e.getKey().featureIdx(), e.getValue()), r, comparator()), () -> null, () -> SplitCache.localEntries(featureIndexes, affinity, trainingUUID), (i1, i2) -> Functions.MAX_GENERIC(i1, i2, Comparator.comparingDouble(bt -> bt.get2().get2())), () -> new IgniteBiTuple<>(-1, new IgniteBiTuple<>(-1, Double.NEGATIVE_INFINITY)) ); }
Source:
public Object addInheritableProperty(String key, Object value) { if (getNonInheritableProperties().containsKey(key)) { final Object oldValue = getNonInheritableProperties().get(key); getNonInheritableProperties().removeKey(key); getInheritableProperties().put(key, value); return oldValue; } return getInheritableProperties().put(key, value); }

Target:
public Object addInheritableProperty(String key, Object value) { if (getNonInheritableProperties().containsKey(key)) { final Object oldValue = getNonInheritableProperties().removeKey(key); getInheritableProperties().put(key, value); return oldValue; } return getInheritableProperties().put(key, value); }
Source:
protected void addMutations(Element element, Mutation... mutations) { _addMutations(getWriterFromElementType(element), mutations); if (isHistoryInSeparateTable()) { _addMutations(getHistoryWriterFromElementType(element), mutations); } }

Target:
protected void addMutations(Element element, Mutation... mutations) { addMutations(ElementType.getTypeFromElement(element), mutations); }
Source:
public void create() { try { serviceLoader.load(PmHealthCheckManager.class); serviceLoader.load(EngineBackupAwarenessManager.class); serviceLoader.load(DataCenterCompatibilityChecker.class); serviceLoader.load(ResourceManager.class); serviceLoader.load(HostDeviceManager.class); serviceLoader.load(IrsProxyManager.class); serviceLoader.load(OvfDataUpdater.class); StoragePoolStatusHandler.init(); serviceLoader.load(GlusterJobsManager.class); resourceManager.get().scheduleJobsForHosts(); try { log.info("Init VM custom properties utilities"); VmPropertiesUtils.getInstance().init(); } catch (InitializationException e) { log.error("Initialization of vm custom properties failed.", e); } try { log.info("Init device custom properties utilities"); DevicePropertiesUtils.getInstance().init(); } catch (InitializationException e) { log.error("Initialization of device custom properties failed.", e); } serviceLoader.load(SchedulingManager.class); sessionDataContainer.cleanupEngineSessionsOnStartup(); serviceLoader.load(HostDeviceManager.class); serviceLoader.load(DwhHeartBeat.class); if(Config.<Boolean> getValue(ConfigValues.AffinityRulesEnforcementManagerEnabled)) { serviceLoader.load(AffinityRulesEnforcementManager.class); } serviceLoader.load(CertificationValidityChecker.class); serviceLoader.load(HostUpdatesCheckerService.class); serviceLoader.load(IPTablesDeprecationNotifier.class); } catch (Exception ex) { log.error("Failed to initialize backend", ex); throw ex; } }

Target:
public void create() { try { serviceLoader.load(PmHealthCheckManager.class); serviceLoader.load(EngineBackupAwarenessManager.class); serviceLoader.load(DataCenterCompatibilityChecker.class); serviceLoader.load(ResourceManager.class); serviceLoader.load(HostDeviceManager.class); serviceLoader.load(IrsProxyManager.class); serviceLoader.load(OvfDataUpdater.class); StoragePoolStatusHandler.init(); serviceLoader.load(GlusterJobsManager.class); resourceManager.get().scheduleJobsForHosts(); try { log.info("Init VM custom properties utilities"); VmPropertiesUtils.getInstance().init(); } catch (InitializationException e) { log.error("Initialization of vm custom properties failed.", e); } try { log.info("Init device custom properties utilities"); DevicePropertiesUtils.getInstance().init(); } catch (InitializationException e) { log.error("Initialization of device custom properties failed.", e); } serviceLoader.load(SchedulingManager.class); sessionDataContainer.cleanupEngineSessionsOnStartup(); serviceLoader.load(DwhHeartBeat.class); if(Config.<Boolean> getValue(ConfigValues.AffinityRulesEnforcementManagerEnabled)) { serviceLoader.load(AffinityRulesEnforcementManager.class); } serviceLoader.load(CertificationValidityChecker.class); serviceLoader.load(HostUpdatesCheckerService.class); serviceLoader.load(IPTablesDeprecationNotifier.class); } catch (Exception ex) { log.error("Failed to initialize backend", ex); throw ex; } }
Source:
public LauncherSettingsValidator() { validationRules = new ArrayList<>(); setupRules(); }

Target:
private LauncherSettingsValidator() { }
Source:
public void savePluginSettings(String pluginId, String settingsAsJson) { DefaultGoPluginApiRequest request = new DefaultGoPluginApiRequest("", "", "save-settings"); request.setRequestBody(settingsAsJson); GoPluginApiResponse response = submitTo(pluginId, request); if (SUCCESS_RESPONSE_CODE != response.responseCode()) { throw new RuntimeException(format("Error while saving settings for plugin %s. [%s]", pluginId, response.responseBody())); } }

Target:
public void savePluginSettings(String pluginId, String settingsAsJson) { DefaultGoPluginApiRequest request = new DefaultGoPluginApiRequest("", "", "save-settings"); request.setRequestBody(settingsAsJson); GoPluginApiResponse response; try { response = submitTo(pluginId, request); } catch (Exception e) { LOGGER.warn(format("Could not save settings for Plugin %s. %s", pluginId, e.getMessage()), e); throw new RuntimeException(format("Could not save settings for Plugin %s. %s", pluginId, e.getMessage())); } if (SUCCESS_RESPONSE_CODE != response.responseCode()) { throw new RuntimeException(format("Error while saving settings for plugin %s. [%s]", pluginId, response.responseBody())); } }
Source:
public JLoadScenario jaasSmokeTest() { return new JaasSmokeTest().getHttpScenarios(); }

Target:
public JLoadScenario jaasSmokeTest() { return new JaasSmokeTest().getHttpScenario(); }
Source:
public BrooklynMemento loadMemento(LookupContext lookupContext) { try { Stopwatch stopwatch = Stopwatch.createStarted(); List<String> lines; synchronized (mutex) { lines = Files.readLines(file, Charsets.UTF_8); } String xml = Joiner.on("\n").join(lines); serializer.setLookupContext(lookupContext); try { BrooklynMemento result = serializer.fromString(xml); if (LOG.isDebugEnabled()) LOG.debug("Loaded memento; took {}", Time.makeTimeStringRounded(stopwatch.elapsed(TimeUnit.MILLISECONDS))); return result; } finally { serializer.unsetLookupContext(); } } catch (IOException e) { throw Throwables.propagate(e); } }

Target:
public BrooklynMemento loadMemento(LookupContext lookupContext) { Stopwatch stopwatch = Stopwatch.createStarted(); String xml = readFile(); serializer.setLookupContext(lookupContext); try { BrooklynMemento result = serializer.fromString(xml); if (LOG.isDebugEnabled()) LOG.debug("Loaded memento; took {}", Time.makeTimeStringRounded(stopwatch)); return result; } finally { serializer.unsetLookupContext(); } }
Source:
public void testTransaction() throws RemoteException, SystemException { log.info("Method stateless #testTransaction called"); Transaction txn; txn = tm.getTransaction(); TxTestUtil.enlistTestXAResource(txn); TxTestUtil.enlistTestXAResource(txn); }

Target:
public void testTransaction() throws RemoteException, SystemException { log.trace("Method stateless #testTransaction called"); Transaction txn; txn = tm.getTransaction(); TxTestUtil.enlistTestXAResource(txn); TxTestUtil.enlistTestXAResource(txn); }
Source:
public static Community[] findAllTop(Context context) throws SQLException { TableRowIterator tri = null; try { String query = "SELECT c.* FROM community c " + "LEFT JOIN metadatavalue m on (m.resource_id = c.community_id and m.resource_type_id = ? and m.metadata_field_id = ?) " + "WHERE NOT c.community_id IN (SELECT child_comm_id FROM community2community) "; if("oracle".equals(ConfigurationManager.getProperty("db.name"))){ query += " ORDER BY cast(m.text_value as varchar2(128))"; }else{ query += " ORDER BY m.text_value"; } tri = DatabaseManager.query(context, query, Constants.COMMUNITY, MetadataField.findByElement(context, MetadataSchema.find(context, MetadataSchema.DC_SCHEMA).getSchemaID(), "title", null).getFieldID() ); } catch (SQLException e) { log.error("Find all Top Communities - ",e); throw e; } List<Community> topCommunities = new ArrayList<Community>(); try { while (tri.hasNext()) { TableRow row = tri.next(); Community fromCache = (Community) context.fromCache( Community.class, row.getIntColumn("community_id")); if (fromCache != null) { topCommunities.add(fromCache); } else { topCommunities.add(new Community(context, row)); } } } finally { if (tri != null) { tri.close(); } } Community[] communityArray = new Community[topCommunities.size()]; communityArray = (Community[]) topCommunities.toArray(communityArray); return communityArray; }

Target:
public static Community[] findAllTop(Context context) throws SQLException { TableRowIterator tri = null; try { String query = "SELECT c.* FROM community c " + "LEFT JOIN metadatavalue m on (m.resource_id = c.community_id and m.resource_type_id = ? and m.metadata_field_id = ?) " + "WHERE NOT c.community_id IN (SELECT child_comm_id FROM community2community) "; if(DatabaseManager.isOracle()){ query += " ORDER BY cast(m.text_value as varchar2(128))"; }else{ query += " ORDER BY m.text_value"; } tri = DatabaseManager.query(context, query, Constants.COMMUNITY, MetadataField.findByElement(context, MetadataSchema.find(context, MetadataSchema.DC_SCHEMA).getSchemaID(), "title", null).getFieldID() ); } catch (SQLException e) { log.error("Find all Top Communities - ",e); throw e; } List<Community> topCommunities = new ArrayList<Community>(); try { while (tri.hasNext()) { TableRow row = tri.next(); Community fromCache = (Community) context.fromCache( Community.class, row.getIntColumn("community_id")); if (fromCache != null) { topCommunities.add(fromCache); } else { topCommunities.add(new Community(context, row)); } } } finally { if (tri != null) { tri.close(); } } Community[] communityArray = new Community[topCommunities.size()]; communityArray = (Community[]) topCommunities.toArray(communityArray); return communityArray; }
Source:
public void testSort() { statisticsAssertion.check("SELECT * from nation order by n_nationkey", checks -> checks.estimate(OUTPUT_ROW_COUNT, noError())); }

Target:
public void testSort() { statisticsAssertion.check("SELECT * FROM nation ORDER BY n_nationkey", checks -> checks.estimate(OUTPUT_ROW_COUNT, noError())); }
Source:
public static byte[] readBytesFromByteBuf(ByteBuf buffer, byte[] data, int offset, int size) throws IOException { return readBytesFromStream(new ByteBufInputStream(buffer), data, offset, size); }

Target:
public static byte[] readBytesFromByteBuf(ByteBuf buffer, byte[] data, int offset, int size) throws IOException { buffer.readBytes(data, offset, size); return data; }
Source:
public static boolean isAttributeGroupMetacard(Metacard metacard) { return metacard != null && metacard.getTags().stream().anyMatch(ATTRIBUTE_GROUP_TAG::equals); }

Target:
public static boolean isAttributeGroupMetacard(Metacard metacard) { return metacard != null && metacard.getTags().contains(ATTRIBUTE_GROUP_TAG); }
Source:
protected boolean validateImages() { List<DiskImage> imagesToValidate = getDiskImagesToValidate(); DiskImagesValidator diskImagesValidator = new DiskImagesValidator(imagesToValidate); return (!getParameters().isNeedsLocking() || validate(diskImagesValidator.diskImagesNotLocked())) && (getVm().isQualifiedForLiveSnapshotMerge() || validate(diskImagesValidator.diskImagesNotIllegal())); }

Target:
protected boolean validateImages() { List<DiskImage> imagesToValidate = getDiskImagesToValidate(); DiskImagesValidator diskImagesValidator = new DiskImagesValidator(imagesToValidate); return validateImagesNotLocked(diskImagesValidator) && (getVm().isQualifiedForLiveSnapshotMerge() || validate(diskImagesValidator.diskImagesNotIllegal())); }
Source:
public void checkVaultFileSystemLocation() { String userName = new NTSystem().getName(); ForgedAlliancePrefs forgedAlliance = preferencesService.getPreferences().getForgedAlliance(); if (forgedAlliance.isVaultCheckDone()) { return; } Action revertAction = new Action(i18n.get("revert.alreadySymlinked"), event -> forgedAlliance.setVaultBaseDirectory(preferencesService.getPrimaryVaultLocation())); if (userName != null && !CharMatcher.ascii().matchesAllOf(userName) && isWindows()) { forgedAlliance.setVaultBaseDirectory(preferencesService.getSecondaryFallbackVaultLocation()); PersistentNotification notification = new PersistentNotification(i18n.get("mapDir.changed.noneAscii"), Severity.INFO, Collections.singletonList(revertAction)); notificationService.addNotification(notification); } else { String myDocumnetsParentFolder = preferencesService.getPrimaryVaultLocation().getParent().toString(); if (isWindows() && ONE_DRIVE_FOLDER_NAME_IDENTIFIER.matcher(myDocumnetsParentFolder).matches()) { PersistentNotification notification = new PersistentNotification(i18n.get("mapDir.changed.oneDrive"), Severity.INFO, Collections.singletonList(revertAction)); notificationService.addNotification(notification); } else if (isUnix()) { forgedAlliance.setVaultBaseDirectory(preferencesService.getSecondaryFallbackVaultLocation()); PersistentNotification notification = new PersistentNotification(i18n.get("mapDir.changed.unix"), Severity.INFO, Collections.singletonList(revertAction)); notificationService.addNotification(notification); } } forgedAlliance.setVaultCheckDone(true); preferencesService.storeInBackground(); }

Target:
public void checkVaultFileSystemLocation() { ForgedAlliancePrefs forgedAlliance = preferencesService.getPreferences().getForgedAlliance(); if (forgedAlliance.isVaultCheckDone()) { return; } String userName = System.getProperty("user.name"); if (userName != null && !CharMatcher.ascii().matchesAllOf(userName) && isWindows()) { setSecondaryVaultLocationAndNotifyUser("mapDir.changed.noneAscii"); } else { String myDocumentsParentFolder = preferencesService.getPrimaryVaultLocation().getParent().toString(); if (isWindows() && ONE_DRIVE_FOLDER_NAME_IDENTIFIER.matcher(myDocumentsParentFolder).matches()) { setSecondaryVaultLocationAndNotifyUser("mapDir.changed.oneDrive"); } } if (isUnix()) { setSecondaryVaultLocationAndNotifyUser("mapDir.changed.unix"); } forgedAlliance.setVaultCheckDone(true); preferencesService.storeInBackground(); }
Source:
public static Features getFeaturesFromRequest(HttpServletRequest request) throws IOException { Features features = new Features(); String has = getHasConditionsFromRequest(request); if (has != null) { if (log.isLoggable(Level.FINEST)) log.finest("Adding has parameters from request: " + has); for (String s : has.split("[;|]")) { boolean value = true; if (s.startsWith("!")) { s = s.substring(1); value = false; } features.put(s, value); } if (log.isLoggable(Level.FINEST)) log.finest("features = " + features.toString()); } return features.unmodifiableFeatures(); }

Target:
protected static Features getFeaturesFromRequest(HttpServletRequest request) throws IOException { Features features = new Features(); String has = getHasConditionsFromRequest(request); if (has != null) { if (log.isLoggable(Level.FINEST)) log.finest("Adding has parameters from request: " + has); for (String s : has.split("[;|]")) { boolean value = true; if (s.startsWith("!")) { s = s.substring(1); value = false; } features.put(s, value); } if (log.isLoggable(Level.FINEST)) log.finest("features = " + features.toString()); } return features.unmodifiableFeatures(); }
Source:
public List<UIExtension> get(String extensionPointId) { List<UIExtension> panels = new ArrayList<UIExtension>(); String panelConfigurationString = getConfiguration(); if (!StringUtils.isEmpty(panelConfigurationString)) { List<String> panelSerializedReferences = new ArrayList<String>(); for (String serializedReference : getConfiguration().split(",")) { panelSerializedReferences.add(serializer.serialize(resolver.resolve(serializedReference.trim()))); } try { List<UIExtension> allExtensions = contextComponentManagerProvider.get().getInstanceList(UIExtension.class); for (String panelSerializedReference : panelSerializedReferences) { for (UIExtension extension : allExtensions) { String extensionId; if (extension instanceof WikiUIExtension) { WikiUIExtension wikiUIExtension = (WikiUIExtension) extension; extensionId = serializer.serialize(wikiUIExtension.getDocumentReference()); } else { extensionId = serializer.serialize(resolver.resolve(extension.getId())); } if (extensionId.equals(panelSerializedReference)) { panels.add(extension); } } } } catch (ComponentLookupException e) { logger.error("Failed to lookup Panels instances, error: [{}]", e); } } return panels; }

Target:
public List<UIExtension> get(String extensionPointId) { List<UIExtension> panels = new ArrayList<UIExtension>(); String panelConfigurationString = getConfiguration(); if (!StringUtils.isEmpty(panelConfigurationString)) { Set<DocumentReference> panelSerializedReferences = new HashSet<>(); for (String serializedReference : getConfiguration().split(",")) { panelSerializedReferences.add(resolver.resolve(serializedReference.trim())); } try { List<UIExtension> allExtensions = contextComponentManagerProvider.get().getInstanceList(UIExtension.class); for (UIExtension extension : allExtensions) { DocumentReference extensionId; if (extension instanceof WikiComponent) { WikiComponent wikiComponent = (WikiComponent) extension; extensionId = wikiComponent.getDocumentReference(); } else { extensionId = resolver.resolve(extension.getId()); } if (panelSerializedReferences.contains(extensionId)) { panels.add(extension); } } } catch (ComponentLookupException e) { logger.error("Failed to lookup Panels instances, error: [{}]", e); } } return panels; }
Source:
private TableWriter openWriterAndOverrideImportTypes( CairoSecurityContext cairoSecurityContext, ObjList<TypeAdapter> detectedTypes ) { TableWriter writer = engine.getWriter(cairoSecurityContext, tableName); RecordMetadata metadata = writer.getMetadata(); if (metadata.getColumnCount() < detectedTypes.size()) { writer.close(); throw CairoException.instance(0) .put("column count mismatch [textColumnCount=").put(detectedTypes.size()) .put(", tableColumnCount=").put(metadata.getColumnCount()) .put(", table=").put(tableName) .put(']'); } this.types = detectedTypes; for (int i = 0, n = this.types.size(); i < n; i++) { final int columnType = metadata.getColumnType(i); int detectedType = this.types.getQuick(i).getType(); if (detectedType != columnType) { switch (columnType) { case ColumnType.DATE: logTypeError(i); this.types.setQuick(i, BadDateAdapter.INSTANCE); break; case ColumnType.TIMESTAMP: if (detectedType == ColumnType.DATE) { this.types.setQuick(i, dateToTimestampAdapter.of((DateAdapter) this.types.getQuick(i))); } else { logTypeError(i); this.types.setQuick(i, BadTimestampAdapter.INSTANCE); } break; case ColumnType.BINARY: writer.close(); throw CairoException.instance(0).put("cannot import text into BINARY column [index=").put(i).put(']'); default: this.types.setQuick(i, typeManager.getTypeAdapter(columnType)); break; } } } return writer; }

Target:
private TableWriter openWriterAndOverrideImportTypes( CairoSecurityContext cairoSecurityContext, ObjList<TypeAdapter> detectedTypes ) { TableWriter writer = engine.getWriter(cairoSecurityContext, tableName); RecordMetadata metadata = writer.getMetadata(); if (metadata.getColumnCount() < detectedTypes.size()) { writer.close(); throw CairoException.instance(0) .put("column count mismatch [textColumnCount=").put(detectedTypes.size()) .put(", tableColumnCount=").put(metadata.getColumnCount()) .put(", table=").put(tableName) .put(']'); } this.types = detectedTypes; for (int i = 0, n = this.types.size(); i < n; i++) { final int columnType = metadata.getColumnType(i); int detectedType = this.types.getQuick(i).getType(); if (detectedType != columnType) { switch (columnType) { case ColumnType.DATE: logTypeError(i); this.types.setQuick(i, BadDateAdapter.INSTANCE); break; case ColumnType.TIMESTAMP: if (detectedType == ColumnType.DATE) { this.types.setQuick(i, dateToTimestampAdapterPool.next().of((DateAdapter) this.types.getQuick(i))); } else { logTypeError(i); this.types.setQuick(i, BadTimestampAdapter.INSTANCE); } break; case ColumnType.BINARY: writer.close(); throw CairoException.instance(0).put("cannot import text into BINARY column [index=").put(i).put(']'); default: this.types.setQuick(i, typeManager.getTypeAdapter(columnType)); break; } } } return writer; }
Source:
protected void onLoad() { enableForm(false); super.onLoad(); Util.PROJECT_SVC.projectDetail(projectName, new GerritCallback<ProjectDetail>() { public void onSuccess(final ProjectDetail result) { enableForm(true); display(result); addPanel.setVisible(result.canModifyData); delRight.setVisible(result.canModifyData); } }); }

Target:
protected void onLoad() { enableForm(false); super.onLoad(); Util.PROJECT_SVC.projectDetail(projectName, new GerritCallback<ProjectDetail>() { public void onSuccess(final ProjectDetail result) { enableForm(true); display(result); } }); }
Source:
public void assignUpstream(StateSystem ss) { backend = new InMemoryBackend(ss.getStartTime()); transState = new TransientState(this.getBackend()); realStateSystem = ss; ssAssignedLatch.countDown(); }

Target:
public void assignUpstream(StateSystem ss) { setBackend(new InMemoryBackend(ss.getStartTime())); setTransientState(new TransientState(getBackend())); realStateSystem = ss; ssAssignedLatch.countDown(); }
Source:
public NetworkCapabilities[] getDefaultNetworkCapabilitiesForUser(int userId) { enforceAccessPermission(); HashMap<Network, NetworkCapabilities> result = new HashMap<Network, NetworkCapabilities>(); NetworkAgentInfo nai = getDefaultNetwork(); NetworkCapabilities nc = getNetworkCapabilitiesInternal(nai); if (nc != null) { result.put(nai.network, nc); } synchronized (mVpns) { if (!mLockdownEnabled) { Vpn vpn = mVpns.get(userId); if (vpn != null) { Network[] networks = vpn.getUnderlyingNetworks(); if (networks != null) { for (Network network : networks) { nai = getNetworkAgentInfoForNetwork(network); nc = getNetworkCapabilitiesInternal(nai); if (nc != null) { nc.setUids(null); result.put(network, nc); } } } } } } NetworkCapabilities[] out = new NetworkCapabilities[result.size()]; out = result.values().toArray(out); return out; }

Target:
public NetworkCapabilities[] getDefaultNetworkCapabilitiesForUser(int userId) { enforceAccessPermission(); HashMap<Network, NetworkCapabilities> result = new HashMap<Network, NetworkCapabilities>(); NetworkAgentInfo nai = getDefaultNetwork(); NetworkCapabilities nc = getNetworkCapabilitiesInternal(nai); if (nc != null) { result.put(nai.network, nc); } synchronized (mVpns) { if (!mLockdownEnabled) { Vpn vpn = mVpns.get(userId); if (vpn != null) { Network[] networks = vpn.getUnderlyingNetworks(); if (networks != null) { for (Network network : networks) { nai = getNetworkAgentInfoForNetwork(network); nc = getNetworkCapabilitiesInternal(nai); if (nc != null) { result.put(network, nc); } } } } } } NetworkCapabilities[] out = new NetworkCapabilities[result.size()]; out = result.values().toArray(out); return out; }
Source:
protected boolean consumeNextMessage() { Message rawMessage = null; try { boolean hasNext = mMessageReader.hasNext(); if (!hasNext) { return false; } rawMessage = mMessageReader.read(); } catch (ConsumerTimeoutException e) { LOG.trace("Consumer timed out", e); } if (rawMessage != null) { try { mMessageWriter.adjustOffset(rawMessage); } catch (IOException e) { throw new RuntimeException("Failed to adjust offset.", e); } ParsedMessage parsedMessage = null; try { Message transformedMessage = mMessageTransformer.transform(rawMessage); parsedMessage = mMessageParser.parse(transformedMessage); final double DECAY = 0.999; mUnparsableMessages *= DECAY; } catch (Throwable e) { mMetricCollector.increment("consumer.message_errors.count", "topic:" + rawMessage.getTopic()); mUnparsableMessages++; final double MAX_UNPARSABLE_MESSAGES = 1000.; if (mUnparsableMessages > MAX_UNPARSABLE_MESSAGES) { throw new RuntimeException("Failed to parse message " + rawMessage, e); } LOG.warn("Failed to parse message {}", rawMessage, e); } if (parsedMessage != null) { try { mMessageWriter.write(parsedMessage); mMetricCollector.metric("consumer.message_size_bytes", rawMessage.getPayload().length, "topic:" + rawMessage.getTopic()); mMetricCollector.increment("consumer.throughput_bytes", rawMessage.getPayload().length, "topic:" + rawMessage.getTopic()); } catch (Exception e) { throw new RuntimeException("Failed to write message " + parsedMessage, e); } } } return true; }

Target:
protected boolean consumeNextMessage() { Message rawMessage = null; try { boolean hasNext = mMessageReader.hasNext(); if (!hasNext) { return false; } rawMessage = mMessageReader.read(); } catch (ConsumerTimeoutException e) { LOG.trace("Consumer timed out", e); } if (rawMessage != null) { try { mMessageWriter.adjustOffset(rawMessage); } catch (IOException e) { throw new RuntimeException("Failed to adjust offset.", e); } ParsedMessage parsedMessage = null; try { Message transformedMessage = mMessageTransformer.transform(rawMessage); parsedMessage = mMessageParser.parse(transformedMessage); final double DECAY = 0.999; mUnparsableMessages *= DECAY; } catch (Throwable e) { mMetricCollector.increment("consumer.message_errors.count", rawMessage.getTopic()); mUnparsableMessages++; final double MAX_UNPARSABLE_MESSAGES = 1000.; if (mUnparsableMessages > MAX_UNPARSABLE_MESSAGES) { throw new RuntimeException("Failed to parse message " + rawMessage, e); } LOG.warn("Failed to parse message {}", rawMessage, e); } if (parsedMessage != null) { try { mMessageWriter.write(parsedMessage); mMetricCollector.metric("consumer.message_size_bytes", rawMessage.getPayload().length, rawMessage.getTopic()); mMetricCollector.increment("consumer.throughput_bytes", rawMessage.getPayload().length, rawMessage.getTopic()); } catch (Exception e) { throw new RuntimeException("Failed to write message " + parsedMessage, e); } } } return true; }
Source:
protected boolean checkComplete() { if (super.checkComplete()) { if (full_query_context != null && (context.query().getCacheMode() == CacheMode.NORMAL || context.query().getCacheMode() == CacheMode.WRITEONLY)) { if (full_query_context.cacheable()) { full_query_caching.set(true); context.tsdb().getQueryThreadPool().submit(new Runnable() { @Override public void run() { try { cache.cache(slices, keys, expirations, sub_results, null) .addBoth(new Callback<Void, Void>() { @Override public Void call(Void arg) throws Exception { for (final QueryResult result : sub_results) { if (result != null) { try { result.close(); } catch (Exception e) { LOG.warn("Failed t oclose result: " + result, e); } } } try { full_query_context.close(); } catch (Exception e) { LOG.warn("Failed to close full query context", e); } return null; } }); } catch (Throwable t) { LOG.error("Failed to cache the data", t); } } }, context); } else { if (LOG.isDebugEnabled()) { LOG.debug("Will not cache full query as it's marked as not cacheable."); } for (final QueryResult result : sub_results) { if (result != null) { try { result.close(); } catch (Exception e) { LOG.warn("Failed t oclose result: " + result, e); } } } } } return true; } return false; }

Target:
protected boolean checkComplete() { if (super.checkComplete()) { if (full_query_context != null && (context.query().getCacheMode() == CacheMode.NORMAL || context.query().getCacheMode() == CacheMode.WRITEONLY)) { if (full_query_context.cacheable()) { context.tsdb().getQueryThreadPool().submit(new Runnable() { @Override public void run() { try { cache.cache(slices, keys, expirations, sub_results, null) .addBoth(new Callback<Void, Void>() { @Override public Void call(Void arg) throws Exception { for (final QueryResult result : sub_results) { if (result != null) { try { result.close(); } catch (Exception e) { LOG.warn("Failed t oclose result: " + result, e); } } } try { full_query_context.close(); } catch (Exception e) { LOG.warn("Failed to close full query context", e); } return null; } }); } catch (Throwable t) { LOG.error("Failed to cache the data", t); } } }, context); } else { if (LOG.isDebugEnabled()) { LOG.debug("Will not cache full query as it's marked as not cacheable."); } for (final QueryResult result : sub_results) { if (result != null) { try { result.close(); } catch (Exception e) { LOG.warn("Failed t oclose result: " + result, e); } } } } } return true; } return false; }
Source:
protected void setUp() throws Exception { Registry.INSTANCE.getExtensionToFactoryMap().put("ecore", new XMIResourceFactoryImpl() { @Override public Resource createResource(URI uri) { return new XMIResourceImpl(uri) { @Override protected boolean useUUIDs() { System.out.println("useUUIDs"); return false; } }; } }); copyFilesToTestProject(SiriusTestsPlugin.PLUGIN_ID, LIBRARY_PROJECT, PATH, Lists.newArrayList(SEMANTIC_MODEL_LIB, AIRD_LIB_1)); genericSetUp(Collections.singletonList(toURI(LIBRARY_PROJECT + "/" + SEMANTIC_MODEL_LIB, ResourceURIType.RESOURCE_PLATFORM_URI)), Collections.<URI> emptyList(), true, toURI(LIBRARY_PROJECT + "/" + AIRD_LIB_1, ResourceURIType.RESOURCE_PLATFORM_URI)); sessionLibrary = session; copyFilesToTestProject(SiriusTestsPlugin.PLUGIN_ID, CONSUMER_PROJECT, PATH, Lists.newArrayList(SEMANTIC_MODEL_CONSUMER, AIRD_CONSUMER_1)); genericSetUp(Collections.singletonList(toURI(CONSUMER_PROJECT + "/" + SEMANTIC_MODEL_CONSUMER, ResourceURIType.RESOURCE_PLATFORM_URI)), Collections.<URI> emptyList(), true, toURI(CONSUMER_PROJECT + "/" + AIRD_CONSUMER_1, ResourceURIType.RESOURCE_PLATFORM_URI)); }

Target:
protected void setUp() throws Exception { Registry.INSTANCE.getExtensionToFactoryMap().put("ecore", new XMIResourceFactoryImpl() { @Override public Resource createResource(URI uri) { return new XMIResourceImpl(uri) { @Override protected boolean useUUIDs() { return false; } }; } }); copyFilesToTestProject(SiriusTestsPlugin.PLUGIN_ID, LIBRARY_PROJECT, PATH, Lists.newArrayList(SEMANTIC_MODEL_LIB, AIRD_LIB_1)); genericSetUp(Collections.singletonList(toURI(LIBRARY_PROJECT + "/" + SEMANTIC_MODEL_LIB, ResourceURIType.RESOURCE_PLATFORM_URI)), Collections.<URI> emptyList(), true, toURI(LIBRARY_PROJECT + "/" + AIRD_LIB_1, ResourceURIType.RESOURCE_PLATFORM_URI)); sessionLibrary = session; copyFilesToTestProject(SiriusTestsPlugin.PLUGIN_ID, CONSUMER_PROJECT, PATH, Lists.newArrayList(SEMANTIC_MODEL_CONSUMER, AIRD_CONSUMER_1)); genericSetUp(Collections.singletonList(toURI(CONSUMER_PROJECT + "/" + SEMANTIC_MODEL_CONSUMER, ResourceURIType.RESOURCE_PLATFORM_URI)), Collections.<URI> emptyList(), true, toURI(CONSUMER_PROJECT + "/" + AIRD_CONSUMER_1, ResourceURIType.RESOURCE_PLATFORM_URI)); }
Source:
public void testInitializationWithUriAndConf_shouldGiveFsStatusWithNotUsedMemory() throws IOException, URISyntaxException { assertThat(new GoogleHadoopFS(initUri, loadConfig()).getFsStatus().getUsed()).isEqualTo(0); }

Target:
public void testInitializationWithUriAndConf_shouldGiveFsStatusWithNotUsedMemory() throws IOException, URISyntaxException { Configuration config = GoogleHadoopFileSystemIntegrationHelper.getTestConfig(); GoogleHadoopFS ghfs = new GoogleHadoopFS(initUri, config); assertThat(ghfs.getFsStatus().getUsed()).isEqualTo(0); }
Source:
public int hashCode() { int result = text.hashCode(); result = 31 * result + read.hashCode(); result = 31 * result + spamPrediction.hashCode(); return result; }

Target:
public int hashCode() { int result = Objects.hash(text, read, spamPrediction); return result; }
Source:
public void changeTheme() { if (game == null) return; IBoard board = game.getBoard(); if (board.inSpace()) return; Set<String> themes = tileManager.getThemes(); if (themes.remove("")) themes.add("(No Theme)"); themes.add("(Original Theme)"); setShouldIgnoreKeys(true); selectedTheme = (String)JOptionPane.showInputDialog( null, "Choose the desired theme:", "Theme Selection", JOptionPane.PLAIN_MESSAGE, null, themes.toArray(), selectedTheme); setShouldIgnoreKeys(false); if (selectedTheme == null) { return; } final List<Coords> allCoords = allBoardHexes(); if (allCoords == null) { return; } if (selectedTheme.equals("(Original Theme)")) { for (Coords c: allCoords) { IHex hex = board.getHex(c); hex.resetTheme(); board.setHex(c, hex); } } else { for (Coords c: allCoords) { IHex hex = board.getHex(c); hex.setTheme(selectedTheme.equals("(No Theme)")? "":selectedTheme); board.setHex(c, hex); } } }

Target:
public void changeTheme() { if (game == null) return; IBoard board = game.getBoard(); if (board.inSpace()) return; Set<String> themes = tileManager.getThemes(); if (themes.remove("")) themes.add("(No Theme)"); themes.add("(Original Theme)"); setShouldIgnoreKeys(true); selectedTheme = (String)JOptionPane.showInputDialog( null, "Choose the desired theme:", "Theme Selection", JOptionPane.PLAIN_MESSAGE, null, themes.toArray(), selectedTheme); setShouldIgnoreKeys(false); if (selectedTheme == null) { return; } if (selectedTheme.equals("(Original Theme)")) { for (Coords c: allBoardHexes()) { IHex hex = board.getHex(c); hex.resetTheme(); board.setHex(c, hex); } } else { for (Coords c: allBoardHexes()) { IHex hex = board.getHex(c); hex.setTheme(selectedTheme.equals("(No Theme)")? "":selectedTheme); board.setHex(c, hex); } } }
Source:
public static PGType get(DataType<?> type) { switch (type.id()) { case ArrayType.ID: { DataType<?> innerType = ((ArrayType<?>) type).innerType(); if (innerType.id() == ArrayType.ID) { return JsonType.INSTANCE; } else if (innerType.id() == ObjectType.ID) { return PGArray.JSON_ARRAY; } PGType pgType = CRATE_TO_PG_TYPES.get(type); if (pgType == null) { throw new IllegalArgumentException( String.format(Locale.ENGLISH, "No type mapping from '%s' to pg_type", type.getName())); } return pgType; } case ObjectType.ID: { return JsonType.INSTANCE; } case RowType.ID: return new RecordType(Lists2.map(((RowType) type).fieldTypes(), PGTypes::get)); default: { PGType pgType = CRATE_TO_PG_TYPES.get(type); if (pgType == null) { throw new IllegalArgumentException( String.format(Locale.ENGLISH, "No type mapping from '%s' to pg_type", type.getName())); } return pgType; } } }

Target:
public static PGType get(DataType<?> type) { switch (type.id()) { case ArrayType.ID: { DataType<?> innerType = ((ArrayType<?>) type).innerType(); if (innerType.id() == ArrayType.ID) { return JsonType.INSTANCE; } else if (innerType.id() == ObjectType.ID) { return PGArray.JSON_ARRAY; } else if (innerType.id() == RowType.ID) { return new PGArray(PGArray.EMPTY_RECORD_ARRAY.oid(), get(innerType)); } PGType pgType = CRATE_TO_PG_TYPES.get(type); if (pgType == null) { throw new IllegalArgumentException( String.format(Locale.ENGLISH, "No type mapping from '%s' to pg_type", type.getName())); } return pgType; } case ObjectType.ID: { return JsonType.INSTANCE; } case RowType.ID: return new RecordType(Lists2.map(((RowType) type).fieldTypes(), PGTypes::get)); default: { PGType pgType = CRATE_TO_PG_TYPES.get(type); if (pgType == null) { throw new IllegalArgumentException( String.format(Locale.ENGLISH, "No type mapping from '%s' to pg_type", type.getName())); } return pgType; } } }
Source:
public LookupBean( @JsonProperty("name") String name, @Deprecated @JsonProperty("factory") LookupExtractorFactory factory, @JsonProperty("container") LookupExtractorFactoryContainer container ) { Preconditions.checkArgument(factory == null || container == null, "only one of factory or container should exist"); Preconditions.checkArgument(factory != null || container != null, "one of factory or container must exist"); this.name = name; this.container = container != null ? container : new LookupExtractorFactoryContainer(null, factory); }

Target:
public LookupBean( @JsonProperty("name") String name, @Deprecated @JsonProperty("factory") LookupExtractorFactory factory, @JsonProperty("container") LookupExtractorFactoryContainer container ) { Preconditions.checkArgument(factory != null || container != null, "either one of factory or container must exist"); this.name = name; this.container = container != null ? container : new LookupExtractorFactoryContainer(null, factory); this.factory = factory != null ? factory : container.getLookupExtractorFactory(); }
Source:
public void readHeader( PageCache pageCache ) throws IOException { GBPTree.readHeader( pageCache, indexFile, settings.headerReader( NativeSchemaIndexHeaderReader::readFailureMessage ) ); if ( settings.getFailureMessage() != null ) { throw new IOException( settings.getFailureMessage() ); } this.layout = new SpatialLayout( crs, settings.curve() ); }

Target:
public void readHeader( PageCache pageCache ) throws IOException { GBPTree.readHeader( pageCache, indexFile, settings.headerReader( NativeSchemaIndexHeaderReader::readFailureMessage ) ); if ( settings.isFailed() ) { throw new IOException( settings.getFailureMessage() ); } this.layout = new SpatialLayout( crs, settings.curve() ); }
Source:
public int compareValueTo(Row val1, Row val2) { for (int i = 0; i < fieldTypes.size(); i++) { DataType dataType = fieldTypes.get(i); int cmp = dataType.compareValueTo(val1.get(i), val2.get(i)); if (cmp != 0) { return cmp; } } return 0; }

Target:
public int compareValueTo(Row val1, Row val2) { assert val1.numColumns() == val2.numColumns() : "Rows to compare must have the same number of columns and types. val1=" + val1 + ", val2=" + val2; for (int i = 0; i < fieldTypes.size(); i++) { DataType dataType = fieldTypes.get(i); int cmp = dataType.compareValueTo(val1.get(i), val2.get(i)); if (cmp != 0) { return cmp; } } return 0; }
Source:
protected String getDebuggeeClassName() { return "org.apache.harmony.jpda.tests.jdwp.InterfaceType.InvokeMethodDebuggee"; }

Target:
protected String getDebuggeeClassName() { return InvokeMethodDebuggee.class.getName(); }
Source:
public boolean onBackPressed() { if (mVideoPlayer != null && mVideoPlayer.isFullscreen) { mVideoPlayer.isFullscreen = false; mVideoPlayer.toggleOrientation(); return true; } if (DEBUG) Log.d(TAG, "onBackPressed() called"); if (stack.size() <= 1) { hideMainVideoPlayer(); stopService(); unbind(); return false; } stack.pop(); StackItem peek = stack.peek(); PlayQueue peekQueue = stack.peek().getPlayQueue(); if(peekQueue != null && !peekQueue.getClass().equals(SinglePlayQueue.class)) { int index = -1; for (int i=0; i < peekQueue.getStreams().size(); i++) { PlayQueueItem item = peekQueue.getItem(i); if(item.getUrl().equals(stack.peek().getUrl())) { index = i; break; } } if(index != -1) peekQueue.setIndex(index); } autoPlayEnabled = false; hideMainVideoPlayer(); selectAndLoadVideo(peek.getServiceId(), peek.getUrl(), !TextUtils.isEmpty(peek.getTitle()) ? peek.getTitle() : "", peek.getPlayQueue()); return true; }

Target:
public boolean onBackPressed() { if (playerService != null && player != null && player.isInFullscreen()) { getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); if(!globalScreenOrientationLocked()) player.onFullScreenButtonClicked(); player.getPlayer().setPlayWhenReady(false); return true; } if (DEBUG) Log.d(TAG, "onBackPressed() called"); if (stack.size() <= 1) { if (player != null && player.videoPlayerSelected()) { stopService(); } getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); return false; } stack.pop(); StackItem peek = stack.peek(); selectStreamFromHistory(peek); hideMainPlayer(); setAutoplay(false); selectAndLoadVideo(peek.getServiceId(), peek.getUrl(), !TextUtils.isEmpty(peek.getTitle()) ? peek.getTitle() : "", peek.getPlayQueue()); fromBackStack = true; return true; }
Source:
private void updateAllClustersMacPool() { final Guid newMacPoolId = getParameters().getStoragePool().getMacPoolId(); final boolean shouldSetNewMacPoolOnAllClusters = newMacPoolId != null; if (shouldSetNewMacPoolOnAllClusters) { List<Cluster> clusters = clusterDao.getAllForStoragePool(getStoragePoolId()); for (Cluster cluster : clusters) { moveMacs.migrateMacsToAnotherMacPoolIfNeeded(cluster, newMacPoolId, getContext()); cluster.setMacPoolId(newMacPoolId); clusterDao.update(cluster); } } }

Target:
private void updateAllClustersMacPool() { final Guid newMacPoolId = getParameters().getStoragePool().getMacPoolId(); final boolean shouldSetNewMacPoolOnAllClusters = newMacPoolId != null; if (shouldSetNewMacPoolOnAllClusters) { List<Cluster> clusters = clusterDao.getAllForStoragePool(getStoragePoolId()); for (Cluster cluster : clusters) { boolean macPoolChanged = !newMacPoolId.equals(cluster.getMacPoolId()); if (macPoolChanged) { moveMacs.migrateMacsToAnotherMacPool(cluster, newMacPoolId, getContext()); cluster.setMacPoolId(newMacPoolId); clusterDao.update(cluster); } } } }
Source:
public void after() { for (String id: dtosToDelete) { submissionDao.delete(id); } if (request != null) { requestDao.delete(request.getId()); } if (researchProject != null) { researchProjectDao.delete(researchProject.getId()); } if (researchProject2 != null) { researchProjectDao.delete(researchProject2.getId()); } if (accessRequirement != null) { accessRequirementDAO.delete(accessRequirement.getId().toString()); } if (node != null) { nodeDao.delete(node.getId()); node = null; } if (user1 != null) { userGroupDAO.delete(user1.getId()); } if (user2 != null) { userGroupDAO.delete(user2.getId()); } }

Target:
public void after() { for (String id: dtosToDelete) { submissionDao.delete(id); } if (request != null) { requestDao.delete(request.getId()); } if (researchProject != null) { researchProjectDao.delete(researchProject.getId()); } if (researchProject2 != null) { researchProjectDao.delete(researchProject2.getId()); } if (accessRequirement != null) { accessRequirementDAO.delete(accessRequirement.getId().toString()); } if (accessRequirement2 != null) { accessRequirementDAO.delete(accessRequirement2.getId().toString()); } if (node != null) { nodeDao.delete(node.getId()); node = null; } if (user1 != null) { userGroupDAO.delete(user1.getId()); } if (user2 != null) { userGroupDAO.delete(user2.getId()); } }