auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public synchronized void uploadExecutableFlow(final ExecutableFlow flow) throws ExecutorManagerException { final String useExecutorParam = flow.getExecutionOptions().getFlowParameters().get(ExecutionOptions.USE_EXECUTOR); final String executorId = StringUtils.isNotEmpty(useExecutorParam) ? useExecutorParam : "-1"; final String INSERT_EXECUTABLE_FLOW = "INSERT INTO execution_flows " + "(project_id, flow_id, version, status, submit_time, submit_user, update_time, " + "use_executor) values (?,?,?,?,?,?,?,?)"; final long submitTime = System.currentTimeMillis(); flow.setStatus(Status.PREPARING); flow.setSubmitTime(submitTime); final SQLTransaction<Long> insertAndGetLastID = transOperator -> { transOperator.update(INSERT_EXECUTABLE_FLOW, flow.getProjectId(), flow.getFlowId(), flow.getVersion(), Status.PREPARING.getNumVal(), submitTime, flow.getSubmitUser(), submitTime, executorId); transOperator.getConnection().commit(); return transOperator.getLastInsertId(); }; try { final long id = this.dbOperator.transaction(insertAndGetLastID); logger.info("Flow given " + flow.getFlowId() + " given id " + id); flow.setExecutionId((int) id); updateExecutableFlow(flow); } catch (final SQLException e) { throw new ExecutorManagerException("Error creating execution.", e); } }

Target:
public synchronized void uploadExecutableFlow(final ExecutableFlow flow) throws ExecutorManagerException { final String useExecutorParam = flow.getExecutionOptions().getFlowParameters().get(ExecutionOptions.USE_EXECUTOR); final String executorId = StringUtils.isNotEmpty(useExecutorParam) ? useExecutorParam : null; final String INSERT_EXECUTABLE_FLOW = "INSERT INTO execution_flows " + "(project_id, flow_id, version, status, submit_time, submit_user, update_time, " + "use_executor) values (?,?,?,?,?,?,?,?)"; final long submitTime = System.currentTimeMillis(); flow.setStatus(Status.PREPARING); flow.setSubmitTime(submitTime); final SQLTransaction<Long> insertAndGetLastID = transOperator -> { transOperator.update(INSERT_EXECUTABLE_FLOW, flow.getProjectId(), flow.getFlowId(), flow.getVersion(), Status.PREPARING.getNumVal(), submitTime, flow.getSubmitUser(), submitTime, executorId); transOperator.getConnection().commit(); return transOperator.getLastInsertId(); }; try { final long id = this.dbOperator.transaction(insertAndGetLastID); logger.info("Flow given " + flow.getFlowId() + " given id " + id); flow.setExecutionId((int) id); updateExecutableFlow(flow); } catch (final SQLException e) { throw new ExecutorManagerException("Error creating execution.", e); } }
Source:
private static List<VdsNetworkInterface> findBridgedNetworkInterfaces(Map<String, Object> bridge, Map<String, VdsNetworkInterface> vdsInterfaces) { List<VdsNetworkInterface> interfaces = new ArrayList<>(); Object[] ports = (Object[]) bridge.get("ports"); if (ports != null) { Arrays.stream(ports).filter(port -> vdsInterfaces.containsKey(port.toString())) .forEach(port -> interfaces.add(vdsInterfaces.get(port.toString()))); } return interfaces; }

Target:
private static List<VdsNetworkInterface> findBridgedNetworkInterfaces(Map<String, Object> bridge, Map<String, VdsNetworkInterface> vdsInterfaces) { Object[] ports = (Object[]) bridge.get("ports"); List<VdsNetworkInterface> interfaces if (ports != null) { return Arrays.stream(ports).filter(port -> vdsInterfaces.containsKey(port.toString())) .map(port -> vdsInterfaces.get(port.toString())).collect(Collectors.toList()); } return new ArrayList<>(); }
Source:
public Optional<String> getName() { try { return Optional.of(URLEncoder.encode(pathPrefix + source.getName(), "UTF-8")); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } }

Target:
public Optional<String> getName() { try { return Optional.of(URLEncoder.encode(relativePath + source.getName(), "UTF-8")); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } }
Source:
public DataContainer toContainer() { return new MemoryDataContainer().set(Keys.LOCK_TOKEN, this.lockToken.get()); }

Target:
public DataContainer toContainer() { return new MemoryDataContainer().set(Keys.LOCK_TOKEN, this.value); }
Source:
public void decrementCommitsInProgress() { this.commitSessionLock.lock(); try { Preconditions.checkState(this.commitsInProgress.get() > 0); final int newCount = this.commitsInProgress.decrementAndGet(); if (newCount == 0) { this.noOutstandingCommits.signal(); } } finally { this.commitSessionLock.unlock(); } }

Target:
public void decrementCommitsInProgress() { this.commitSessionLock.lock(); try { Preconditions.checkState(this.commitsInProgress.get() > 0); final int newCount = this.commitsInProgress.decrementAndGet(); if (newCount == 0) { this.noOutstandingCommits.signalAll(); } } finally { this.commitSessionLock.unlock(); } }
Source:
private static void createMenuItem(Menu parent, final TableColumn column) { final MenuItem itemName = new MenuItem(parent, SWT.CHECK); itemName.setText(column.getText()); itemName.setSelection(column.getResizable()); itemName.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { if (itemName.getSelection()) { column.setWidth(150); column.setResizable(true); } else { column.setWidth(0); column.setResizable(false); } } }); }

