auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void showAddContactDialog() { InputValidator inputValidator = new InputValidator() { @Override public boolean checkInput(String inputString) { return true; } @Override public boolean canClose(String inputString) { JID jid = new JID(inputString); return jid.isValid() && !jid.getName().isEmpty(); } }; String userID; try { userID = SafeDialogUtils.showInputDialog( project, Messages.AddContactButton_contact_jid_dialog_message, Messages.AddContactButton_contact_jid_dialog_initial_input, Messages.AddContactButton_contact_jid_dialog_title, inputValidator, new TextRange(0, 0)); } catch (IllegalAWTContextException e) { log.error("Account creation failed.", e); return; } if (userID == null) { log.debug("Adding contact canceled by user during user id entry."); return; } JID jid = new JID(userID); String nickname; try { nickname = SafeDialogUtils.showInputDialog( project, Messages.AddContactButton_contact_nickname_dialog_message, "", Messages.AddContactButton_contact_nickname_dialog_title); } catch (IllegalAWTContextException e) { log.error("Account creation failed.", e); return; } if (nickname == null) { log.debug("Adding contact canceled by user during user nickname entry."); return; } BiPredicate<String, String> dialog = (title, message) -> { log.fatal("showing dialog " + title + " - " + message); Integer integer; try { integer = SafeDialogUtils.showYesNoDialog(project, message, title); } catch (IllegalAWTContextException e) { log.error("Tried to run dialog in an illegal context", e); return false; } return integer != null && integer.equals(com.intellij.openapi.ui.Messages.YES); }; try { xmppContactsService.addContact(jid, nickname, dialog); } catch (OperationCanceledException e) { log.error("Adding contact failed", e); } }

Target:
private void showAddContactDialog() { JID jid; try { jid = getJID(); } catch (IllegalAWTContextException e) { log.error("Requesting JID for contact addition failed", e); showAccountCreationFailedErrorNotification(e); return; } if (jid == null) { log.debug("Adding contact canceled by user during user id entry."); return; } String nickname; try { nickname = getNickname(); } catch (IllegalAWTContextException e) { log.error("Requesting nickname for contact addition failed", e); showAccountCreationFailedErrorNotification(e); return; } if (nickname == null) { log.debug("Adding contact canceled by user during user nickname entry."); return; } addContact(jid, nickname); }
Source:
public void testToString() { assertEquals("toString", "filename1:10 func1()", fCallsite1.toString()); assertEquals("toString", "filename2:25 func2()", fCallsite2.toString()); assertEquals("toString", "filename3:123", fCallsite3.toString()); ITmfCallsite callsite = new TmfCallsite(null, fFunctionName1, fLine1); assertEquals("toString", ":10 func1()", callsite.toString()); }

Target:
public void testToString() { assertEquals("toString", "filename1:10 func1()", fCallsite1.toString()); assertEquals("toString", "filename2:25 func2()", fCallsite2.toString()); assertEquals("toString", "filename3:123", fCallsite3.toString()); }
Source:
public AttributeDefinition getAttributeDefinition() { AttributeDefinition attr = new AttributeDefinition(); attr.setNamespace(AttributesManager.NS_USER_ATTR_DEF); attr.setFriendlyName("gid-namespace"); attr.setDisplayName("git-namespace"); attr.setType(Integer.class.getName()); attr.setDescription("Gid namespace."); return attr; }

Target:
public AttributeDefinition getAttributeDefinition() { AttributeDefinition attr = new AttributeDefinition(); attr.setNamespace(AttributesManager.NS_USER_ATTR_DEF); attr.setFriendlyName("gid-namespace"); attr.setDisplayName("GID namespace"); attr.setType(Integer.class.getName()); attr.setDescription("Gid namespace."); return attr; }
Source:
public void deleteAllStudentsInCourse(String courseId) { Assumption.assertNotNull(courseId); List<StudentAttributes> studentsInCourse = studentsLogic.getStudentsForCourse(courseId); for (StudentAttributes student : studentsInCourse) { studentsLogic.deleteStudentCascade(courseId, student.email); } }

Target:
public void deleteAllStudentsInCourse(String courseId) { Assumption.assertNotNull(courseId); studentsLogic.deleteAllStudentsInCourse(courseId); }
Source:
public boolean verify(SessionContext session, byte[] sig) throws Exception { if (challengeDigest == null) { throw new IllegalStateException("initVerifier must be called before verify"); } ByteArrayBuffer data = new ByteArrayBuffer(sig); String keyType = data.getString(); if (!this.keyType.equals(keyType)) { return false; } byte[] rawSig = data.getBytes(); byte flags = data.getByte(); long counter = data.getUInt(); if ((flags & ~FLAG_USER_PRESENCE) != 0) { return false; } if ((flags & FLAG_USER_PRESENCE) != FLAG_USER_PRESENCE && !publicKey.isNoTouchRequired()) { return false; } ByteArrayBuffer encoded = new ByteArrayBuffer(); encoded.putString(getSignatureKeyType()); encoded.putBytes(rawSig); MessageDigest md = MessageDigest.getInstance("SHA-256"); byte[] appNameDigest = md.digest(publicKey.getAppName().getBytes(StandardCharsets.UTF_8)); byte[] challengeDigest = this.challengeDigest.digest(); ByteArrayBuffer counterData = new ByteArrayBuffer(Integer.BYTES, false); counterData.putInt(counter); Signature delegate = getDelegateSignature(); delegate.initVerifier(session, publicKey.getDelegatePublicKey()); delegate.update(session, appNameDigest); delegate.update(session, new byte[]{flags}); delegate.update(session, counterData.getCompactData()); delegate.update(session, challengeDigest); return delegate.verify(session, encoded.getCompactData()); }