Target:
private static void createMenuItem(Menu parent, final TableColumn column) { final MenuItem itemName = new MenuItem(parent, SWT.CHECK); itemName.setText(column.getText()); itemName.setSelection(column.getResizable()); itemName.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { if (itemName.getSelection()) { column.setWidth((int) column.getData(WIDTH)); column.setResizable(true); } else { column.setWidth(0); column.setResizable(false); } } }); }
Source:
public Interview create(String interviewId) throws HttpRequestException, QuestionsBlockNotFound, WrongCriteriaException, InterviewNotFoundException { Interview interview = new Interview(interviewId); List<QuestionsBlock> allQuestionsBlocks = new ArrayList<QuestionsBlock>(); allQuestionsBlocks.add(questionsBlockServices.getStandardQuestionsBlock()); Appointment appointment = httpRequestExecutor.getObjectByID(interviewId, Appointment.class); List<String> Users = appointment.getUserIdList(); for (int i = 0; i < Users.size(); i++){ User user = httpRequestExecutor.getObjectByID(Users.get(i), User.class); QuestionsBlock userQuestionsBlock = new QuestionsBlock(user); List<QuestionInformation> userQuestionInformationList = new ArrayList<QuestionInformation>(); List<Question> Questions = user.getQuestions(); for (int i1 = 0; i1 < Questions.size(); i1++){ QuestionInformation questionInformation = new QuestionInformation(); questionInformation.setQuestion(Questions.get(i1).getQuestionBody()); questionInformation.setWeight(Questions.get(i1).getWeight()); questionInformation.setQuestionInformationID(String.valueOf(i1)); questionInformation.setQuestionsBlockId(Users.get(i)); userQuestionInformationList.add(questionInformation); } userQuestionsBlock.setQuestions(userQuestionInformationList); userQuestionsBlock.setQuestionsBlockID(Users.get(i)); allQuestionsBlocks.add(userQuestionsBlock); } interview.setQuestionsBlocks(allQuestionsBlocks); interview.setType(InterviewType.InterviewWithUserAndStandardQuestions); return interview; }

Target:
public Interview create(String interviewId) throws HttpRequestException { Interview interview = new Interview(interviewId); List<QuestionsBlock> allQuestionsBlocks = new ArrayList<QuestionsBlock>(); allQuestionsBlocks.add(questionsBlockServices.getStandardQuestionsBlock()); Appointment appointment = httpRequestExecutor.getObjectByID(interviewId, Appointment.class); List<String> Users = appointment.getUserIdList(); for (int i = 0; i < Users.size(); i++){ User user = httpRequestExecutor.getObjectByID(Users.get(i), User.class); QuestionsBlock userQuestionsBlock = new QuestionsBlock(user); List<QuestionInformation> userQuestionInformationList = new ArrayList<QuestionInformation>(); List<Question> Questions = user.getQuestions(); for (int j = 0; j < Questions.size(); j++){ QuestionInformation questionInformation = new QuestionInformation(); questionInformation.setQuestion(Questions.get(j).getQuestionBody()); questionInformation.setWeight(Questions.get(j).getWeight()); questionInformation.setQuestionInformationID(String.valueOf(j)); questionInformation.setQuestionsBlockId(Users.get(i)); userQuestionInformationList.add(questionInformation); } userQuestionsBlock.setQuestions(userQuestionInformationList); userQuestionsBlock.setQuestionsBlockID(Users.get(i)); allQuestionsBlocks.add(userQuestionsBlock); } interview.setQuestionsBlocks(allQuestionsBlocks); interview.setType(InterviewType.InterviewWithUserAndStandardQuestions); return interview; }
Source:
public WorkspaceFileRevision(final IResource resource) { super(resource.getFullPath().toString()); rsrc = resource; }

Target:
public WorkspaceFileRevision(final IResource resource) { super(resource.getLocation().toString()); rsrc = resource; }
Source:
private static void renderTabIndex( Control control ) { if( control instanceof Shell ) { resetTabIndices( ( Shell )control ); computeTabIndices( ( Shell )control, 1 ); } int actual = getTabIndex( control ); int preserved = getRemoteAdapter( control ).getPreservedTabIndex(); if( changed( control, actual, preserved, Integer.MIN_VALUE ) ) { getRemoteObject( control ).set( PROP_TAB_INDEX, actual ); } }

Target:
private static void renderTabIndex( Control control ) { if( control instanceof Shell ) { resetTabIndices( ( Shell )control ); computeTabIndices( ( Shell )control, 1 ); } ControlRemoteAdapter remoteAdapter = getRemoteAdapter( control ); int actual = getTabIndex( control ); int preserved = remoteAdapter.getPreservedTabIndex(); if( !remoteAdapter.isInitialized() || actual != preserved ) { getRemoteObject( control ).set( PROP_TAB_INDEX, actual ); } }
Source:
protected int computeHash() { int hashCode = 1; hashCode = hashCode * Utils.HASH_PRIME + baseTerms.hashCode(); hashCode = hashCode * Utils.HASH_PRIME + cells.hashCode(); return hashCode; }

Target:
protected int computeHash() { int hashCode = 1; hashCode = hashCode * Utils.HASH_PRIME + cells.hashCode(); hashCode = hashCode * Utils.HASH_PRIME + collectionVariables.hashCode(); return hashCode; }
Source:
public static String fromClass(Class<?> clazz) { Package classPackage = clazz.getPackage(); String userAgent = classPackage.getImplementationTitle(); String version = classPackage.getImplementationVersion(); checkArgument(userAgent != null, "Cannot load user agent from implementation title"); checkArgument(version != null, "Cannot load version from implementation version"); return getUserAgent(userAgent, version); }

Target:
public static String fromClass(Class<?> clazz) { Package classPackage = clazz.getPackage(); String userAgent = classPackage.getImplementationTitle(); String version = classPackage.getImplementationVersion(); checkArgument(userAgent != null, "Cannot load user agent from implementation title for class: %s", clazz); checkArgument(version != null, "Cannot load version from implementation version for class: %s", clazz); return getUserAgent(userAgent, version); }
Source:
Configuration(Builder builder) { this.uri = builder.uri; this.uris = builder.uris; this.connectionPoolSize = builder.connectionPoolSize != null ? builder.connectionPoolSize : 50; this.encryptionLevel = builder.encryptionLevel; this.trustStrategy = builder.trustStrategy; this.trustCertFile = builder.trustCertFile; this.connectionLivenessCheckTimeout = builder.connectionLivenessCheckTimeout; this.verifyConnection = builder.verifyConnection != null ? builder.verifyConnection : false; this.autoIndex = builder.autoIndex != null ? AutoIndexMode.fromString(builder.autoIndex) : AutoIndexMode.NONE; this.generatedIndexesOutputDir = builder.generatedIndexesOutputDir != null ? builder.generatedIndexesOutputDir : "."; this.generatedIndexesOutputFilename = builder.generatedIndexesOutputFilename != null ? builder.generatedIndexesOutputFilename : "generated_indexes.cql"; this.neo4jConfLocation = builder.neo4jConfLocation; this.customProperties = builder.customProperties; this.useNativeTypes = builder.useNativeTypes; this.basePackages = builder.basePackages; if (this.uri != null || (this.uris != null && uris.length >= 1)) { parseAndSetParametersFromURI(); } else { this.driverName = Drivers.EMBEDDED.driverClassName(); } if (builder.username != null && builder.password != null) { if (this.credentials != null) { LOGGER.warn("Overriding credentials supplied in URI with supplied username and password."); } credentials = new UsernamePasswordCredentials(builder.username, builder.password); } }

Target:
Configuration(Builder builder) { this.uri = builder.uri; this.uris = builder.uris; this.connectionPoolSize = builder.connectionPoolSize != null ? builder.connectionPoolSize : 50; this.encryptionLevel = builder.encryptionLevel; this.trustStrategy = builder.trustStrategy; this.trustCertFile = builder.trustCertFile; this.connectionLivenessCheckTimeout = builder.connectionLivenessCheckTimeout; this.verifyConnection = builder.verifyConnection != null ? builder.verifyConnection : false; this.autoIndex = builder.autoIndex != null ? AutoIndexMode.fromString(builder.autoIndex) : AutoIndexMode.NONE; this.generatedIndexesOutputDir = builder.generatedIndexesOutputDir != null ? builder.generatedIndexesOutputDir : "."; this.generatedIndexesOutputFilename = builder.generatedIndexesOutputFilename != null ? builder.generatedIndexesOutputFilename : "generated_indexes.cql"; this.neo4jConfLocation = builder.neo4jConfLocation; this.customProperties = builder.customProperties; this.useNativeTypes = builder.useNativeTypes; this.basePackages = builder.basePackages; URI parsedUri = getSingleURI(); if (parsedUri != null) { parseAndSetParametersFromURI(parsedUri); } else { this.driverName = Drivers.EMBEDDED.driverClassName(); } if (builder.username != null && builder.password != null) { if (this.credentials != null) { LOGGER.warn("Overriding credentials supplied in URI with supplied username and password."); } credentials = new UsernamePasswordCredentials(builder.username, builder.password); } }
Source:
public void testBug395126_missing() { ResourceLocator .imageDescriptorFromBundle("org.eclipse.jface", "platform:/plugin/org.eclipse.jface/$nl$/icons/does-not-exist.gif") .orElseThrow(() -> new AssertionError()); }

Target:
public void testBug395126_missing() { ImageDescriptor imageDescriptor = ResourceLocator.imageDescriptorFromBundle("org.eclipse.jface", "platform:/plugin/org.eclipse.jface/$nl$/icons/does-not-exist.gif").orElse(null); Image image = null; try { image = imageDescriptor.createImage(false); assertNull(image); } finally { if (image != null) { image.dispose(); } } }
Source:
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { TFM_Util.adminAction(sender.getName(), "Opping all players on the server", false); boolean doSetGamemode = false; GameMode targetGamemode = GameMode.CREATIVE; if (args.length != 0) { if (args[0].equals("-c")) { doSetGamemode = true; targetGamemode = GameMode.CREATIVE; } else if (TFM_AdminList.isSeniorAdmin(sender)) { if (args[0].equals("-s")) { doSetGamemode = true; targetGamemode = GameMode.SURVIVAL; } } for (Player player : server.getOnlinePlayers()) { player.setOp(true); player.sendMessage(TFM_Command.YOU_ARE_OP); if (doSetGamemode) { player.setGameMode(targetGamemode); } } return true; } }

Target:
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { TFM_Util.adminAction(sender.getName(), "Opping all players on the server", false); boolean doSetGamemode = false; GameMode targetGamemode = GameMode.CREATIVE; if (args.length != 0) { if (args[0].equals("-c")) { doSetGamemode = true; targetGamemode = GameMode.CREATIVE; } else if (args[0].equals("-s")) { if (TFM_AdminList.isSeniorAdmin(sender)) { doSetGamemode = true; targetGamemode = GameMode.SURVIVAL; } else { sender.sendMessage(TFM_Command.MSG_NO_PERMS); } } for (Player player : server.getOnlinePlayers()) { player.setOp(true); player.sendMessage(TFM_Command.YOU_ARE_OP); if (doSetGamemode) { player.setGameMode(targetGamemode); } } return true; } }
Source:
private void readVersion() { final String command = fScriptCommand.get(0); final List<String> commandLine = ImmutableList.<@NonNull String> builder() .add(command).add(MI_VERSION_FLAG).build(); final String output = getOutputFromCommand(commandLine); if (output == null) { Activator.instance().logInfo(String.format(LOG_NO_MI_VERSION_FMT, command)); return; } final String versionString = output.trim(); if (!versionString.matches("\\d+\\.\\d+")) { Activator.instance().logInfo(String.format(LOG_NO_MI_VERSION_FMT, command)); return; } final String logMsg = String.format("Command \"%s\" reports MI version %s", command, versionString); Activator.instance().logInfo(logMsg); final String[] parts = versionString.split("\\."); final int major = Integer.valueOf(parts[0]); final int minor = Integer.valueOf(parts[1]); fMiVersion = major * 100 + minor; }

Target:
private void readVersion() { final String command = fScriptCommand.get(0); final List<String> commandLine = ImmutableList.<@NonNull String> builder() .add(command).add(MI_VERSION_FLAG).build(); final String output = getOutputFromCommand(commandLine); if (output == null) { Activator.instance().logInfo(String.format(LOG_NO_MI_VERSION_FMT, command)); return; } final String versionString = output.trim(); if (!versionString.matches("\\d{1,3}\\.\\d{1,3}")) { Activator.instance().logInfo(String.format(LOG_NO_MI_VERSION_FMT, command)); return; } final String logMsg = String.format("Command \"%s\" reports MI version %s", command, versionString); Activator.instance().logInfo(logMsg); final String[] parts = versionString.split("\\."); final int major = Integer.valueOf(parts[0]); final int minor = Integer.valueOf(parts[1]); fMiVersion = major * 100 + minor; }
Source:
public void testContribOverride() throws Exception { deployContrib("org.nuxeo.ecm.core.api.tests", "OSGI-INF/test-pathsegment-contrib.xml"); applyInlineDeployments(); PathSegmentService service = Framework.getService(PathSegmentService.class); DocumentModel doc = DocumentModelProxy.newDocumentModel("My Document"); assertEquals("my-document", service.generatePathSegment(doc)); deployContrib("org.nuxeo.ecm.core.api.tests", "OSGI-INF/test-pathsegment-contrib2.xml"); applyInlineDeployments(); service = Framework.getService(PathSegmentService.class); assertEquals("My Document", service.generatePathSegment(doc)); }