Target:
public boolean verify(SessionContext session, byte[] sig) throws Exception { if (challengeDigest == null) { throw new IllegalStateException("initVerifier must be called before verify"); } ByteArrayBuffer data = new ByteArrayBuffer(sig); String keyType = data.getString(); if (!this.keyType.equals(keyType)) { return false; } byte[] rawSig = data.getBytes(); byte flags = data.getByte(); long counter = data.getUInt(); if ((flags & ~FLAG_USER_PRESENCE) != 0) { return false; } if ((flags & FLAG_USER_PRESENCE) != FLAG_USER_PRESENCE && !publicKey.isNoTouchRequired()) { return false; } ByteArrayBuffer encoded = new ByteArrayBuffer(); encoded.putString(getSignatureKeyType()); encoded.putBytes(rawSig); MessageDigest md = SecurityUtils.getMessageDigest("SHA-256"); byte[] appNameDigest = md.digest(publicKey.getAppName().getBytes(StandardCharsets.UTF_8)); byte[] challengeDigest = this.challengeDigest.digest(); ByteArrayBuffer counterData = new ByteArrayBuffer(Integer.BYTES, false); counterData.putInt(counter); Signature delegate = getDelegateSignature(); delegate.initVerifier(session, publicKey.getDelegatePublicKey()); delegate.update(session, appNameDigest); delegate.update(session, new byte[]{flags}); delegate.update(session, counterData.getCompactData()); delegate.update(session, challengeDigest); return delegate.verify(session, encoded.getCompactData()); }
Source:
private boolean bothWayMappingRequired(Object srcObject, String relationshipType, Object tgtObject, Relationship.Direction relationshipDirection) { boolean mapBothWays = false; ClassInfo tgtInfo = metaData.classInfo(tgtObject); if (tgtInfo == null) { LOGGER.warn("Unable to process on {}. Check the mapping.", relationshipType, srcObject.getClass()); return false; } for (FieldInfo tgtRelReader : tgtInfo.relationshipFields()) { Direction tgtRelationshipDirection = tgtRelReader.relationshipDirection(); if ((tgtRelationshipDirection.equals(Direction.OUTGOING) || tgtRelationshipDirection .equals(Direction.INCOMING)) && tgtRelReader.relationshipType().equals( relationshipType)) { if (relationshipDirection.equals(tgtRelationshipDirection)) { Object target = tgtRelReader.read(tgtObject); mapBothWays = targetEqualsSource(target, srcObject); } } if (mapBothWays) { break; } } return mapBothWays; }

Target:
private boolean bothWayMappingRequired(Object srcObject, String relationshipType, Object tgtObject, Relationship.Direction relationshipDirection) { boolean mapBothWays = false; ClassInfo tgtInfo = metaData.classInfo(tgtObject); if (tgtInfo == null) { LOGGER.warn("Unable to process on {}. Check the mapping.", relationshipType, srcObject.getClass()); return false; } for (FieldInfo tgtRelReader : tgtInfo.relationshipFields()) { Direction tgtRelationshipDirection = tgtRelReader.relationshipDirection(); if (tgtRelationshipDirection != Direction.UNDIRECTED && tgtRelReader.relationshipType() .equals(relationshipType) && relationshipDirection.equals(tgtRelationshipDirection)) { Object target = tgtRelReader.read(tgtObject); mapBothWays = targetEqualsSource(target, srcObject); } if (mapBothWays) { break; } } return mapBothWays; }
Source:
public void test_currencyExposure() { for (ResolvedFxSingleBarrierOption option : OPTION_ALL) { CurrencyAmount pv = PRICER.presentValue(option, RATE_PROVIDER, VOL_PROVIDER); MultiCurrencyAmount computed = PRICER.currencyExposure(option, RATE_PROVIDER, VOL_PROVIDER); FxMatrix fxMatrix = FxMatrix.builder().addRate(EUR, USD, SPOT + FD_EPS).build(); ImmutableRatesProvider provBumped = RATE_PROVIDER.toBuilder().fxRateProvider(fxMatrix).build(); CurrencyAmount pvBumped = PRICER.presentValue(option, provBumped, VOL_PROVIDER); double ceCounterFD = pvBumped.getAmount() - pv.getAmount(); double ceBaseFD = pvBumped.getAmount() * (SPOT + FD_EPS) - pv.getAmount() * SPOT; assertEquals(computed.getAmount(EUR).getAmount() * FD_EPS, ceCounterFD, NOTIONAL * FD_EPS); assertEquals(-(computed.getAmount(USD).getAmount() - pv.getAmount()) * FD_EPS, ceBaseFD, NOTIONAL * FD_EPS); } }

Target:
public void test_currencyExposure() { for (ResolvedFxSingleBarrierOption option : OPTION_ALL) { CurrencyAmount pv = PRICER.presentValue(option, RATE_PROVIDER, VOL_PROVIDER_FLAT); MultiCurrencyAmount computed = PRICER.currencyExposure(option, RATE_PROVIDER, VOL_PROVIDER_FLAT); FxMatrix fxMatrix = FxMatrix.builder().addRate(EUR, USD, SPOT + FD_EPS).build(); ImmutableRatesProvider provBumped = RATE_PROVIDER.toBuilder().fxRateProvider(fxMatrix).build(); CurrencyAmount pvBumped = PRICER.presentValue(option, provBumped, VOL_PROVIDER_FLAT); double ceCounterFD = pvBumped.getAmount() - pv.getAmount(); double ceBaseFD = pvBumped.getAmount() / (SPOT + FD_EPS) - pv.getAmount() / SPOT; assertEquals(computed.getAmount(EUR).getAmount() * FD_EPS, ceCounterFD, NOTIONAL * TOL); assertEquals(computed.getAmount(USD).getAmount() * (1.0d / (SPOT + FD_EPS) - 1.0d / SPOT), ceBaseFD, NOTIONAL * TOL); } }
Source:
private boolean processSecondCommand(TotalOrderRemoteTransactionState state, boolean commit) { if (state == null) { return true; } try { return state.waitUntilPrepared(commit); } catch (InterruptedException e) { Thread.currentThread().interrupt(); log.timeoutWaitingUntilTransactionPrepared(state.getGlobalTransaction().prettyPrint()); } return false; }

Target:
private boolean processSecondCommand(TotalOrderRemoteTransactionState state, boolean commit) { if (state == null) { return true; } try { return state.waitUntilPrepared(commit); } catch (InterruptedException e) { Thread.currentThread().interrupt(); log.timeoutWaitingUntilTransactionPrepared(state.getGlobalTransaction().globalId()); } return false; }
Source:
private static boolean importsOSGIUtil(ICompilationUnit unit) throws JavaModelException { for (IImportDeclaration i : unit.getImports()) { if (i.getElementName().startsWith("org.eclipse.osgi.util.")) { return true; } } return false; }

Target:
private static boolean importsOSGIUtil(ICompilationUnit unit) throws JavaModelException { for (IImportDeclaration importDecl : unit.getImports()) { if (importDecl.getElementName().startsWith("org.eclipse.osgi.util.")) { return true; } } return false; }
Source:
public String getColumnText(Object element, int columnIndex) { PMSymbolMatch p = (PMSymbolMatch) element; switch (columnIndex) { case 0: return p.getName(); case 1: PMSymbol fresh = p.getFresh(); return (fresh == null) ? "-" : String.valueOf(fresh.getPercent()); case 2: PMSymbol stale = p.getStale(); return (stale == null) ? "-" : String.valueOf(stale.getPercent()); case 3: String result = p.getResult(); try { Float.parseFloat(result); return result + "%"; } catch (Exception e) { return result; } case 4: return p.getEvent(); case 5: return ""; default: throw new RuntimeException("Something went wrong"); } }