Target:
public void testContribOverride() throws Exception { pushInlineDeployments("org.nuxeo.ecm.core.api.tests:OSGI-INF/test-pathsegment-contrib.xml"); PathSegmentService service = Framework.getService(PathSegmentService.class); DocumentModel doc = DocumentModelProxy.newDocumentModel("My Document"); assertEquals("my-document", service.generatePathSegment(doc)); pushInlineDeployments("org.nuxeo.ecm.core.api.tests:OSGI-INF/test-pathsegment-contrib2.xml"); service = Framework.getService(PathSegmentService.class); assertEquals("My Document", service.generatePathSegment(doc)); }
Source:
private boolean isNewBoardCreationDialogConfirmed() { List<PanelInfo> panelList = panels.getCurrentPanelInfos(); if (!panelList.isEmpty()) { Alert dlg = new Alert(AlertType.CONFIRMATION, ""); dlg.initModality(Modality.APPLICATION_MODAL); dlg.setTitle("Confirmation"); dlg.getDialogPane().setHeaderText("Create a new board"); dlg.getDialogPane().setContentText("Are you sure you want to create a new board?" + " All unsaved changes to the current board will be lost."); Optional<ButtonType> response = dlg.showAndWait(); return response.isPresent() && response.get().getButtonData() == ButtonData.OK_DONE; } return true; }

Target:
private boolean isNewBoardCreationDialogConfirmed() { List<PanelInfo> panelList = panels.getCurrentPanelInfos(); if (panelList.isEmpty()) { return true; } Alert dlg = new Alert(AlertType.CONFIRMATION, ""); dlg.initModality(Modality.APPLICATION_MODAL); dlg.setTitle("Confirmation"); dlg.getDialogPane().setHeaderText("Create a new board"); dlg.getDialogPane().setContentText("Are you sure you want to create a new board?" + " All unsaved changes to the current board will be lost."); Optional<ButtonType> response = dlg.showAndWait(); return response.isPresent() && response.get().getButtonData() == ButtonData.OK_DONE; }
Source:
public void testSerializeIndividually() { try { EitherTypeInfo<LongValue, DoubleValue> eitherTypeInfo = new EitherTypeInfo<>( ValueTypeInfo.LONG_VALUE_TYPE_INFO, ValueTypeInfo.DOUBLE_VALUE_TYPE_INFO); EitherSerializer<LongValue, DoubleValue> eitherSerializer = (EitherSerializer<LongValue, DoubleValue>) eitherTypeInfo.createSerializer(new ExecutionConfig()); LongValue lv = new LongValue(); DoubleValue dv = new DoubleValue(); Either<LongValue, DoubleValue> left = Left(lv); Either<LongValue, DoubleValue> right = Right(dv); TestOutputView out = new TestOutputView(); eitherSerializer.serialize(left, out); eitherSerializer.serialize(right, out); eitherSerializer.serialize(left, out); TestInputView in = out.getInputView(); Either<LongValue, DoubleValue> copy0 = eitherSerializer.deserialize(right, in); Either<LongValue, DoubleValue> copy1 = eitherSerializer.deserialize(copy0, in); Either<LongValue, DoubleValue> copy2 = eitherSerializer.deserialize(copy1, in); assertSame(right, copy1); assertSame(copy0, copy2); assertSame(right.right(), copy1.right()); assertSame(copy0.left(), copy2.left()); } catch (IOException ignored) { } }

Target:
public void testSerializeIndividually() throws IOException { EitherTypeInfo<LongValue, DoubleValue> eitherTypeInfo = new EitherTypeInfo<>( ValueTypeInfo.LONG_VALUE_TYPE_INFO, ValueTypeInfo.DOUBLE_VALUE_TYPE_INFO); EitherSerializer<LongValue, DoubleValue> eitherSerializer = (EitherSerializer<LongValue, DoubleValue>) eitherTypeInfo.createSerializer(new ExecutionConfig()); LongValue lv = new LongValue(); DoubleValue dv = new DoubleValue(); Either<LongValue, DoubleValue> left = Left(lv); Either<LongValue, DoubleValue> right = Right(dv); TestOutputView out = new TestOutputView(); eitherSerializer.serialize(left, out); eitherSerializer.serialize(right, out); eitherSerializer.serialize(left, out); TestInputView in = out.getInputView(); Either<LongValue, DoubleValue> copy0 = eitherSerializer.deserialize(right, in); Either<LongValue, DoubleValue> copy1 = eitherSerializer.deserialize(copy0, in); Either<LongValue, DoubleValue> copy2 = eitherSerializer.deserialize(copy1, in); assertSame(right, copy1); assertSame(copy0, copy2); assertSame(right.right(), copy1.right()); assertSame(copy0.left(), copy2.left()); }
Source:
public SqlGraphConfiguration(Map<String, Object> config) { super(config); serializer = createSerializer(config); String driverClass = getConfigString(config, CONFIG_JDBC_DRIVER_CLASS); String url = getConfigString(config, CONFIG_JDBC_URL); String username = getConfigString(config, CONFIG_JDBC_USERNAME); String password = getConfigString(config, CONFIG_JDBC_PASSWORD); dataSource = new BasicDataSource(); dataSource.setDriverClassName(driverClass); dataSource.setUrl(url); dataSource.setUsername(username); dataSource.setPassword(password); Handle handle = new DBI(dataSource).open(); vertexMap = newVertexMap(handle); edgeMap = newEdgeMap(handle); metadataMap = newMetadataMap(handle); }

Target:
public SqlGraphConfiguration(Map<String, Object> config) { super(config); String driverClass = getConfigString(config, CONFIG_JDBC_DRIVER_CLASS); String url = getConfigString(config, CONFIG_JDBC_URL); String username = getConfigString(config, CONFIG_JDBC_USERNAME); String password = getConfigString(config, CONFIG_JDBC_PASSWORD); dataSource = new BasicDataSource(); dataSource.setDriverClassName(driverClass); dataSource.setUrl(url); dataSource.setUsername(username); dataSource.setPassword(password); serializer = createSerializer(); }
Source:
public void cacheMeasurementClass(final Class<?>... classVarAgrs) { for (Class<?> clazz : classVarAgrs) { if (CLASS_FIELD_CACHE.containsKey(clazz.getName())) { continue; } ConcurrentMap<String, Field> initialMap = new ConcurrentHashMap<>(); ConcurrentMap<String, Field> influxColumnAndFieldMap = CLASS_FIELD_CACHE.putIfAbsent(clazz.getName(), initialMap); if (influxColumnAndFieldMap == null) { influxColumnAndFieldMap = initialMap; } for (Field field : clazz.getDeclaredFields()) { Column colAnnotation = field.getAnnotation(Column.class); if (colAnnotation != null) { influxColumnAndFieldMap.put(colAnnotation.name(), field); } } } }

Target:
void cacheMeasurementClass(final Class<?>... classVarAgrs) { for (Class<?> clazz : classVarAgrs) { if (CLASS_FIELD_CACHE.containsKey(clazz.getName())) { continue; } ConcurrentMap<String, Field> initialMap = new ConcurrentHashMap<>(); ConcurrentMap<String, Field> influxColumnAndFieldMap = CLASS_FIELD_CACHE.putIfAbsent(clazz.getName(), initialMap); if (influxColumnAndFieldMap == null) { influxColumnAndFieldMap = initialMap; } for (Field field : clazz.getDeclaredFields()) { Column colAnnotation = field.getAnnotation(Column.class); if (colAnnotation != null) { influxColumnAndFieldMap.put(colAnnotation.name(), field); } } } }
Source:
public void run() { if (checkAndReportInvalidState()) { return; } matchingOffers = managementRealm.where(PermissionOffer.class) .equalTo("token", offerToken) .findAllAsync(); matchingOffers.addChangeListener(new RealmChangeListener<RealmResults<PermissionOffer>>() { @Override public void onChange(final RealmResults<PermissionOffer> offers) { if (checkAndReportInvalidState()) { return; } if (!offers.isEmpty()) { managementRealm.executeTransactionAsync(new Realm.Transaction() { @Override public void execute(Realm realm) { if (checkAndReportInvalidState()) { return; } RealmResults<PermissionOffer> offers = realm.where(PermissionOffer.class) .equalTo("token", offerToken) .findAll(); if (!offers.isEmpty()) { offers.deleteAllFromRealm(); } } }, new Realm.Transaction.OnSuccess() { @Override public void onSuccess() { matchingOffers.removeAllChangeListeners(); if (checkAndReportInvalidState()) { return; } final SyncSession session = SyncManager.getSession(managementRealmConfig); session.addUploadProgressListener(ProgressMode.CURRENT_CHANGES, new ProgressListener() { @Override public void onChange(Progress progress) { if (progress.isTransferComplete()) { session.removeProgressListener(this); handler.post(new Runnable() { @Override public void run() { if (checkAndReportInvalidState()) { return; } notifyCallbackWithSuccess(); } }); } } }); } }, new Realm.Transaction.OnError() { @Override public void onError(Throwable error) { matchingOffers.removeAllChangeListeners(); notifyCallbackError(new ObjectServerError(ErrorCode.UNKNOWN, error)); } }); } } }); }

Target:
public void run() { if (checkAndReportInvalidState()) { return; } matchingOffers = managementRealm.where(PermissionOffer.class) .equalTo("token", offerToken) .findAllAsync(); matchingOffers.addChangeListener(new RealmChangeListener<RealmResults<PermissionOffer>>() { @Override public void onChange(final RealmResults<PermissionOffer> offers) { if (checkAndReportInvalidState()) { return; } if (!offers.isEmpty()) { managementRealm.executeTransactionAsync(new Realm.Transaction() { @Override public void execute(Realm realm) { if (checkAndReportInvalidState()) { return; } RealmResults<PermissionOffer> offers = realm.where(PermissionOffer.class) .equalTo("token", offerToken) .findAll(); if (!offers.isEmpty()) { offers.deleteAllFromRealm(); } } }, new Realm.Transaction.OnSuccess() { @Override public void onSuccess() { matchingOffers.removeAllChangeListeners(); if (checkAndReportInvalidState()) { return; } final SyncSession session = SyncManager.getSession(managementRealmConfig); session.addUploadProgressListener(ProgressMode.CURRENT_CHANGES, new ProgressListener() { @Override public void onChange(Progress progress) { if (progress.isTransferComplete()) { session.removeProgressListener(this); handler.post(new Runnable() { @Override public void run() { if (checkAndReportInvalidState()) { return; } notifyCallbackWithSuccess(); } }); } } }); } }, new Realm.Transaction.OnError() { @Override public void onError(Throwable error) { matchingOffers.removeAllChangeListeners(); notifyCallbackWithError(new ObjectServerError(ErrorCode.UNKNOWN, error)); } }); } } }); }
Source:
public void blockThread() { try { synchronized (this) { System.out.println("wait skipper"); callback.onFinished(); wait(); } } catch (InterruptedException e) { log.error("Error occured in SkipAudioProcessor while calling blockThread"); log.trace(StackTrace.stackTrace(e)); } }

Target:
public void blockThread() { try { synchronized (this) { callback.onFinished(); wait(); } } catch (InterruptedException e) { log.error("Error occured in SkipAudioProcessor while calling blockThread"); log.trace(StackTrace.stackTrace(e)); } }
Source:
public void close() throws Exception { if (shouldWeShutdown) { repository.shutDown(); } }

Target:
public void close() throws Exception { if (handleInitAndShutdown) { repository.shutDown(); } }
Source:
private static void tryPreLoad(String file, boolean pixelData) { synchronized (IMAGES) { if (IMAGES.containsKey(file)) { return; } } Image image; try { image = new Image(file); } catch (Exception ex) { log.log(LogLevel.WARNING, "Error while trying to load image: " + file); return; } if (pixelData) { boolean[][] data = CollisionMask.buildData(image); double alphaRatio = CollisionMask.getAlphaRatio(data); synchronized (IMAGE_ALPHARATS) { IMAGE_ALPHARATS.put(file, alphaRatio); } synchronized (IMAGE_DATA) { IMAGE_DATA.put(file, data); } } synchronized (IMAGES) { IMAGES.put(file, image); } }