Target:
public String getColumnText(Object element, int columnIndex) { PMSymbolMatch p = (PMSymbolMatch) element; switch (columnIndex) { case 0: return p.getName(); case 1: PMSymbol fresh = p.getFresh(); return (fresh == null) ? "--" : String.valueOf(fresh.getPercent()); case 2: PMSymbol stale = p.getStale(); return (stale == null) ? "--" : String.valueOf(stale.getPercent()); case 3: String result = p.getResult(); if(result != null && result.equals(PMSymbolMatch.SYMBOL_MATCHED)){ String difference = String.valueOf(p.getOverheadDifference()); return difference + "%"; } else{ return result; } case 4: return p.getEvent(); case 5: return ""; default: return ""; } }
Source:
public static StreamAddressSpaceMsg getStreamAddressSpaceMsg(StreamAddressSpace addressSpace) { StreamAddressSpaceMsg.Builder addressSpaceMsgBuilder = StreamAddressSpaceMsg.newBuilder(); addressSpaceMsgBuilder.setTrimMark(addressSpace.getTrimMark()); try(ByteString.Output bso = ByteString.newOutput()) { try(DataOutputStream dos = new DataOutputStream(bso)) { addressSpace.getAddressMap().serialize(dos); addressSpaceMsgBuilder.setAddressMap(bso.toByteString()); } } catch (Exception ex) { log.error("getStreamAddressSpaceMsg: error=[{}, {}] " + "while serializing roaring64NavigableMap", ex, ex.getCause()); } return addressSpaceMsgBuilder.build(); }

Target:
public static StreamAddressSpaceMsg getStreamAddressSpaceMsg(StreamAddressSpace addressSpace) { StreamAddressSpaceMsg.Builder addressSpaceMsgBuilder = StreamAddressSpaceMsg.newBuilder(); addressSpaceMsgBuilder.setTrimMark(addressSpace.getTrimMark()); try (ByteString.Output bso = ByteString.newOutput()) { try (DataOutputStream dos = new DataOutputStream(bso)) { Roaring64NavigableMap rm = addressSpace.getAddressMap(); rm.runOptimize(); rm.serialize(dos); addressSpaceMsgBuilder.setAddressMap(bso.toByteString()); } } catch (IOException ex) { throw new SerializerException("Unexpected error while serializing roaring64NavigableMap", ex); } return addressSpaceMsgBuilder.build(); }
Source:
public boolean onContextItemSelected(MenuItem item) { if (item.getItemId() == DELETE_REPEAT) { formEntryViewModel.setOnDeleted(() -> { FormController formController = getFormController(); if (formController != null && !formController.indexIsInFieldList()) { showNextView(); } else { refreshCurrentView(); } }); formEntryViewModel.setOnCancelled(() -> refreshCurrentView()); DialogUtils.showIfNotShowing(DeleteRepeatDialogFragment.class, getSupportFragmentManager()); } else { ODKView odkView = getCurrentViewIfODKView(); if (odkView != null) { for (QuestionWidget qw : odkView.getWidgets()) { if (item.getItemId() == qw.getId()) { createClearDialog(qw); break; } } } } return super.onContextItemSelected(item); }

Target:
public boolean onContextItemSelected(MenuItem item) { if (item.getItemId() == DELETE_REPEAT) { DialogUtils.showIfNotShowing(DeleteRepeatDialogFragment.class, getSupportFragmentManager()); } else { ODKView odkView = getCurrentViewIfODKView(); if (odkView != null) { for (QuestionWidget qw : odkView.getWidgets()) { if (item.getItemId() == qw.getId()) { createClearDialog(qw); break; } } } } return super.onContextItemSelected(item); }
Source:
public void testScriptCallFromJavascript() throws Exception { cacheManager.getCache().remove("a"); assertNull(cacheManager.getCache().get("a")); String result = (String) scriptingManager.runScript("testInnerScriptCall.js", new TaskContext().cache(cacheManager.getCache("test_cache")).addParameter("a", "ahoj")).get(); assertEquals("script1:additionFromJavascript", result); assertEquals("ahoj", cacheManager.getCache().get("a")); }

Target:
public void testScriptCallFromJavascript() throws Exception { String result = (String) scriptingManager.runScript("testInnerScriptCall.js", new TaskContext().cache(cacheManager.getCache("test_cache")).addParameter("a", "ahoj")).get(); assertEquals("script1:additionFromJavascript", result); assertEquals("ahoj", cacheManager.getCache().get("a")); }
Source:
public Set<Entitlement> batchListModifying(List<Entitlement> entitlements) { Set<Entitlement> modifying = new HashSet<Entitlement>(); ProductEntitlements pidEnts = getOverlappingForModifying(entitlements); if (pidEnts.isEmpty()) { return modifying; } List<Product> overlappingProducts = productAdapter.getProductsByIds(pidEnts.getAllProductIds()); for (Product overlappingProduct : overlappingProducts) { boolean modifies = false; for (Entitlement inputEntitlement : entitlements) { if (overlappingProduct.modifies(inputEntitlement.getProductId())) { modifies = true; break; } Iterator<ProvidedProduct> providedProductOfInput = inputEntitlement .getPool().getProvidedProducts() .iterator(); while (!modifies && providedProductOfInput.hasNext()) { if (overlappingProduct.modifies(providedProductOfInput.next().getProductId())) { modifies = true; } } if (modifies) { modifying.addAll(pidEnts.getEntitlementsByProductId(overlappingProduct.getId())); } } } return modifying; }

Target:
public Set<Entitlement> batchListModifying(List<Entitlement> entitlements) { Set<Entitlement> modifying = new HashSet<Entitlement>(); ProductEntitlements pidEnts = getOverlappingForModifying(entitlements); if (pidEnts.isEmpty()) { return modifying; } List<Product> overlappingProducts = productAdapter.getProductsByIds(pidEnts.getAllProductIds()); for (Product overlappingProduct : overlappingProducts) { boolean modifies = false; for (Entitlement inputEntitlement : entitlements) { if (overlappingProduct.modifies(inputEntitlement.getProductId())) { modifies = true; } Iterator<ProvidedProduct> providedProductOfInput = inputEntitlement .getPool().getProvidedProducts() .iterator(); while (!modifies && providedProductOfInput.hasNext()) { if (overlappingProduct.modifies(providedProductOfInput.next().getProductId())) { modifies = true; } } if (modifies) { modifying.addAll(pidEnts.getEntitlementsByProductId(overlappingProduct.getId())); } } } return modifying; }
Source:
protected List<Path> getDefaultIdentities(@NonNull File sshDir) { return (List) Arrays.asList(this.defaultIdentities).stream().map((s) -> { return (new File(sshDir, s)).toPath(); }).filter((var0) -> { return Files.exists(var0, new LinkOption[0]); }).collect(Collectors.toList()); }