Target:
private static void tryPreLoad(String file, boolean pixelData) { synchronized (IMAGES) { if (IMAGES.containsKey(file)) { return; } } Image image; try { image = new Image(file); } catch (Exception ex) { log.log(LogLevel.ERROR, "Error while trying to load image: " + file); return; } if (pixelData) { boolean[][] data = CollisionMask.buildData(image); double alphaRatio = CollisionMask.getAlphaRatio(data); synchronized (IMAGE_ALPHARATS) { IMAGE_ALPHARATS.put(file, alphaRatio); } synchronized (IMAGE_DATA) { IMAGE_DATA.put(file, data); } } synchronized (IMAGES) { IMAGES.put(file, image); } }
Source:
protected void deployModules(Container container) throws Exception { String containerName = container.getName(); logger.info("Container arrived: {}", containerName); Thread.sleep(1000); deployUnallocatedStreamModules(); deployUnallocatedJobModules(); }

Target:
protected void deployModules(Container container) throws Exception { String containerName = container.getName(); logger.info("Container arrived: {}", containerName); deployUnallocatedStreamModules(); deployUnallocatedJobModules(); }
Source:
ByteBuf encode( final ByteBufAllocator allocator, final int streamId, boolean fragmentFollows, boolean complete, boolean next, int requestN, @Nullable ByteBuf metadata, ByteBuf data) { int flags = 0; if (metadata != null && Unpooled.EMPTY_BUFFER != metadata) { flags |= FrameHeaderFlyweight.FLAGS_M; } if (fragmentFollows) { flags |= FrameHeaderFlyweight.FLAGS_F; } if (complete) { flags |= FrameHeaderFlyweight.FLAGS_C; } if (next) { flags |= FrameHeaderFlyweight.FLAGS_N; } ByteBuf header = FrameHeaderFlyweight.encode(allocator, streamId, frameType, flags); if (requestN > 0) { header.writeInt(requestN); } if (metadata != null && Unpooled.EMPTY_BUFFER != metadata) { return DataAndMetadataFlyweight.encode(allocator, header, metadata, data); } else { return DataAndMetadataFlyweight.encodeOnlyData(allocator, header, data); } }

Target:
ByteBuf encode( final ByteBufAllocator allocator, final int streamId, boolean fragmentFollows, boolean complete, boolean next, int requestN, @Nullable ByteBuf metadata, ByteBuf data) { int flags = 0; if (metadata != null) { flags |= FrameHeaderFlyweight.FLAGS_M; } if (fragmentFollows) { flags |= FrameHeaderFlyweight.FLAGS_F; } if (complete) { flags |= FrameHeaderFlyweight.FLAGS_C; } if (next) { flags |= FrameHeaderFlyweight.FLAGS_N; } ByteBuf header = FrameHeaderFlyweight.encode(allocator, streamId, frameType, flags); if (requestN > 0) { header.writeInt(requestN); } if (metadata != null) { return DataAndMetadataFlyweight.encode(allocator, header, metadata, data); } else { return DataAndMetadataFlyweight.encodeOnlyData(allocator, header, data); } }
Source:
private void handleProtocolResponseMessage(final ProtocolResponseMessage message) throws FunctionalException, JMSException { if (message.getRetryHeader() != null && message.getRetryHeader().shouldRetry()) { LOGGER.info("Creating a scheduled retry task for message of type for device {}.", message.getMessageType(), message.getDeviceIdentification()); final ScheduledTask task = this.createScheduledRetryTask(message); this.scheduledTaskRepository.save(task); } else if (this.shouldRetryBasedOnMessage(message)) { LOGGER.info("Retrying: for device for time", message.getMessageType(), message.getDeviceIdentification(), message.getRetryCount() + 1); final ProtocolRequestMessage protocolRequestMessage = this.createProtocolRequestMessage(message); this.deviceRequestMessageService.processMessage(protocolRequestMessage); } else { LOGGER.info("Sending domain response message for message of type for device {}.", message.getMessageType(), message.getDeviceIdentification()); this.domainResponseMessageSender.send(message); } }

Target:
private void handleProtocolResponseMessage(final ProtocolResponseMessage message) throws FunctionalException, JMSException { if (this.mustBeRetried(message)) { LOGGER.info("Creating a scheduled retry task for message of type for device {}.", message.getMessageType(), message.getDeviceIdentification()); final ScheduledTask task = this.createScheduledRetryTask(message); this.scheduledTaskRepository.save(task); } else if (this.shouldRetryBasedOnMessage(message)) { LOGGER.info("Retrying: for device for time", message.getMessageType(), message.getDeviceIdentification(), message.getRetryCount() + 1); final ProtocolRequestMessage protocolRequestMessage = this.createProtocolRequestMessage(message); this.deviceRequestMessageService.processMessage(protocolRequestMessage); } else { LOGGER.info("Sending domain response message for message of type for device {}.", message.getMessageType(), message.getDeviceIdentification()); this.domainResponseMessageSender.send(message); } }
Source:
private void spawnParticle(final net.minecraft.world.World world, final IParticleData particleTypes, final double xCoord, final double yCoord, final double zCoord, final double xOffset, final double yOffset, final double zOffset) { if (!this.vanish$isVanished) { this.world.addParticle(particleTypes, xCoord, yCoord, zCoord, xOffset, yOffset, zOffset); } }

Target:
private void impl$spawnParticle(final net.minecraft.world.World world, final IParticleData particleTypes, final double xCoord, final double yCoord, final double zCoord, final double xOffset, final double yOffset, final double zOffset) { if (!this.vanish$isVanished) { this.world.addParticle(particleTypes, xCoord, yCoord, zCoord, xOffset, yOffset, zOffset); } }
Source:
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { HeaderWriterResponse headerWriterResponse = new HeaderWriterResponse(request, response, this.headerWriter); HeaderWriterRequest headerWriterRequest = new HeaderWriterRequest(request, headerWriterResponse); try { if (shouldWriteHeadersEagerly) { headerWriterResponse.writeHeaders(); } filterChain.doFilter(headerWriterRequest, headerWriterResponse); } finally { if (!shouldWriteHeadersEagerly) { headerWriterResponse.writeHeaders(); } } }

Target:
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { if (this.shouldWriteHeadersEagerly) { doHeadersBefore(request, response, filterChain); } else { doHeadersAfter(request, response, filterChain); } }
Source:
public List<Credential> fromRequest(final HttpServletRequest request, final MultiValueMap<String, String> requestBody) { if (requestBody == null || requestBody.isEmpty()) { LOGGER.debug("Skipping because the requestBody is null or empty", this); return new ArrayList<>(0); } final String otp = requestBody.getFirst(PARAMETER_NAME_YUBIKEY_OTP); LOGGER.debug("YubiKey token in the request body: [{}]", otp); if (StringUtils.isBlank(otp)) { return new ArrayList<>(0); } return CollectionUtils.wrap(new YubiKeyCredential(otp)); }