Target:
protected List<Path> getDefaultIdentities(@NonNull File sshDir) { return Stream.of(defaultIdentities) .map(s -> sshDir.toPath().resolve(s)) .filter(path -> Files.exists(path)) .collect(Collectors.toList()); }
Source:
public void createAccount(AccountAttributes accountToAdd) throws InvalidParametersException { try { if (accountToAdd != null && accountToAdd.studentProfile == null) { accountToAdd.studentProfile = new StudentProfileAttributes(); accountToAdd.studentProfile.googleId = accountToAdd.googleId; } createEntity(accountToAdd); } catch (EntityAlreadyExistsException e) { try { updateAccount(accountToAdd, true); } catch (EntityDoesNotExistException edne) { Assumption.fail("Account found be already existing and not existing simultaneously"); } } try { profilesDb.createEntity(accountToAdd.studentProfile); } catch (EntityAlreadyExistsException e) { try { profilesDb.updateStudentProfile(accountToAdd.studentProfile); } catch (EntityDoesNotExistException edne) { Assumption.fail("StudentProfile found be already existing and not existing simultaneously"); } } }

Target:
public void createAccount(AccountAttributes accountToAdd) throws InvalidParametersException { try { if (accountToAdd != null && accountToAdd.studentProfile == null) { accountToAdd.studentProfile = new StudentProfileAttributes(); accountToAdd.studentProfile.googleId = accountToAdd.googleId; } createEntity(accountToAdd); } catch (EntityAlreadyExistsException e) { try { updateAccount(accountToAdd, true); } catch (EntityDoesNotExistException edne) { Assumption.fail("Account found to be already existing and not existing simultaneously"); } } try { profilesDb.createEntity(accountToAdd.studentProfile); } catch (EntityAlreadyExistsException e) { try { profilesDb.updateStudentProfile(accountToAdd.studentProfile); } catch (EntityDoesNotExistException edne) { Assumption.fail("StudentProfile found to be already existing and not existing simultaneously"); } } }
Source:
public void nextTuple() { try { if (refreshSubscriptionTimer.isExpiredResetOnTrue()) { kafkaSpoutConfig.getSubscription().refreshAssignment(); } if (commitTimer != null && commitTimer.isExpiredResetOnTrue()) { if (isAtLeastOnceProcessing()) { commitOffsetsForAckedTuples(kafkaConsumer.assignment()); } else if (kafkaSpoutConfig.getProcessingGuarantee() == ProcessingGuarantee.NONE) { Map<TopicPartition, OffsetAndMetadata> offsetsToCommit = createOffsetsToCommitForConsumedOffsets(kafkaConsumer.assignment()); kafkaConsumer.commitAsync(offsetsToCommit, null); LOG.debug("Committed offsets to Kafka", offsetsToCommit); } } PollablePartitionsInfo pollablePartitionsInfo = getPollablePartitionsInfo(); if (pollablePartitionsInfo.shouldPoll()) { try { setWaitingToEmit(pollKafkaBroker(pollablePartitionsInfo)); } catch (RetriableException e) { LOG.error("Failed to poll from kafka.", e); } } emitIfWaitingNotEmitted(); } catch (InterruptException e) { throwKafkaConsumerInterruptedException(); } }

Target:
public void nextTuple() { try { if (refreshSubscriptionTimer.isExpiredResetOnTrue()) { kafkaSpoutConfig.getSubscription().refreshAssignment(); } if (commitTimer != null && commitTimer.isExpiredResetOnTrue()) { if (isAtLeastOnceProcessing()) { commitOffsetsForAckedTuples(kafkaConsumer.assignment()); } else if (kafkaSpoutConfig.getProcessingGuarantee() == ProcessingGuarantee.NO_GUARANTEE) { Map<TopicPartition, OffsetAndMetadata> offsetsToCommit = createFetchedOffsetsMetadata(kafkaConsumer.assignment()); kafkaConsumer.commitAsync(offsetsToCommit, null); LOG.debug("Committed offsets to Kafka", offsetsToCommit); } } PollablePartitionsInfo pollablePartitionsInfo = getPollablePartitionsInfo(); if (pollablePartitionsInfo.shouldPoll()) { try { setWaitingToEmit(pollKafkaBroker(pollablePartitionsInfo)); } catch (RetriableException e) { LOG.error("Failed to poll from kafka.", e); } } emitIfWaitingNotEmitted(); } catch (InterruptException e) { throwKafkaConsumerInterruptedException(); } }
Source:
protected ListenerList<IDebugContextListener> getPostListeners(IWorkbenchPart part) { String id = null; if (part != null) { id = getCombinedPartId(part); ListenerList<IDebugContextListener> listenerList = fPostListenersByPartId.get(id); return listenerList != null ? listenerList : new ListenerList<IDebugContextListener>(); } else { ListenerList<IDebugContextListener> retVal = fPostListenersByPartId.get(null); if (retVal == null) { return new ListenerList<IDebugContextListener>(); } outer: for (Iterator<String> itr = fPostListenersByPartId.keySet().iterator(); itr.hasNext();) { String listenerPartId = itr.next(); for (int i = 0; i < fProviders.size(); i++) { String providerPartId = getCombinedPartId(fProviders.get(i).getPart()); if ((listenerPartId == null && providerPartId == null) || (listenerPartId != null && listenerPartId.equals(providerPartId))) { continue outer; } } for (IDebugContextListener iDebugContextListener : fPostListenersByPartId.get(listenerPartId)) { retVal.add(iDebugContextListener); } } return retVal; } }

Target:
protected ListenerList<IDebugContextListener> getPostListeners(IWorkbenchPart part) { String id = null; if (part != null) { id = getCombinedPartId(part); ListenerList<IDebugContextListener> listenerList = fPostListenersByPartId.get(id); return listenerList != null ? listenerList : new ListenerList<IDebugContextListener>(); } else { ListenerList<IDebugContextListener> retVal = fPostListenersByPartId.get(null); if (retVal == null) { retVal = new ListenerList<IDebugContextListener>(); } outer: for (Iterator<String> itr = fPostListenersByPartId.keySet().iterator(); itr.hasNext();) { String listenerPartId = itr.next(); for (int i = 0; i < fProviders.size(); i++) { String providerPartId = getCombinedPartId(fProviders.get(i).getPart()); if ((listenerPartId == null && providerPartId == null) || (listenerPartId != null && listenerPartId.equals(providerPartId))) { continue outer; } } for (IDebugContextListener iDebugContextListener : fPostListenersByPartId.get(listenerPartId)) { if (iDebugContextListener != null) { retVal.add(iDebugContextListener); } } } return retVal; } }
Source:
private void nudgeAutosave() { if (autoSaveTimer_.isRunning()) autoSaveTimer_.cancel(); if (prefs_.autoSaveOnIdle().getValue() == UserPrefs.AUTO_SAVE_ON_IDLE_COMMIT) autoSaveTimer_.schedule(prefs_.autoSaveMs()); }

Target:
private void nudgeAutosave() { autoSaveTimer_.cancel(); if (prefs_.autoSaveOnIdle().getValue() == UserPrefs.AUTO_SAVE_ON_IDLE_COMMIT) autoSaveTimer_.schedule(prefs_.autoSaveMs()); }
Source:
private MXBeanParameterInfo getMXBeanArgumentAnnotation(Method m, int seq) { Annotation[][] annotations = m.getParameterAnnotations(); assert seq < annotations.length; for (Annotation annotation : annotations[seq]) { if (annotation instanceof MXBeanParameterInfo) { return (MXBeanParameterInfo) annotation; } } return null; }

Target:
private MXBeanParameter getMXBeanArgumentAnnotation(Method m, int seq) { Parameter[] params = m.getParameters(); if (seq < params.length) return params[seq].getAnnotation(MXBeanParameter.class); return null; }
Source:
public synchronized Pair<Boolean, String> canUpdateCatalog() { if (m_dataSourcesClosing.isEmpty()) { return new Pair<>(Boolean.TRUE, null); } else { String msg = "Unable to update catalog, these tables are still closing: " + m_dataSourcesClosing.keySet(); return new Pair<>(Boolean.FALSE, msg); } }

Target:
public synchronized String canUpdateCatalog() { if (m_dataSourcesClosing.isEmpty()) { return null; } else { String msg = "Unable to update catalog, these export streams are still closing: " + m_dataSourcesClosing.keySet(); return msg; } }
Source:
private void emitNoResolvedType(NoType type, String defaultEmit) { if (!opts.partialInput || !type.isNoResolvedType()) { emit(defaultEmit); return; } NoResolvedType nType = (NoResolvedType) type; if (nType.getReferenceName() == null) { emit(defaultEmit); return; } String displayName = type.getDisplayName(); if (importRenameMap.containsKey(displayName)) { displayName = importRenameMap.get(displayName); } if (maybeEmitGlobalAlias(type)) return; emit(displayName); List<JSType> templateTypes = nType.getTemplateTypes(); if (templateTypes != null && templateTypes.size() > 0) { emitGenericTypeArguments(type.getTemplateTypes().iterator()); } }

Target:
private void emitNoResolvedType(NoType type, String defaultEmit) { if (!opts.partialInput || !type.isNoResolvedType()) { emit(defaultEmit); return; } if (maybeEmitGlobalAlias(type)) return; NoResolvedType nType = (NoResolvedType) type; if (nType.getReferenceName() == null) { emit(defaultEmit); return; } String displayName = type.getDisplayName(); if (importRenameMap.containsKey(displayName)) { displayName = importRenameMap.get(displayName); } emit(displayName); List<JSType> templateTypes = nType.getTemplateTypes(); if (templateTypes != null && templateTypes.size() > 0) { emitGenericTypeArguments(type.getTemplateTypes().iterator()); } }
Source:
private static String toPathString(String moduleName) { return moduleName.replace('.', File.separatorChar) + File.separatorChar + moduleName + File.separatorChar; }

Target:
private static String toPathString(String moduleName) { return moduleName.replace('.', File.separatorChar) + File.separatorChar + moduleName; }
Source:
public String toString() { String base = reverse ? "" + to + ".." + from : "" + from + ".." + to; return Integer.valueOf(1).equals(stepSize) ? base : base + ".withStepSize(" + stepSize + ")"; }

Target:
public String toString() { return getToString(to.toString(), from.toString()); }
Source:
public boolean hasNext() { if (constraintFiles != null && currentConstraintIndex < constraintFiles.length) { return true; } while (constraintFiles != null && currentConstraintIndex == constraintFiles.length) { currentDbIndex ++; if (currentDbIndex < dbDirs.length) { currentConstraintIndex = 0; constraintFiles = listConstraintFilesInDBDir(fs, dbDirs[0].getPath()); } else { constraintFiles = null; } } if (constraintFiles != null) { return true; } else { return false; } }

Target:
public boolean hasNext() { if (dbDirs == null) { try { dbDirs = fs.listStatus(path, EximUtil.getDirectoryFilter(fs)); } catch (IOException e) { throw new RuntimeException(e); } currentDbIndex = 0; if (dbDirs.length != 0) { currentConstraintIndex = 0; constraintFiles = listConstraintFilesInDBDir(fs, dbDirs[0].getPath()); } } if ((currentDbIndex < dbDirs.length) && (currentConstraintIndex < constraintFiles.length)) { return true; } while ((currentDbIndex < dbDirs.length) && (currentConstraintIndex == constraintFiles.length)) { currentDbIndex ++; if (currentDbIndex < dbDirs.length) { currentConstraintIndex = 0; constraintFiles = listConstraintFilesInDBDir(fs, dbDirs[currentDbIndex].getPath()); } else { constraintFiles = null; } } return constraintFiles != null; }
Source:
public boolean filter(String path0, boolean folder, boolean isArchive) { if (!folder && fExtraResourceFileFilters != null) { char[] name= path0.toCharArray(); for (char[] fExtraResourceFileFilter : fExtraResourceFileFilters) if (match(fExtraResourceFileFilter, name, true)) return true; } if (folder && fExtraResourceFolderFilters != null) { for (String fExtraResourceFolderFilter : fExtraResourceFolderFilters) if (fExtraResourceFolderFilter.equals(path0)) return true; } return false; }