Target:
public List<Credential> fromRequest(final HttpServletRequest request, final MultiValueMap<String, String> requestBody) { if (requestBody == null || requestBody.isEmpty()) { LOGGER.debug("Skipping because the requestBody is null or empty", getClass().getSimpleName()); return new ArrayList<>(0); } final String otp = requestBody.getFirst(PARAMETER_NAME_YUBIKEY_OTP); LOGGER.debug("YubiKey token in the request body: [{}]", otp); if (StringUtils.isBlank(otp)) { return new ArrayList<>(0); } return CollectionUtils.wrap(new YubiKeyCredential(otp)); }
Source:
private float getCurrentOverallProgress() { int totalItemCount = sNotificationData.totalPostItems + sNotificationData.totalMediaItems; float currentMediaProgress = getCurrentMediaProgress(); float overAllProgress = 0; overAllProgress = sNotificationData.totalPostItems > 0 ? (sNotificationData.currentPostItem/sNotificationData.totalPostItems) * totalItemCount : 0; overAllProgress += sNotificationData.totalMediaItems > 0 ? (sNotificationData.currentMediaItem/sNotificationData.totalMediaItems) * totalItemCount : 0; overAllProgress += currentMediaProgress; return overAllProgress; }

Target:
private float getCurrentOverallProgress() { int totalItemCount = sNotificationData.totalPostItems + sNotificationData.totalMediaItems; float currentMediaProgress = getCurrentMediaProgress(); float overAllProgress; overAllProgress = sNotificationData.totalPostItems > 0 ? (sNotificationData.currentPostItem/sNotificationData.totalPostItems) * totalItemCount : 0; overAllProgress += sNotificationData.totalMediaItems > 0 ? (sNotificationData.currentMediaItem/sNotificationData.totalMediaItems) * totalItemCount : 0; overAllProgress += currentMediaProgress; return overAllProgress; }
Source:
public void setDate(Date date) throws DeviceNotAvailableException { if (date == null) { date = new Date(); } long timeOffset = getDeviceTimeOffset(date); if (Math.abs(timeOffset) <= MAX_HOST_DEVICE_TIME_OFFSET) { return; } String dateString = null; if (getApiLevel() < 23) { dateString = Long.toString(date.getTime() / 1000); } else { SimpleDateFormat sdf = new java.text.SimpleDateFormat( "MMddHHmmyyyy.ss"); sdf.setTimeZone(java.util.TimeZone.getTimeZone("UTC")); dateString = sdf.format(date); } executeShellCommand("TZ= date -u " + dateString); }

Target:
public void setDate(Date date) throws DeviceNotAvailableException { if (date == null) { date = new Date(); } long timeOffset = getDeviceTimeOffset(date); if (Math.abs(timeOffset) <= MAX_HOST_DEVICE_TIME_OFFSET) { return; } String dateString = null; if (getApiLevel() < 23) { dateString = Long.toString(date.getTime() / 1000); } else { SimpleDateFormat sdf = new java.text.SimpleDateFormat( "MMddHHmmyyyy.ss"); sdf.setTimeZone(java.util.TimeZone.getTimeZone("UTC")); dateString = sdf.format(date); } executeShellCommand("TZ=UTC date -u " + dateString); }
Source:
private PatchLineComment update(PatchLineComment e, Input in) { if (in.side != null) { e.setSide(in.side == Side.PARENT ? (short) 0 : (short) 1); } if (in.line != null) { e.setLine(in.line); } if (in.inReplyTo != null) { e.setParentUuid(Url.decode(in.inReplyTo)); } e.setMessage(in.message.trim()); e.setRange(in.range); e.updated(); return e; }

Target:
private PatchLineComment update(PatchLineComment e, Input in) { if (in.side != null) { e.setSide(in.side == Side.PARENT ? (short) 0 : (short) 1); } if (in.inReplyTo != null) { e.setParentUuid(Url.decode(in.inReplyTo)); } e.setMessage(in.message.trim()); Integer line = in.line; CommentRange range = in.range; if (range != null || line != null) { e.setRange(range); e.setLine(line == null ? range.getEndLine() : line); } e.updated(); return e; }
Source:
private void fireAddParameterEvents(ITestResult iTestResult) { Object[] parameters = iTestResult.getParameters(); ITestNGMethod method = iTestResult.getMethod(); Method nativeMethod = method.getConstructorOrMethod().getMethod(); boolean atLeastJava8 = isAtLeastJava8(); List<String> parameterNames = null; if (atLeastJava8) { parameterNames = getParameterNames(nativeMethod); } for (int i = 0; i < parameters.length; i++) { String name = "arg" + i; if (atLeastJava8 && !parameterNames.isEmpty()) { name = parameterNames.get(i); } String value = parameters[i].toString(); getLifecycle().fire(new AddParameterEvent(name, value, ParameterKind.ARGUMENT)); } }

Target:
private void fireAddParameterEvents(ITestResult iTestResult) { Object[] parameters = iTestResult.getParameters(); Method nativeMethod = iTestResult.getMethod().getConstructorOrMethod().getMethod(); Annotation[][] parametersAnnotations = nativeMethod.getParameterAnnotations(); List<String> methodParameterNames = getMethodParameterNamesIfAvailable(nativeMethod); for (int i = 0; i < parameters.length; i++) { Parameter parameter = getParameterAnnotation(parametersAnnotations[i]); if (parameter == null) { return; } String name = getNameForParameter(parameter.value(), methodParameterNames, i); String value = parameters[i].toString(); getLifecycle().fire(new AddParameterEvent(name, value, ParameterKind.ARGUMENT)); } }
Source:
public abstract void trimUnreferencedTranslogFiles() throws EngineException; public abstract boolean shouldRollTranslogGeneration(); public abstract void rollTranslogGeneration() throws EngineException; public void forceMerge(boolean flush) throws IOException { forceMerge(flush, 1, false, false, false); }

Target:
public abstract void trimUnreferencedTranslogFiles() throws EngineException; public abstract boolean shouldRollTranslogGeneration(); public abstract void rollTranslogGeneration() throws EngineException; public abstract void forceMerge(boolean flush, int maxNumSegments, boolean onlyExpungeDeletes, boolean upgrade, boolean upgradeOnlyAncientSegments) throws EngineException, IOException; public abstract IndexCommitRef acquireLastIndexCommit(boolean flushFirst) throws EngineException; public abstract IndexCommitRef acquireSafeIndexCommit() throws EngineException; @SuppressWarnings("finally") private void maybeDie(final String maybeMessage, final Throwable maybeFatal) { ExceptionsHelper.maybeError(maybeFatal, logger).ifPresent(error -> { try { logger.error(maybeMessage, error); } finally { throw error; } }); }
Source:
public HashSet<V> toSet() { return new HashSet<>(values); }

Target:
public Set<V> toSet() { return new HashSet<>(values); }
Source:
private WebTarget addQueryParams(Map<String, String> params, WebTarget originalWebTarget) { if (params.isEmpty()) { return originalWebTarget; } WebTarget webTargetWithQueryParams = originalWebTarget; for (Map.Entry<String, String> entry: params.entrySet()) { webTargetWithQueryParams = webTargetWithQueryParams.queryParam(entry.getKey(), entry.getValue()); } return webTargetWithQueryParams; }

Target:
private WebTarget addQueryParams(Map<String, String> params, WebTarget originalWebTarget) { WebTarget webTargetWithQueryParams = originalWebTarget; for (Map.Entry<String, String> entry : params.entrySet()) { webTargetWithQueryParams = webTargetWithQueryParams.queryParam(entry.getKey(), entry.getValue()); } return webTargetWithQueryParams; }
Source:
public String toString() { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); pw.print("HashSettings:"); for(Map.Entry<String, String> e : settings.entrySet()) pw.print(e.getKey()+"="+e.getValue()+";"); pw.close(); return sw.toString(); }

Target:
public String toString() { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); pw.print("HashSettings:"); for(Map.Entry<String, String> e : settings.entrySet()) { pw.print(e.getKey()+"="+e.getValue()+";"); } pw.close(); return sw.toString(); }
Source:
private void processCommands(final Collection<ReceiveCommand> commands) { parseCommands(commands); if (newChange != null && newChange.getResult() == ReceiveCommand.Result.NOT_ATTEMPTED) { createNewChanges(); } doReplaces(); for (final ReceiveCommand c : commands) { if (c.getResult() == Result.OK) { switch (c.getType()) { case CREATE: if (isHead(c)) { autoCloseChanges(c); } break; case UPDATE: tagCache.updateFastForward(project.getNameKey(), c.getRefName(), c.getOldId(), c.getNewId()); if (isHead(c)) { autoCloseChanges(c); } break; case UPDATE_NONFASTFORWARD: if (isHead(c)) { autoCloseChanges(c); } break; } if (isConfig(c)) { projectCache.evict(project); ProjectState ps = projectCache.get(project.getNameKey()); repoManager.setProjectDescription(project.getNameKey(), ps.getProject().getDescription()); } if (!MagicBranch.isMagicBranch(c.getRefName())) { replication.scheduleUpdate(project.getNameKey(), c.getRefName()); Branch.NameKey destBranch = new Branch.NameKey(project.getNameKey(), c.getRefName()); hooks.doRefUpdatedHook(destBranch, c.getOldId(), c.getNewId(), currentUser.getAccount()); } } } if (!allNewChanges.isEmpty() && canonicalWebUrl != null) { final String url = canonicalWebUrl; addMessage(""); addMessage("New Changes:"); for (final Change c : allNewChanges) { if (c.getStatus() == Change.Status.DRAFT) { addMessage(" " + url + c.getChangeId() + " [DRAFT]"); } else { addMessage(" " + url + c.getChangeId()); } } addMessage(""); } sendMessages(); }

Target:
void processCommands(final Collection<ReceiveCommand> commands) { try { parseCommands(commands); if (newChange != null && newChange.getResult() == ReceiveCommand.Result.NOT_ATTEMPTED) { createNewChanges(); } doReplaces(); for (final ReceiveCommand c : commands) { if (c.getResult() == Result.OK) { switch (c.getType()) { case CREATE: if (isHead(c)) { autoCloseChanges(c); } break; case UPDATE: tagCache.updateFastForward(project.getNameKey(), c.getRefName(), c.getOldId(), c.getNewId()); if (isHead(c)) { autoCloseChanges(c); } break; case UPDATE_NONFASTFORWARD: if (isHead(c)) { autoCloseChanges(c); } break; } if (isConfig(c)) { projectCache.evict(project); ProjectState ps = projectCache.get(project.getNameKey()); repoManager.setProjectDescription(project.getNameKey(), ps.getProject().getDescription()); } if (!MagicBranch.isMagicBranch(c.getRefName())) { replication.scheduleUpdate(project.getNameKey(), c.getRefName()); Branch.NameKey destBranch = new Branch.NameKey(project.getNameKey(), c.getRefName()); hooks.doRefUpdatedHook(destBranch, c.getOldId(), c.getNewId(), currentUser.getAccount()); } } } if (!allNewChanges.isEmpty() && canonicalWebUrl != null) { final String url = canonicalWebUrl; addMessage(""); addMessage("New Changes:"); for (final Change c : allNewChanges) { if (c.getStatus() == Change.Status.DRAFT) { addMessage(" " + url + c.getChangeId() + " [DRAFT]"); } else { addMessage(" " + url + c.getChangeId()); } } addMessage(""); } } finally { sendMessages(); } }
Source:
public void updateState(CacheEntryEvent<StrongCounterKey, CounterValue> event) { CounterValue snapshot = event.getValue(); CounterValue old = updateCounterState(snapshot); notificationManager.notify(CounterEventImpl.create(old, snapshot)); }

Target:
public synchronized void updateState(CacheEntryEvent<StrongCounterKey, CounterValue> event) { CounterValue snapshot = event.getValue(); notificationManager.notify(CounterEventImpl.create(weakCounter, snapshot)); weakCounter = snapshot; }
Source:
public void onTroubleSigningIn(String email) { TroubleSigningInFragment troubleSigningInFragment = TroubleSigningInFragment.newInstance (email); getSupportFragmentManager().beginTransaction().replace(R.id.fragment_register_email, troubleSigningInFragment, TroubleSigningInFragment.TAG).disallowAddToBackStack() .commit(); }

Target:
public void onTroubleSigningIn(String email) { TroubleSigningInFragment troubleSigningInFragment = TroubleSigningInFragment.newInstance (email); switchFragment(troubleSigningInFragment, TroubleSigningInFragment.TAG, true); }