Target:
public boolean filter(String path0, boolean folder, boolean isArchive) { if (!folder && fExtraResourceFileFilters != null) { char[] name= path0.toCharArray(); for (char[] filter : fExtraResourceFileFilters) if (match(filter, name, true)) return true; } if (folder && fExtraResourceFolderFilters != null) { for (String filter : fExtraResourceFolderFilters) if (filter.equals(path0)) return true; } return false; }
Source:
public String toString() { StringBuilder builder = new StringBuilder("SQLException."); if (code != null) { builder.append(code.toString()); } if (message != null) { builder.append(" ").append(message); } if (schemaName != null) { builder.append(" ").append(SCHEMA_NAME).append("=").append(schemaName).append(";"); } if (tableName != null) { builder.append(" ").append(TABLE_NAME).append("=").append(tableName).append(";"); } if (familyName != null) { builder.append(" ").append(FAMILY_NAME).append("=").append(familyName).append(";"); } if (columnName != null) { builder.append(" ").append(COLUMN_NAME).append("=").append(columnName).append(";"); } if (lineNumber != null) { builder.append(" ").append(LINE_NUMBER).append("=").append(lineNumber).append(";"); } return builder.toString(); }

Target:
public String toString() { StringBuilder builder = new StringBuilder("SQLException! "); if (code != null) { builder.append(code.toString()); } if (message != null) { builder.append(" ").append(message); } String columnDisplayName = SchemaUtil.getColumnDisplayName(schemaName, tableName, familyName, columnName); if (columnName != null) { builder.append(" ").append(COLUMN_NAME).append("=").append(columnDisplayName); } else if (familyName != null) { builder.append(" ").append(FAMILY_NAME).append("=").append(columnDisplayName); } else if (tableName != null) { builder.append(" ").append(TABLE_NAME).append("=").append(columnDisplayName); } else if (schemaName != null) { builder.append(" ").append(SCHEMA_NAME).append("=").append(columnDisplayName); } if (lineNumber != null) { builder.append(" ").append(LINE_NUMBER).append("=").append(lineNumber).append(";"); } return builder.toString(); }
Source:
private void setUpViewPager(ViewPager viewPager) { FeedViewPagerAdapter feedViewPagerAdapter = new FeedViewPagerAdapter(getChildFragmentManager()); feedViewPagerAdapter.addFragment(FacebookFeedFragment.getInstance(openCommentsDialogListener, onImageZoomListener), "FACEBOOK"); feedViewPagerAdapter.addFragment(TwitterFeedFragment.getInstance(onImageZoomListener), "TWITTER"); feedViewPagerAdapter.notifyDataSetChanged(); viewPager.setAdapter(feedViewPagerAdapter); }

Target:
private void setUpViewPager(ViewPager viewPager) { FeedViewPagerAdapter feedViewPagerAdapter = new FeedViewPagerAdapter(getChildFragmentManager()); feedViewPagerAdapter.addFragment(FacebookFeedFragment.getInstance(openCommentsDialogListener, onImageZoomListener), getString(R.string.facebook)); feedViewPagerAdapter.addFragment(TwitterFeedFragment.getInstance(onImageZoomListener), getString(R.string.twitter)); feedViewPagerAdapter.notifyDataSetChanged(); viewPager.setAdapter(feedViewPagerAdapter); }
Source:
protected boolean isProblem(IReference reference) { IApiMethod method = (IApiMethod) reference.getMember(); IApiType type = (IApiType) reference.getResolvedReference(); try { IApiAnnotations annotations = type.getApiComponent().getApiDescription().resolveAnnotations(type.getHandle()); if (annotations != null) { if (VisibilityModifiers.isPrivate(annotations.getVisibility())) { if ((Flags.AccProtected & method.getModifiers()) > 0) { IApiDescription description = method.getApiComponent().getApiDescription(); annotations = description.resolveAnnotations(method.getHandle().getEnclosingType()); if (annotations == null || RestrictionModifiers.isExtendRestriction(annotations.getRestrictions())) { return false; } } return true; } } else { if (isEnclosingTypeVisible(type)) { if (type.getName() != null) { if (!type.getName().startsWith("javax.")) { ApiPlugin.log(new Status(IStatus.INFO, ApiPlugin.PLUGIN_ID, MessageFormat.format(BuilderMessages.AbstractTypeLeakDetector_vis_type_has_no_api_description, type.getName()))); } } } else { return true; } } } catch (CoreException e) { ApiPlugin.log(e); } return false; }

Target:
protected boolean isProblem(IReference reference) { IApiMethod method = (IApiMethod) reference.getMember(); IApiType type = (IApiType) reference.getResolvedReference(); try { IApiAnnotations annotations = type.getApiComponent().getApiDescription().resolveAnnotations(type.getHandle()); if (annotations != null) { if (VisibilityModifiers.isPrivate(annotations.getVisibility())) { if ((Flags.AccProtected & method.getModifiers()) > 0) { IApiDescription description = method.getApiComponent().getApiDescription(); annotations = description.resolveAnnotations(method.getHandle().getEnclosingType()); if (annotations == null || RestrictionModifiers.isExtendRestriction(annotations.getRestrictions())) { return false; } } return true; } } else { if (isEnclosingTypeVisible(type)) { String typeName = type.getName(); if (typeName != null) { if (!typeName.startsWith("javax.")) { ApiPlugin.log(new Status(IStatus.INFO, ApiPlugin.PLUGIN_ID, MessageFormat.format(BuilderMessages.AbstractTypeLeakDetector_vis_type_has_no_api_description, typeName))); } } } else { return true; } } } catch (CoreException e) { ApiPlugin.log(e); } return false; }
Source:
public VMs list() { VMs vms = new VMs(); if (QueryHelper.hasMatrixParam(getUriInfo(), UNREGISTERED_CONSTRAINT_PARAMETER)) { List<org.ovirt.engine.core.common.businessentities.VM> unregisteredVms = getBackendCollection(VdcQueryType.GetUnregisteredVms, new UnregisteredEntitiesQueryParameters(storageDomainId, VmEntityType.VM.name())); List<VM> collection = new ArrayList<VM>(); for (org.ovirt.engine.core.common.businessentities.VM entity : unregisteredVms) { VM vm = map(entity); collection.add(addLinks(populate(vm, entity))); } vms.getVMs().addAll(collection); } return vms; }

Target:
public VMs list() { VMs vms = new VMs(); if (QueryHelper.hasMatrixParam(getUriInfo(), UNREGISTERED_CONSTRAINT_PARAMETER)) { List<org.ovirt.engine.core.common.businessentities.VM> unregisteredVms = getBackendCollection(VdcQueryType.GetUnregisteredVms, new UnregisteredEntitiesQueryParameters(storageDomainId, VmEntityType.VM.name())); List<VM> collection = new ArrayList<VM>(); for (org.ovirt.engine.core.common.businessentities.VM entity : unregisteredVms) { VM vm = map(entity); collection.add(addLinks(populate(vm, entity))); } vms.getVMs().addAll(collection); } else { vms.getVMs().addAll(getCollection()); } return vms; }
Source:
private void loadAsset(String filename) { subscription = Observable.fromCallable(()-> { InputStream input = null; try { TypedArray res = AboutActivity.this.getTheme().obtainStyledAttributes( new int[] { android.R.attr.textColorPrimary }); int colorResource = res.getColor(0, 0); String colorString = String.format("#%06X", 0xFFFFFF & colorResource); res.recycle(); input = getAssets().open(filename); String webViewData = IOUtils.toString(input, Charset.defaultCharset()); if (!webViewData.startsWith("<!DOCTYPE html>")) { webViewData = webViewData.replace("%", "&#37;"); webViewData = "<!DOCTYPE html>" + "<html>" + "<head>" + " <meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\">" + " <style type=\"text/css\">" + " @font-face {" + " font-family: 'Roboto-Light';" + " src: url('file:/ " }" + " * {" + " color: %s;" + " font-family: roboto-Light;" + " font-size: 8pt;" + " }" + " </style>" + "</head><body><p>" + webViewData + "</p></body></html>"; webViewData = webViewData.replace("\n", "<br/>"); } webViewData = String.format(webViewData, colorString); return webViewData; } catch (IOException e) { Log.e(TAG, Log.getStackTraceString(e)); throw e; } finally { IOUtils.closeQuietly(input); } }) .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) .subscribe( webviewData -> webView.loadDataWithBaseURL("file:/ error -> Log.e(TAG, Log.getStackTraceString(error)) ); }

Target:
private void loadAsset(String filename) { subscription = Single.create(subscriber -> { InputStream input = null; try { TypedArray res = AboutActivity.this.getTheme().obtainStyledAttributes( new int[] { android.R.attr.textColorPrimary }); int colorResource = res.getColor(0, 0); String colorString = String.format("#%06X", 0xFFFFFF & colorResource); res.recycle(); input = getAssets().open(filename); String webViewData = IOUtils.toString(input, Charset.defaultCharset()); if (!webViewData.startsWith("<!DOCTYPE html>")) { webViewData = webViewData.replace("%", "&#37;"); webViewData = "<!DOCTYPE html>" + "<html>" + "<head>" + " <meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\">" + " <style type=\"text/css\">" + " @font-face {" + " font-family: 'Roboto-Light';" + " src: url('file:/ " }" + " * {" + " color: %s;" + " font-family: roboto-Light;" + " font-size: 8pt;" + " }" + " </style>" + "</head><body><p>" + webViewData + "</p></body></html>"; webViewData = webViewData.replace("\n", "<br/>"); } webViewData = String.format(webViewData, colorString); subscriber.onSuccess(webViewData); } catch (IOException e) { Log.e(TAG, Log.getStackTraceString(e)); subscriber.onError(e); } finally { IOUtils.closeQuietly(input); } }) .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) .subscribe( webViewData -> webView.loadDataWithBaseURL("file:/ error -> Log.e(TAG, Log.getStackTraceString(error)) ); }
Source:
public boolean matches(ITmfEvent event) { boolean match = false; ITmfTrace trace = event.getTrace(); if (trace.getClass().equals(fTraceClass)) { if (fTraceTypeId != null) { if (fTraceTypeId.equals(trace.getTraceTypeId())) { match = true; } } else { match = true; } } if (match ^ isNot()) { for (ITmfFilterTreeNode node : getChildren()) { if (! node.matches(event)) { return isNot(); } } return !isNot(); } return isNot(); }

Target:
public boolean matches(ITmfEvent event) { boolean match = false; ITmfTrace trace = event.getTrace(); if (trace.getClass().equals(fTraceClass)) { if (fTraceTypeId != null) { if (fTraceTypeId.equals(trace.getTraceTypeId())) { match = true; } } else { match = true; } } if (match ^ isNot()) { for (ITmfFilterTreeNode node : getChildren()) { if (!node.matches(event)) { return false; } } return true; } return false; }
Source:
public QueryRegistrationHandler(final TSDB tsdb, final HttpHandler next) { this.tsdb = tsdb; this.next = next; closeTask = new Runnable() { @Override public void run() { LOG.info("Closing the query!"); } }; }

Target:
public QueryRegistrationHandler(final TSDB tsdb, final HttpHandler next) { this.tsdb = tsdb; this.next = next; }
Source:
protected boolean containerAllowsStaticFieldAccess() { final String allowStaticFieldAcccess = container.getInstance(String.class, StrutsConstants.STRUTS_ALLOW_STATIC_FIELD_ACCESS); if (allowStaticFieldAcccess == null) { return true; } else { return BooleanUtils.toBoolean(allowStaticFieldAcccess); } }

Target:
protected boolean containerAllowsStaticFieldAccess() { return BooleanUtils.toBoolean(container.getInstance(String.class, StrutsConstants.STRUTS_ALLOW_STATIC_FIELD_ACCESS)); }
Source:
public boolean visible() throws IOException { final boolean shown; if (this.file.exists()) { final UserDefinedFileAttributeView view = Files.getFileAttributeView( this.file.toPath(), UserDefinedFileAttributeView.class ); if (view.list().contains(MkAttributes.VISIBILITY)) { final ByteBuffer buf = ByteBuffer.allocate( view.size(MkAttributes.VISIBILITY) ); view.read(MkAttributes.VISIBILITY, buf); buf.flip(); shown = Boolean.valueOf(Charsets.UTF_8.decode(buf).toString()); } else { shown = false; } } else { shown = false; } return shown; }

Target:
public boolean visible() throws IOException { final boolean shown; final UserDefinedFileAttributeView view = Files.getFileAttributeView( this.file.toPath(), UserDefinedFileAttributeView.class ); if (view.list().contains(MkAttributes.VISIBILITY)) { final ByteBuffer buf = ByteBuffer.allocate( view.size(MkAttributes.VISIBILITY) ); view.read(MkAttributes.VISIBILITY, buf); buf.flip(); shown = Boolean.valueOf( StandardCharsets.UTF_8.decode(buf).toString() ); } else { shown = false; } return shown; }
Source:
protected void extraValidation( final List<Throwable> validationErrors, final Configuration configuration) { if (this.reportTemplate != null && this.reportKey == null || this.reportTemplate == null && this.reportKey != null) { validationErrors.add(new ConfigurationException("'reportKey' and 'reportTemplate' must ither " + "both be null or both be non-null. reportKey: " + this.reportKey + " reportTemplate: " + this.reportTemplate)); } for (Attribute attribute : this.allAttributes.values()) { attribute.validate(validationErrors, configuration); } ProcessorDependencyGraphFactory.fillProcessorAttributes(this.processors, this.allAttributes); for (Processor processor : this.processors) { processor.validate(validationErrors, configuration); } final Map<String, Class<?>> attcls = new HashMap<String, Class<?>>(); for (String attributeName: this.allAttributes.keySet()) { attcls.put(attributeName, this.allAttributes.get(attributeName).getValueType()); } try { this.processorGraph = this.processorGraphFactory.build(this.processors, attcls); } catch (IllegalArgumentException e) { validationErrors.add(e); } if (this.processorGraph == null) { validationErrors.add(new ConfigurationException( "There are no child processors for this processor")); } else { final Set<Processor<?, ?>> allProcessors = this.processorGraph.getAllProcessors(); for (Processor<?, ?> processor : allProcessors) { processor.validate(validationErrors, configuration); } } }

Target:
protected void extraValidation( final List<Throwable> validationErrors, final Configuration configuration) { if (this.reportTemplate != null && this.reportKey == null || this.reportTemplate == null && this.reportKey != null) { validationErrors.add(new ConfigurationException("'reportKey' and 'reportTemplate' must ither " + "both be null or both be non-null. reportKey: " + this.reportKey + " reportTemplate: " + this.reportTemplate)); } for (Attribute attribute : this.internalAttributes.values()) { attribute.validate(validationErrors, configuration); } ProcessorDependencyGraphFactory.fillProcessorAttributes(this.processors, this.allAttributes); for (Processor processor : this.processors) { processor.validate(validationErrors, configuration); } final Map<String, Class<?>> attcls = new HashMap<String, Class<?>>(); for (String attributeName: this.allAttributes.keySet()) { attcls.put(attributeName, this.allAttributes.get(attributeName).getValueType()); } try { this.processorGraph = this.processorGraphFactory.build(this.processors, attcls); } catch (IllegalArgumentException e) { validationErrors.add(e); } if (this.processorGraph == null) { validationErrors.add(new ConfigurationException( "There are no child processors for this processor")); } else { final Set<Processor<?, ?>> allProcessors = this.processorGraph.getAllProcessors(); for (Processor<?, ?> processor : allProcessors) { processor.validate(validationErrors, configuration); } } }
Source:
Helper(@GerritServerConfig final Config config, final GroupCache groupCache) { this.groupCache = groupCache; this.config = config; this.server = LdapRealm.required(config, "server"); this.username = LdapRealm.optional(config, "username"); this.password = LdapRealm.optional(config, "password"); this.referral = LdapRealm.optional(config, "referral"); this.sslVerify = config.getBoolean("ldap", "sslverify", true); String timeout = LdapRealm.optional(config, "readTimeout"); if (timeout != null) { this.readTimeOutMillis = Long.toString(ConfigUtil.getTimeUnit(timeout, 0, TimeUnit.MILLISECONDS)); } else { this.readTimeOutMillis = null; } }

Target:
Helper(@GerritServerConfig final Config config, final GroupCache groupCache) { this.groupCache = groupCache; this.config = config; this.server = LdapRealm.required(config, "server"); this.username = LdapRealm.optional(config, "username"); this.password = LdapRealm.optional(config, "password"); this.referral = LdapRealm.optional(config, "referral"); this.sslVerify = config.getBoolean("ldap", "sslverify", true); String timeout = LdapRealm.optional(config, "readTimeout"); if (timeout != null) { readTimeOutMillis = Long.toString(ConfigUtil.getTimeUnit(timeout, 0, TimeUnit.MILLISECONDS)); } else { readTimeOutMillis = null; } }
Source:
private void rollBackVdsGroupConsumptionParameters(List<QuotaVdsGroupConsumptionParameter> executed) { for (QuotaVdsGroupConsumptionParameter parameter : executed) { long requestedMemory = parameter.getQuotaAction() == QuotaConsumptionParameter.QuotaAction.CONSUME ? -parameter.getRequestedMemory() : parameter.getRequestedMemory(); int requestedCpu = parameter.getQuotaAction() == QuotaConsumptionParameter.QuotaAction.CONSUME ? -parameter.getRequestedCpu() : parameter.getRequestedCpu(); QuotaVdsGroup quotaVdsGroup = null; Quota quota = parameter.getQuota(); if (quota.getGlobalQuotaVdsGroup() != null) { quotaVdsGroup = quota.getGlobalQuotaVdsGroup(); } else { for (QuotaVdsGroup vdsGroup : quota.getQuotaVdsGroups()) { if (vdsGroup.getVdsGroupId().equals(parameter.getVdsGroupId())) { quotaVdsGroup = vdsGroup; break; } } } long newMemory = requestedMemory + quotaVdsGroup.getMemSizeMBUsage(); int newVcpu = requestedCpu + quotaVdsGroup.getVirtualCpuUsage(); cacheNewValues(quotaVdsGroup, newMemory, newVcpu); } }

Target:
private void rollBackVdsGroupConsumptionParameters(List<QuotaVdsGroupConsumptionParameter> executed) { for (QuotaVdsGroupConsumptionParameter parameter : executed) { long requestedMemory = parameter.getQuotaAction() == QuotaConsumptionParameter.QuotaAction.CONSUME ? -parameter.getRequestedMemory() : parameter.getRequestedMemory(); int requestedCpu = parameter.getQuotaAction() == QuotaConsumptionParameter.QuotaAction.CONSUME ? -parameter.getRequestedCpu() : parameter.getRequestedCpu(); QuotaVdsGroup quotaVdsGroup = null; Quota quota = parameter.getQuota(); if (quota.getGlobalQuotaVdsGroup() != null) { quotaVdsGroup = quota.getGlobalQuotaVdsGroup(); } else { for (QuotaVdsGroup vdsGroup : quota.getQuotaVdsGroups()) { if (vdsGroup.getVdsGroupId().equals(parameter.getVdsGroupId())) { quotaVdsGroup = vdsGroup; break; } } } if (quotaVdsGroup != null) { long newMemory = requestedMemory + quotaVdsGroup.getMemSizeMBUsage(); int newVcpu = requestedCpu + quotaVdsGroup.getVirtualCpuUsage(); cacheNewValues(quotaVdsGroup, newMemory, newVcpu); } } }
Source:
public ObjectInstance createMBean(String className, ObjectName name) { throw new UnsupportedOperationException("createMBean not supported over Jolokia"); }

Target:
public ObjectInstance createMBean(String className, ObjectName name) { throw new UnsupportedOperationException("createMBean not supported by Jolokia"); }