auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void canSupportGuaranteedSize() throws InterruptedException, CameraInfoUnavailableException { for (int i = 0; i <= 1; i++) { final int lensFacing = i; if (CameraUtil.hasCameraWithLensFacing(lensFacing)) { continue; } String cameraId = CameraX.getCameraFactory().cameraIdForLensFacing(lensFacing); boolean isRotateNeeded = (CameraX.getCameraInfo(cameraId).getSensorRotationDegrees( Surface.ROTATION_0) % 180) != 0; Preview preview = new Preview.Builder().setTargetResolution( GUARANTEED_RESOLUTION).setTargetRotation( isRotateNeeded ? Surface.ROTATION_90 : Surface.ROTATION_0).build(); mInstrumentation.runOnMainSync(() -> { preview.setPreviewSurfaceProvider( mPreviewSurfaceProviderWithFrameAvailableListener); CameraSelector cameraSelector = new CameraSelector.Builder().requireLensFacing( lensFacing).build(); CameraX.bindToLifecycle(mLifecycleOwner, cameraSelector, preview); mLifecycleOwner.startAndResume(); }); assertThat(mSurfaceFutureSemaphore.tryAcquire(10, TimeUnit.SECONDS)).isTrue(); assertEquals(GUARANTEED_RESOLUTION, mPreviewResolution); } }

Target:
public void canSupportGuaranteedSize() throws InterruptedException, CameraInfoUnavailableException { for (int i = 0; i <= 1; i++) { final int lensFacing = i; if (!CameraUtil.hasCameraWithLensFacing(lensFacing)) { continue; } String cameraId = CameraX.getCameraFactory().cameraIdForLensFacing(lensFacing); boolean isRotateNeeded = (CameraX.getCameraInfo(cameraId).getSensorRotationDegrees( Surface.ROTATION_0) % 180) != 0; Preview preview = new Preview.Builder().setTargetResolution( GUARANTEED_RESOLUTION).setTargetRotation( isRotateNeeded ? Surface.ROTATION_90 : Surface.ROTATION_0).build(); mInstrumentation.runOnMainSync(() -> { preview.setPreviewSurfaceProvider( mPreviewSurfaceProviderWithFrameAvailableListener); CameraSelector cameraSelector = new CameraSelector.Builder().requireLensFacing( lensFacing).build(); CameraX.bindToLifecycle(mLifecycleOwner, cameraSelector, preview); mLifecycleOwner.startAndResume(); }); assertThat(mSurfaceFutureSemaphore.tryAcquire(10, TimeUnit.SECONDS)).isTrue(); assertEquals(GUARANTEED_RESOLUTION, mPreviewResolution); mInstrumentation.runOnMainSync(() -> { CameraX.unbindAll(); mLifecycleOwner.pauseAndStop(); }); } }
Source:
private void parseIDBBlock(int blockLength, ByteBuffer pcapNgBlockHeader) { long dataLinkType = ConversionHelper.unsignedIntToLong(pcapNgBlockHeader.getShort()); setDataLinkTypeNg(fInterfaceID, dataLinkType); pcapNgBlockHeader.getShort(); long snapShotLength = ConversionHelper.unsignedIntToLong(pcapNgBlockHeader.getInt()); setSnapshotLengthNg(fInterfaceID, snapShotLength); int tsResolution = getTsValue(pcapNgBlockHeader, blockLength, PcapFileValues.PCAPNG_IFTSRESOL_CODE); setTsResolNg(fInterfaceID, tsResolution); int tsOffset = getTsValue(pcapNgBlockHeader, blockLength,PcapFileValues.PCAPNG_IFTSRESOL_CODE); setTsOffsetNg(fInterfaceID, tsOffset); fInterfaceID++; }

Target:
private void parseIDBBlock(int blockLength, ByteBuffer pcapNgBlockHeader) { int dataLinkType = pcapNgBlockHeader.getShort(); setDataLinkTypeNg(fInterfaceID, dataLinkType); pcapNgBlockHeader.getShort(); long snapShotLength = ConversionHelper.unsignedIntToLong(pcapNgBlockHeader.getInt()); setSnapshotLengthNg(fInterfaceID, snapShotLength); int tsResolution = getTsValue(pcapNgBlockHeader, blockLength, PcapFileValues.PCAPNG_IFTSRESOL_CODE); setTsResolNg(fInterfaceID, tsResolution); int tsOffset = getTsValue(pcapNgBlockHeader, blockLength, PcapFileValues.PCAPNG_IFTSOFFSET_CODE); setTsOffsetNg(fInterfaceID, tsOffset); fInterfaceID++; }
Source:
public INDArray getGradient(INDArray gradient, int iteration) { if (m == null || u == null) throw new IllegalStateException("Updater has not been initialized with view state"); INDArray oneMinusBeta1Grad = gradient.mul(1.0 - beta1); m.muli(beta1).addi(oneMinusBeta1Grad); u.assign(Transforms.max(u.muli(beta2), Transforms.abs(gradient))); double beta1t = FastMath.pow(beta1, iteration + 1); double beta2t = FastMath.pow(beta2, iteration + 1); double alphat = learningRate * FastMath.sqrt(1 - beta2t) / (1 - beta1t); if (Double.isNaN(alphat) || alphat == 0.0) alphat = epsilon; gradient.assign(m).muli(alphat).divi(u); return gradient; }

Target:
public INDArray getGradient(INDArray gradient, int iteration) { if (m == null || u == null) throw new IllegalStateException("Updater has not been initialized with view state"); u.muli(beta2); Transforms.abs(gradient,false); Nd4j.getExecutioner().exec(new Max(u,gradient,u,u.length())); double beta1t = FastMath.pow(beta1, iteration + 1); double alphat = learningRate / (1 - beta1t); if (Double.isNaN(alphat) || alphat == 0.0) alphat = epsilon; gradient.assign(m).muli(alphat).divi(u); return gradient; }
Source:
public ClusterParticipant getClusterParticipant() throws IOException { if (clusterParticipant == null) { clusterParticipant = new ClusterParticipant() { private final List<PartitionStateChangeListener> listeners = new LinkedList<>(); @Override public void participate(List<AmbryHealthReport> ambryHealthReports) { for (PartitionStateChangeListener listener : listeners) { for (String partitionName : partitionLayout.getAllPartitionNames()) { listener.onPartitionLeadFromStandby(partitionName); } } } @Override public void close() { } @Override public boolean setReplicaSealedState(ReplicaId replicaId, boolean isSealed) { return false; } @Override public boolean setReplicaStoppedState(List<ReplicaId> replicaIds, boolean markStop) { return false; } @Override public List<String> getSealedReplicas() { return Collections.emptyList(); } @Override public List<String> getStoppedReplicas() { return Collections.emptyList(); } @Override public void registerPartitionStateChangeListener(PartitionStateChangeListener partitionStateChangeListener) { listeners.add(partitionStateChangeListener); } }; } return clusterParticipant; }

Target:
public ClusterParticipant getClusterParticipant() throws IOException { if (clusterParticipant == null) { clusterParticipant = new ClusterParticipant() { private final List<PartitionStateChangeListener> listeners = new LinkedList<>(); @Override public void participate(List<AmbryHealthReport> ambryHealthReports) { for (PartitionStateChangeListener listener : listeners) { for (String partitionName : partitionLayout.getAllPartitionNames()) { listener.onPartitionStateChangeToLeaderFromStandby(partitionName); } } } @Override public void close() { } @Override public boolean setReplicaSealedState(ReplicaId replicaId, boolean isSealed) { return false; } @Override public boolean setReplicaStoppedState(List<ReplicaId> replicaIds, boolean markStop) { return false; } @Override public List<String> getSealedReplicas() { return Collections.emptyList(); } @Override public List<String> getStoppedReplicas() { return Collections.emptyList(); } @Override public void registerPartitionStateChangeListener(PartitionStateChangeListener partitionStateChangeListener) { listeners.add(partitionStateChangeListener); } }; } return clusterParticipant; }
Source:
public Cluster apply(Cluster original) { requireNonNull(original); for (Node node : getStripe().getNodes()) { if (original.containsNode(node.getNodeAddress())) { throw new IllegalArgumentException("Node with address: " + node.getNodeAddress() + " already exists in cluster: " + original); } } Cluster updated = original.clone(); updated.addStripe(getStripe()); return updated; }

Target:
public Cluster apply(Cluster original) { requireNonNull(original); if (original.getStripes().contains(getStripe())) { throw new IllegalArgumentException("Stripe :" + getStripe() + " already exists in cluster: " + original); } Cluster updated = original.clone(); updated.addStripe(getStripe().clone()); return updated; }
Source:
public void accept(final Socket socket) throws IOException { try ( InputStream input = socket.getInputStream(); BufferedOutputStream output = new BufferedOutputStream( socket.getOutputStream() ) ) { while (true) { this.print( BkBasic.addSocketHeaders( new RqLive(input), socket ), output ); if (input.available() <= 0) { break; } } } }

Target:
public void accept(final Socket socket) throws IOException { try ( final InputStream input = socket.getInputStream(); final BufferedOutputStream output = new BufferedOutputStream( socket.getOutputStream() ) ) { while (true) { this.print( BkBasic.addSocketHeaders( new RqLive(input), socket ), output ); if (input.available() <= 0) { break; } } } }
Source:
protected void handleAutoLogin(AutoLoginData autoLoginData) { final DbUser loggedUser = autoLoginData.getDbUser(); Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { lockInteractionManager.showLoadingIndicator(); getLoginModel().autoLogin(loggedUser); } }); SSOTokenChangeEvent.fire(eventBus, SSOTokenData.instance().getSsoToken()); user.setAutoLogin(true); }

Target:
protected void handleAutoLogin(AutoLoginData autoLoginData) { final DbUser loggedUser = autoLoginData.getDbUser(); Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { lockInteractionManager.showLoadingIndicator(); getLoginModel().autoLogin(loggedUser); } }); SSOTokenChangeEvent.fire(eventBus, SSOTokenData.instance().getToken()); user.setAutoLogin(true); }
Source:
public void cancelInsertIntoTest() throws SQLException { query(format("CREATE TABLE %s " + "(orderkey BIGINT, partkey BIGINT, shipinstruct VARCHAR(25)) ", tableName)); query(format("INSERT INTO %s " + "VALUES(1, 2, 'first_row')", tableName)); String sql = format("INSERT INTO %s " + "SELECT orderkey, partkey, shipinstruct FROM tpch.sf1.lineitem", tableName); doCancelTest(sql); QueryResult queryResult = query(format("SELECT * from %s", tableName)); assertThat(queryResult).containsExactly( row(1L, 2L, "first_row")); }

Target:
public void cancelInsertIntoTest() throws Exception { String tableName = format("cancel_insertinto_%s", randomUUID().toString().replace("-", "")); query(format("CREATE TABLE %s " + "(orderkey BIGINT, partkey BIGINT, shipinstruct VARCHAR(25)) ", tableName)); String sql = format("INSERT INTO %s " + "SELECT orderkey, partkey, shipinstruct FROM tpch.sf1.lineitem", tableName); doCancelTest(sql); assertThat(query(format("SELECT * from %s", tableName))).hasNoRows(); query(format("DROP TABLE IF EXISTS %s", tableName)); }
Source:
public boolean isValid() { return canUnlock(); }

Target:
public boolean isValid() { try { return canUnlock(); } catch (SecurityException e) { return false; } }
Source:
public void sawOpcode(int seen) { if (seen == Constants.INVOKEVIRTUAL && ( getNameConstantOperand().equals("sendBroadcast") || getNameConstantOperand().equals("sendBroadcastAsUser") || getNameConstantOperand().equals("sendOrderedBroadcast") || getNameConstantOperand().equals("sendOrderedBroadcastAsUser") ) && !getClassConstantOperand().endsWith("LocalBroadcastManager") ) { bugReporter.reportBug(new BugInstance(this, ANDROID_BROADCAST_TYPE, Priorities.NORMAL_PRIORITY) .addClass(this).addMethod(this).addSourceLine(this)); } }

Target:
public void sawOpcode(int seen) { if (seen == Constants.INVOKEVIRTUAL && ( getNameConstantOperand().equals("sendBroadcast") || getNameConstantOperand().equals("sendBroadcastAsUser") || getNameConstantOperand().equals("sendOrderedBroadcast") || getNameConstantOperand().equals("sendOrderedBroadcastAsUser") )) { if (!InterfaceUtils.isSubtype(getClassConstantOperand(), "android.support.v4.content.LocalBroadcastManager") && !getClassConstantOperand().endsWith("LocalBroadcastManager")) { bugReporter.reportBug(new BugInstance(this, ANDROID_BROADCAST_TYPE, Priorities.NORMAL_PRIORITY) .addClass(this).addMethod(this).addSourceLine(this)); } } }
Source:
public void testSaveGame() { String playerName = "Henk"; State.setPlayerName(playerName); int coins = 45; State.setCoins(coins); double score = 34567; State.setScore(score); boolean soundEnabled = false; State.setSoundEnabled(soundEnabled); SaveGameWriter.saveGame("testWriteRead.json"); SaveGameParser.loadGame("testWriteRead.json"); assertEquals(playerName, State.getPlayerName()); assertEquals(coins, State.getCoins()); assertEquals(score, State.getScore(), DELTA); assertEquals(soundEnabled, State.isSoundEnabled()); }

Target:
public void testSaveGame() { final String playerName = "Henk"; State.setPlayerName(playerName); final int coins = 45; State.setCoins(coins); final int score = 34567; State.setHighscore(score); final boolean soundEnabled = false; State.setSoundEnabled(soundEnabled); SaveGameWriter.saveGame(fileFolder + "saveGameWriterTest.json"); SaveGameParser.loadGame(fileFolder + "saveGameWriterTest.json"); assertEquals(playerName, State.getPlayerName()); assertEquals(coins, State.getCoins()); assertEquals(score, State.getHighscore()); assertEquals(soundEnabled, State.isSoundEnabled()); }
Source:
private List<UserDto> findUsers(DbSession dbSession, PermissionQuery query) { List<Integer> orderedIds = new ArrayList<>(dbClient.userPermissionDao().selectUserIdsByQuery(dbSession, query)); return Ordering.explicit(orderedIds).onResultOf(UserDto::getId).immutableSortedCopy(dbClient.userDao().selectByIds(dbSession, orderedIds)); }

Target:
private List<UserDto> findUsers(DbSession dbSession, PermissionQuery query) { List<Integer> orderedIds = dbClient.userPermissionDao().selectUserIdsByQuery(dbSession, query); return Ordering.explicit(orderedIds).onResultOf(UserDto::getId).immutableSortedCopy(dbClient.userDao().selectByIds(dbSession, orderedIds)); }
Source:
public void testMap_toProto() { MapExample mapExample = new MapExample(); mapExample.put("test", null); mapExample.put("foo", "bar"); ProtobufMapExample protoMapExample; try { protoMapExample = mapper.map(mapExample, ProtobufMapExample.class); fail("Should have thrown MappingException"); } catch (MappingException e) { assertEquals("Could not call map setter method putAllValue", e.getMessage()); } mapExample.put("test", "value"); protoMapExample = mapper.map(mapExample, ProtobufMapExample.class); assertEquals(mapExample.getValue(), protoMapExample.getValueMap()); }

Target:
public void testMap_toProto() { MapExample mapExample = new MapExample(); mapExample.put("test", "value"); ProtobufMapExample protoMapExample = mapper.map(mapExample, ProtobufMapExample.class); assertEquals(mapExample.getValue(), protoMapExample.getValueMap()); }
Source:
public OsgpException ensureOsgpOrTechnicalException(final Exception e) { if (e instanceof OsgpException) { return (OsgpException) e; } if (e instanceof ConnectionException) { return new FunctionalException(FunctionalExceptionType.CONNECTION_ERROR, ComponentType.PROTOCOL_DLMS); } return new TechnicalException(ComponentType.PROTOCOL_DLMS, "Unexpected exception while handling protocol request/response message", new OsgpException(ComponentType.PROTOCOL_DLMS, e.getMessage())); }

Target:
public OsgpException ensureOsgpOrTechnicalException(final Exception e) { if (e instanceof OsgpException) { return (OsgpException) e; } if (e instanceof ConnectionException) { return new FunctionalException(FunctionalExceptionType.CONNECTION_ERROR, ComponentType.PROTOCOL_DLMS, e); } return new TechnicalException(ComponentType.PROTOCOL_DLMS, "Unexpected exception while handling protocol request/response message", new OsgpException(ComponentType.PROTOCOL_DLMS, e.getMessage())); }
Source:
public EquipmentSlot getEquipmentSlot() { return EquipmentSlot.values()[hand]; }

Target:
public EquipmentSlot getEquipmentSlot() { return hand == 1 ? EquipmentSlot.OFF_HAND : EquipmentSlot.HAND; }
Source:
private String extractChecksText(String testsURL) { StringBuilder builder = new StringBuilder(); if (summary.getFailCount() > 0) { List<CaseResult> failedTests = action.getResult().getFailedTests(); if (failedTests.size() > 10) { failedTests = failedTests.subList(0, 9); } failedTests.forEach(failedTest -> mapFailedTestToTestReport(builder, failedTest)); if (summary.getFailCount() > 10) { builder.append("\n") .append(summary.getFailCount() - 10) .append(" more test results are not shown here, view them on [Jenkins](") .append(testsURL).append(")"); } } return builder.toString(); }

Target:
private String extractChecksText(String testsURL) { StringBuilder builder = new StringBuilder(); if (summary.getFailCount() > 0) { List<CaseResult> failedTests = action.getResult().getFailedTests(); if (failedTests.size() > MAX_RESULTS_TO_SEND_TO_CHECKS_API) { failedTests = failedTests.subList(0, MAX_RESULTS_TO_SEND_TO_CHECKS_API - 1); } failedTests.forEach(failedTest -> mapFailedTestToTestReport(builder, failedTest)); if (summary.getFailCount() > MAX_RESULTS_TO_SEND_TO_CHECKS_API) { builder.append("\n") .append(summary.getFailCount() - MAX_RESULTS_TO_SEND_TO_CHECKS_API) .append(" more test results are not shown here, view them on [Jenkins](") .append(testsURL).append(")"); } } return builder.toString(); }
Source:
public void createAccounts(Collection<AccountAttributes> accountsToAdd, boolean updateAccount) throws InvalidParametersException { List<StudentProfileAttributes> profilesToAdd = new LinkedList<StudentProfileAttributes>(); for (AccountAttributes accountToAdd : accountsToAdd) { profilesToAdd.add(accountToAdd.studentProfile); } profilesDb.createEntities(profilesToAdd); List<AccountAttributes> accountsToUpdate = createEntities(accountsToAdd); if (updateAccount) { for (AccountAttributes entity : accountsToUpdate) { AccountAttributes account = entity; try { updateAccount(account, true); } catch (EntityDoesNotExistException e) { Assumption.fail("Entity found be already existing and not existing simultaneously"); } } } }

Target:
public void createAccounts(Collection<AccountAttributes> accountsToAdd, boolean updateAccount) throws InvalidParametersException { List<StudentProfileAttributes> profilesToAdd = new LinkedList<>(); for (AccountAttributes accountToAdd : accountsToAdd) { profilesToAdd.add(accountToAdd.studentProfile); } profilesDb.createEntities(profilesToAdd); List<AccountAttributes> accountsToUpdate = createEntities(accountsToAdd); if (updateAccount) { for (AccountAttributes account : accountsToUpdate) { try { updateAccount(account, true); } catch (EntityDoesNotExistException e) { Assumption.fail("Account found to be already existing and not existing simultaneously"); } } } }
Source:
public static URI getStartReplaceSegmentsURI(URI controllerURI, String rawTableName, String tableType) throws URISyntaxException { return new URI(StringUtil.join("/", StringUtils .chomp(controllerURI.getScheme() + "://" + controllerURI.getHost() + ":" + controllerURI.getPort(), "/"), OLD_SEGMENT_PATH, rawTableName + START_REPLACE_SEGMENTS_PATH + TYPE_DELIMITER + tableType)); }

Target:
public static URI getStartReplaceSegmentsURI(URI controllerURI, String rawTableName, String tableType) throws URISyntaxException { return new URI(StringUtil.join("/", StringUtils .chomp(controllerURI.getScheme() + "://" + controllerURI.getHost() + ":" + controllerURI.getPort()), OLD_SEGMENT_PATH, rawTableName + START_REPLACE_SEGMENTS_PATH + TYPE_DELIMITER + tableType)); }
Source:
public void configure(Binder binder) { super.configure(binder); JsonConfigProvider.bind(binder, "druid.metadata.postgres", PostgreSQLConnectorConfig.class); PolyBind .optionBinder(binder, Key.get(MetadataStorageProvider.class)) .addBinding(TYPE) .to(NoopMetadataStorageProvider.class) .in(LazySingleton.class); PolyBind .optionBinder(binder, Key.get(MetadataStorageConnector.class)) .addBinding(TYPE) .to(PostgreSQLConnector.class) .in(LazySingleton.class); PolyBind .optionBinder(binder, Key.get(SQLMetadataConnector.class)) .addBinding(TYPE) .to(PostgreSQLConnector.class) .in(LazySingleton.class); PolyBind.optionBinder(binder, Key.get(MetadataStorageActionHandlerFactory.class)) .addBinding(TYPE) .to(PostgreSQLMetadataStorageActionHandlerFactory.class) .in(LazySingleton.class); }

Target:
public void configure(Binder binder) { super.configure(binder); JsonConfigProvider.bind(binder, "druid.metadata.postgres.ssl", PostgreSQLConnectorConfig.class); JsonConfigProvider.bind(binder, "druid.metadata.postgres", PostgreSQLTablesConfig.class); PolyBind .optionBinder(binder, Key.get(MetadataStorageProvider.class)) .addBinding(TYPE) .to(NoopMetadataStorageProvider.class) .in(LazySingleton.class); PolyBind .optionBinder(binder, Key.get(MetadataStorageConnector.class)) .addBinding(TYPE) .to(PostgreSQLConnector.class) .in(LazySingleton.class); PolyBind .optionBinder(binder, Key.get(SQLMetadataConnector.class)) .addBinding(TYPE) .to(PostgreSQLConnector.class) .in(LazySingleton.class); PolyBind.optionBinder(binder, Key.get(MetadataStorageActionHandlerFactory.class)) .addBinding(TYPE) .to(PostgreSQLMetadataStorageActionHandlerFactory.class) .in(LazySingleton.class); }
Source:
public Subscription anonymizePassword() { if (getEndpoint().containsCredentials()) { return new Subscription( topicName, name, endpoint.anonymizePassword(), state, description, deliveryType == DeliveryType.SERIAL ? serialSubscriptionPolicy : batchSubscriptionPolicy, trackingEnabled, supportTeam, contact, contentType, deliveryType ); } return this; }

Target:
public Subscription anonymizePassword() { if (getEndpoint().containsCredentials()) { return new Subscription( topicName, name, endpoint.anonymizePassword(), state, description, deliveryType == DeliveryType.BATCH ? batchSubscriptionPolicy : serialSubscriptionPolicy, trackingEnabled, supportTeam, contact, contentType, deliveryType ); } return this; }
Source:
private List<SPTarget> getTargetList() { List<SPTarget> targetList = new ArrayList<>(); Option<ObsContext> ctxOpt = _iw.getObsContext(); if (ctxOpt.isEmpty()) return targetList; ObsContext ctx = ctxOpt.getValue(); TargetEnvironment env = ctx.getTargets(); GuideGroup group = env.getOrCreatePrimaryGuideGroup(); guideProbeType = null; int oiwfsCount = 0; int aowfsCount = 0; for (GuideProbe gp : group.getReferencedGuiders()) { GuideProbe.Type t = gp.getType(); if (t == GuideProbe.Type.OIWFS || t == GuideProbe.Type.AOWFS) { if (t == GuideProbe.Type.OIWFS) { oiwfsCount++; } else { aowfsCount++; } } } if ("Flamingos2".equals(ctx.getInstrument().getNarrowType())) { guideProbeType = GuideProbe.Type.AOWFS; } else if (oiwfsCount > 1 && aowfsCount > 1) { message = TpeMessage.warningMessage("Strehl: Error: Both ODGW and CWFS guide stars defined"); targetListError = true; return new ArrayList<>(); } else if (oiwfsCount > 1) { guideProbeType = GuideProbe.Type.OIWFS; } else { guideProbeType = GuideProbe.Type.AOWFS; } message = null; targetListError = false; for (GuideProbe gp : group.getReferencedGuiders()) { GuideProbe.Type t = gp.getType(); if (t == guideProbeType) { Option<SPTarget> primary = group.get(gp).getValue().getPrimary(); if (!primary.isEmpty()) { SPTarget target = primary.getValue(); targetList.add(target); target.addWatcher(this); } } } return targetList; }

Target:
private List<SPTarget> getTargetList() { List<SPTarget> targetList = new ArrayList<>(); Option<ObsContext> ctxOpt = _iw.getObsContext(); if (ctxOpt.isEmpty()) return targetList; ObsContext ctx = ctxOpt.getValue(); TargetEnvironment env = ctx.getTargets(); GuideGroup group = env.getOrCreatePrimaryGuideGroup(); guideProbeType = null; int oiwfsCount = 0; int aowfsCount = 0; for (GuideProbe gp : group.getReferencedGuiders()) { GuideProbe.Type t = gp.getType(); switch (t) { case OIWFS: oiwfsCount++; break; case AOWFS: aowfsCount++; break; default: } } if ("Flamingos2".equals(ctx.getInstrument().getNarrowType())) { guideProbeType = GuideProbe.Type.AOWFS; } else if (oiwfsCount > 1 && aowfsCount > 1) { message = TpeMessage.warningMessage("Strehl: Error: Both ODGW and CWFS guide stars defined"); targetListError = true; return new ArrayList<>(); } else if (oiwfsCount > 1) { guideProbeType = GuideProbe.Type.OIWFS; } else { guideProbeType = GuideProbe.Type.AOWFS; } message = null; targetListError = false; for (GuideProbe gp : group.getReferencedGuiders()) { GuideProbe.Type t = gp.getType(); if (t == guideProbeType) { Option<SPTarget> primary = group.get(gp).getValue().getPrimary(); if (!primary.isEmpty()) { SPTarget target = primary.getValue(); targetList.add(target); target.addWatcher(this); } } } return targetList; }
Source:
protected boolean callEventExist(final Object container, final Operation operation) { boolean exist = false; if (container instanceof org.eclipse.uml2.uml.Package) { EList<Element> containment = ((org.eclipse.uml2.uml.Package) container).getOwnedElements(); Iterator<Element> elements = containment.iterator(); while (!exist && elements.hasNext()) { Element element = elements.next(); if ((element instanceof CallEvent) && (operation != null)) { exist = exist || (operation.equals(((CallEvent) element).getOperation())); } } } return exist; }

Target:
protected boolean callEventExist(final Object container, final Operation operation) { boolean exist = false; if (container instanceof org.eclipse.uml2.uml.Package) { EList<Element> containment = ((org.eclipse.uml2.uml.Package) container).getOwnedElements(); Iterator<Element> elements = containment.iterator(); while (!exist && elements.hasNext()) { Element element = elements.next(); if ((element instanceof CallEvent) && (null != operation)) { exist = (operation.equals(((CallEvent) element).getOperation())); } } } return exist; }
Source:
private Object[] getCompressedRoots() { if (compressedRoots == null) { List<Object> compressedRootList = new ArrayList<Object>(); compressedFolders = getCompressedFolders(); for (StagingFolderEntry compressedFolder : compressedFolders) { compressedRootList.add(compressedFolder); } for (StagingEntry rootFile : rootFiles) { compressedRootList.add(rootFile); } compressedRoots = new Object[compressedRootList.size()]; compressedRootList.toArray(compressedRoots); } return compressedRoots; }

Target:
private Object[] getCompressedRoots() { if (compressedRoots == null) { List<Object> compressedRootList = new ArrayList<Object>(); compressedFolders = getCompressedFolders(); for (StagingFolderEntry compressedFolder : compressedFolders) compressedRootList.add(compressedFolder); for (StagingEntry rootFile : rootFiles) compressedRootList.add(rootFile); compressedRoots = new Object[compressedRootList.size()]; compressedRootList.toArray(compressedRoots); } return compressedRoots; }
Source:
private XmlRpcStruct loadPowerDogResponse(boolean needsUpdate, PowerDogLocalApiServerConfig server) { XmlRpcStruct response = null; if (needsUpdate == true) { try { logger.debug("PowerDogLocalApi querying PowerDog"); PowerDog powerdog = (PowerDog) XmlRpcProxy .createProxy(server.url(), "", new Class[] { PowerDog.class }, false); response = powerdog.getAllCurrentLinearValues(server.password); server.cache = response; server.lastUpdate = System.currentTimeMillis(); logger.debug("PowerDog.getAllCurrentLinearValues() result: " + response.toString()); } catch (Exception e) { logger.warn("PowerDogLocalApi querying PowerDog failed"); logger.warn(e.getMessage()); } } else { logger.debug("Using PowerDogLocalApi cache"); response = server.cache; } return response; }

Target:
private XmlRpcStruct loadPowerDogResponse(boolean needsUpdate, PowerDogLocalApiServerConfig server) { XmlRpcStruct response = null; if (needsUpdate == true) { try { logger.debug("PowerDogLocalApi querying PowerDog"); PowerDog powerdog = (PowerDog) XmlRpcProxy.createProxy(server.url(), "", new Class[] { PowerDog.class }, false); response = powerdog.getAllCurrentLinearValues(server.password); server.cache = response; server.lastUpdate = System.currentTimeMillis(); logger.debug("PowerDog.getAllCurrentLinearValues() result: {}", response.toString()); } catch (Exception e) { logger.warn("PowerDogLocalApi querying PowerDog failed"); logger.warn(e.getMessage()); } } else { logger.debug("Using PowerDogLocalApi cache"); response = server.cache; } return response; }
Source:
public void testTaggedAllocations() { QueryId testQuery = new QueryId("test_query"); MemoryPool testPool = new MemoryPool(new MemoryPoolId("test"), new DataSize(1000, BYTE)); testPool.reserve(testQuery, Optional.of("test_tag"), 10); Map<String, Long> allocations = testPool.getTaggedMemoryAllocations().get(testQuery); assertTaggedAllocations(allocations, new String[] {"test_tag"}, new long[] {10}); testPool.free(testQuery, Optional.of("test_tag"), 5); assertTaggedAllocations(allocations, new String[] {"test_tag"}, new long[] {5}); testPool.reserve(testQuery, Optional.of("test_tag2"), 20); assertTaggedAllocations(allocations, new String[] {"test_tag", "test_tag2"}, new long[] {5, 20}); testPool.free(testQuery, Optional.of("test_tag"), 5); assertTaggedAllocations(allocations, new String[] {"test_tag2"}, new long[] {20}); testPool.free(testQuery, Optional.of("test_tag2"), 20); assertEquals(testPool.getTaggedMemoryAllocations().size(), 0); }

Target:
public void testTaggedAllocations() { QueryId testQuery = new QueryId("test_query"); MemoryPool testPool = new MemoryPool(new MemoryPoolId("test"), new DataSize(1000, BYTE)); testPool.reserve(testQuery, Optional.of("test_tag"), 10); Map<String, Long> allocations = testPool.getTaggedMemoryAllocations().get(testQuery); assertEquals(allocations, ImmutableMap.of("test_tag", 10L)); testPool.free(testQuery, Optional.of("test_tag"), 5); assertEquals(allocations, ImmutableMap.of("test_tag", 5L)); testPool.reserve(testQuery, Optional.of("test_tag2"), 20); assertEquals(allocations, ImmutableMap.of("test_tag", 5L, "test_tag2", 20L)); testPool.free(testQuery, Optional.of("test_tag"), 5); assertEquals(allocations, ImmutableMap.of("test_tag2", 20L)); testPool.free(testQuery, Optional.of("test_tag2"), 20); assertEquals(testPool.getTaggedMemoryAllocations().size(), 0); }
Source:
public List<SinkRecord> flush() throws SQLException { if (records.isEmpty()) { return new ArrayList<>(); } for (SinkRecord record : records) { preparedStatementBinder.bindRecord(record); } int totalUpdateCount = 0; boolean successNoInfo = false; for (int updateCount : preparedStatement.executeBatch()) { if (updateCount == Statement.SUCCESS_NO_INFO) { successNoInfo = true; continue; } totalUpdateCount += updateCount; } if (totalUpdateCount != records.size() && !successNoInfo) { switch (config.insertMode) { case INSERT: throw new ConnectException(String.format("Update count (%d) did not sum up to total number of records inserted (%d)", totalUpdateCount, records.size())); case UPSERT: log.trace("Upserted records:{} resulting in in totalUpdateCount:{}", records.size(), totalUpdateCount); } } if (successNoInfo) { log.info( "Insert records:{} , but no count of the number of rows it affected is available", records.size()); } final List<SinkRecord> flushedRecords = records; records = new ArrayList<>(); return flushedRecords; }

Target:
public List<SinkRecord> flush() throws SQLException { if (records.isEmpty()) { return new ArrayList<>(); } for (SinkRecord record : records) { preparedStatementBinder.bindRecord(record); } int totalUpdateCount = 0; boolean successNoInfo = false; for (int updateCount : preparedStatement.executeBatch()) { if (updateCount == Statement.SUCCESS_NO_INFO) { successNoInfo = true; continue; } totalUpdateCount += updateCount; } if (totalUpdateCount != records.size() && !successNoInfo) { switch (config.insertMode) { case INSERT: throw new ConnectException(String.format("Update count (%d) did not sum up to total number of records inserted (%d)", totalUpdateCount, records.size())); case UPSERT: log.trace("Upserted records:{} resulting in in totalUpdateCount:{}", records.size(), totalUpdateCount); } } if (successNoInfo) { log.info( config.insertMode + " records:{} , but no count of the number of rows it affected is available", records.size()); } final List<SinkRecord> flushedRecords = records; records = new ArrayList<>(); return flushedRecords; }
Source:
public void isAliveShouldReturnFalseWhenRemoteRepositoryCachedValueIsFalse() { RemoteRepository remoteRepository = createMockedRemoteRepository(); initializeCache(false); remoteRepositoryAlivenessCacheManager.put(remoteRepository, false); boolean alive = remoteRepositoryAlivenessCacheManager.isAlive(remoteRepository); assertFalse(alive); }

Target:
public void isAliveShouldReturnFalseWhenRemoteRepositoryCachedValueIsFalse() { initializeCache(false); boolean alive = remoteRepositoryAlivenessCacheManager.isAlive(remoteRepository); assertThat(alive).isFalse(); }
Source:
public synchronized boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { long now = System.nanoTime(); long end = now + unit.toNanos(timeout); while (count!=0) { long d = end - now; if (d<0) { return false; } wait(TimeUnit.NANOSECONDS.toMillis(d)); now = System.nanoTime(); } return true; }

Target:
public synchronized boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { long now = System.nanoTime(); long end = now + unit.toNanos(timeout); while (count!=0) { long d = end - now; if (d<=0) { return false; } wait(TimeUnit.NANOSECONDS.toMillis(d)); now = System.nanoTime(); } return true; }
Source:
public void testFeatureAttributeVisitor() { GroupByVisitor visitor = buildVisitor("energy_consumption", "Average", new String[]{"building_type"}); List<Expression> expressions = visitor.getExpressions(); Set<String> names = new HashSet<String>(); for (Expression expression : expressions) { PropertyName pn = (PropertyName) expression; names.add(pn.getPropertyName()); } assertEquals(2, names.size()); assertTrue(names.contains("energy_consumption")); assertTrue(names.contains("building_type")); }

Target:
public void testFeatureAttributeVisitor() { GroupByVisitor visitor = buildVisitor("energy_consumption", "Average", new String[]{"building_type"}); List<Expression> expressions = visitor.getExpressions(); Set<String> names = new HashSet<>(); for (Expression expression : expressions) { PropertyName pn = (PropertyName) expression; names.add(pn.getPropertyName()); } assertEquals(2, names.size()); assertTrue(names.contains("energy_consumption")); assertTrue(names.contains("building_type")); }
Source:
protected void readOsSection(XmlNode section) { _vmTemplate.setId(new Guid(section.Attributes.get("ovf:id").getValue())); XmlNode node = section.SelectSingleNode("Description"); if (node != null) { if (node.InnerText.equals(6)) { node.InnerText = "0"; } _vmTemplate.setOsId(osRepository.getOsIdByUniqueName(node.InnerText)); } }

Target:
protected void readOsSection(XmlNode section) { _vmTemplate.setId(new Guid(section.Attributes.get("ovf:id").getValue())); XmlNode node = section.SelectSingleNode("Description"); if (node != null) { if (node.InnerText.equals(String.valueOf(OsRepository.OLD_OTHER_ID))) { node.InnerText = String.valueOf(OsRepository.DEFAULT_OS); } _vmTemplate.setOsId(osRepository.getOsIdByUniqueName(node.InnerText)); } }
Source:
public CreateAllSnapshotsFromVmParameters() { needsLocking = true; diskIdsToIgnoreInChecks = Collections.emptySet(); }

Target:
public CreateAllSnapshotsFromVmParameters() { needsLocking = true; snapshotType = SnapshotType.REGULAR; saveMemory = true; diskIdsToIgnoreInChecks = Collections.emptySet(); }
Source:
public void testRedeemGiftCardOnAccount() throws Exception { final GiftCard giftCardData = TestUtils.createRandomGiftCard(); try { final GiftCard giftCard = recurlyClient.purchaseGiftCard(giftCardData); Assert.assertEquals(giftCard.getProductCode(), giftCardData.getProductCode()); Assert.assertNull(giftCard.getRedeemedAt()); final Account gifterAccount = giftCard.getGifterAccount(); Assert.assertNotNull(gifterAccount); final String redemptionCode = giftCard.getRedemptionCode(); final String gifterAccountCode = gifterAccount.getAccountCode(); final GiftCard redeemedCard = recurlyClient.redeemGiftCard(redemptionCode, gifterAccountCode); Assert.assertNotNull(redeemedCard.getRedeemedAt()); } finally { } }

Target:
public void testRedeemGiftCardOnAccount() throws Exception { final GiftCard giftCardData = TestUtils.createRandomGiftCard(); final GiftCard giftCard = recurlyClient.purchaseGiftCard(giftCardData); Assert.assertEquals(giftCard.getProductCode(), giftCardData.getProductCode()); Assert.assertNull(giftCard.getRedeemedAt()); final Account gifterAccount = giftCard.getGifterAccount(); Assert.assertNotNull(gifterAccount); final String redemptionCode = giftCard.getRedemptionCode(); final String gifterAccountCode = gifterAccount.getAccountCode(); final GiftCard redeemedCard = recurlyClient.redeemGiftCard(redemptionCode, gifterAccountCode); Assert.assertNotNull(redeemedCard.getRedeemedAt()); }
Source:
public T getItem() { T result = null; try { result = (T)config .createExecutableExtension(DescriptorRegistryEventListener.IMPL_CLASS_DESCRIPTPOR_ATTR); } catch (CoreException e) { e.printStackTrace(); } return result; }

Target:
public T getItem() { T result = null; try { result = (T)config .createExecutableExtension(DescriptorRegistryEventListener.IMPL_CLASS_DESCRIPTPOR_ATTR); } catch (CoreException e) { Throwables.propagate(e); } return result; }
Source:
public Text evaluate(String ip, String xff) { assert ipUtil != null : "Evaluate called without initializing 'ipUtil'"; return new Text(ipUtil.getClientIp(ip, xff)); }

Target:
public String evaluate(String ip, String xff) { assert ipUtil != null : "Evaluate called without initializing 'ipUtil'"; return ipUtil.getClientIp(ip, xff); }
Source:
public static boolean convertSegment(File toConvert, File converted, IndexSpec indexSpec, boolean forceIfCurrent, boolean validate) throws IOException { final int version = SegmentUtils.getVersionFromDir(toConvert); final boolean wasConverted; switch (version) { case 1: case 2: case 3: log.makeAlert("Attempt to load segment of version <= 3.") .addData("version", version) .emit(); wasConverted = false; break; case 4: case 5: case 6: case 7: log.info("Old version, re-persisting."); IndexMerger.append( Arrays.<IndexableAdapter>asList(new QueryableIndexIndexableAdapter(loadIndex(toConvert))), converted, indexSpec ); wasConverted = true; break; case 8: DefaultIndexIOHandler.convertV8toV9(toConvert, converted, indexSpec); wasConverted = true; break; default: if (forceIfCurrent) { IndexMaker.convert(toConvert, converted, indexSpec); wasConverted = true; } else { log.info("Version[%s], skipping.", version); wasConverted = false; } break; } if(validate){ DefaultIndexIOHandler.validateTwoSegments(toConvert, converted); } return wasConverted; }

Target:
public static boolean convertSegment(File toConvert, File converted, IndexSpec indexSpec, boolean forceIfCurrent, boolean validate) throws IOException { final int version = SegmentUtils.getVersionFromDir(toConvert); switch (version) { case 1: case 2: case 3: log.makeAlert("Attempt to load segment of version <= 3.") .addData("version", version) .emit(); return false; case 4: case 5: case 6: case 7: log.info("Old version, re-persisting."); IndexMerger.append( Arrays.<IndexableAdapter>asList(new QueryableIndexIndexableAdapter(loadIndex(toConvert))), converted, indexSpec ); return true; case 8: DefaultIndexIOHandler.convertV8toV9(toConvert, converted, indexSpec); return true; default: if (forceIfCurrent) { IndexMaker.convert(toConvert, converted, indexSpec); if(validate){ DefaultIndexIOHandler.validateTwoSegments(toConvert, converted); } return true; } else { log.info("Version[%s], skipping.", version); return false; } } }
Source:
protected void handleError(final Exception e, final String correlationUid, final String organisationIdentification, final String deviceIdentification, final String messageType) { LOGGER.info("handeling error: for message type: {}", e.getMessage(), messageType); final OsgpException osgpException = new TechnicalException(ComponentType.UNKNOWN, "An unknown error occurred", e); this.webServiceResponseMessageSender.send(ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(correlationUid).withOrganisationIdentification(organisationIdentification) .withDeviceIdentification(deviceIdentification).withResult(ResponseMessageResultType.NOT_OK) .withOsgpException(osgpException).withDataObject(e).build(), messageType); }

Target:
protected void handleError(final Exception e, final String correlationUid, final String organisationIdentification, final String deviceIdentification, final String messageType) { LOGGER.info("handeling error: for message type: {}", e.getMessage(), messageType); final OsgpException osgpException = new TechnicalException(ComponentType.UNKNOWN, "An unknown error occurred", e); ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(correlationUid).withOrganisationIdentification(organisationIdentification) .withDeviceIdentification(deviceIdentification).withResult(ResponseMessageResultType.NOT_OK) .withOsgpException(osgpException).withDataObject(e).build(); this.webServiceResponseMessageSender.send(responseMessage, messageType); }
Source:
public void requestInterstitialAd(Context context, final MediationInterstitialListener mediationInterstitialListener, Bundle bundle, MediationAdRequest mediationAdRequest, Bundle mediationExtras) { Log.d(TAG, "requestInterstitialAd called with bundle: " + bundle); initializeFromBundle(context, bundle); mInterstitialContext = new WeakReference<>(context); String spotId = bundle.getString(FyberMediationAdapter.KEY_SPOT_ID); if (TextUtils.isEmpty(spotId)) { mediationInterstitialListener.onAdFailedToLoad(this, AdRequest.ERROR_CODE_INVALID_REQUEST); Log.w(TAG, "Cannot render banner ad. Please define a valid spot id on the AdMob console"); return; } mMediationInterstitialListener = mediationInterstitialListener; mInterstitialSpot = InneractiveAdSpotManager.get().createSpot(); mInterstitialSpot.setMediationName(MEDIATOR_NAME); InneractiveFullscreenUnitController controller = new InneractiveFullscreenUnitController(); mInterstitialSpot.addUnitController(controller); InneractiveAdRequest request = new InneractiveAdRequest(spotId); InneractiveAdSpot.RequestListener requestListener = createFyberInterstitialAdListener(); mInterstitialSpot.setRequestListener(requestListener); mInterstitialSpot.requestAd(request); }

Target:
public void requestInterstitialAd(Context context, final MediationInterstitialListener mediationInterstitialListener, Bundle bundle, MediationAdRequest mediationAdRequest, Bundle mediationExtras) { Log.d(TAG, "requestInterstitialAd called with bundle: " + bundle); initializeFromBundle(context, bundle); mInterstitialContext = new WeakReference<>(context); String spotId = bundle.getString(FyberMediationAdapter.KEY_SPOT_ID); if (TextUtils.isEmpty(spotId)) { mediationInterstitialListener.onAdFailedToLoad(this, AdRequest.ERROR_CODE_INVALID_REQUEST); Log.w(TAG, "Cannot render interstitial ad. Please define a valid spot id on the AdMob UI"); return; } mMediationInterstitialListener = mediationInterstitialListener; mInterstitialSpot = InneractiveAdSpotManager.get().createSpot(); mInterstitialSpot.setMediationName(MEDIATOR_NAME); InneractiveFullscreenUnitController controller = new InneractiveFullscreenUnitController(); mInterstitialSpot.addUnitController(controller); InneractiveAdRequest request = new InneractiveAdRequest(spotId); InneractiveAdSpot.RequestListener requestListener = createFyberInterstitialAdListener(); mInterstitialSpot.setRequestListener(requestListener); mInterstitialSpot.requestAd(request); }
Source:
public BackupReceiverImpl(Cache cache) { this.cache = cache; this.local = cache.getCacheConfiguration().clustering().cacheMode() == CacheMode.LOCAL; siteUpdater = new BackupCacheUpdater(cache, remote2localTx); }

Target:
public BackupReceiverImpl(Cache cache) { this.cache = cache; siteUpdater = new BackupCacheUpdater(cache, remote2localTx); }
Source:
private Collection<CorrelationAttribute> getCorrelationAttributesFromNode(Node node) { Collection<CorrelationAttribute> ret = new ArrayList<>(); BlackboardArtifact bbArtifact = getBlackboardArtifactFromNode(node); if (bbArtifact != null) { ret.addAll(EamArtifactUtil.getCorrelationAttributeFromBlackboardArtifact(bbArtifact, false, false)); } if (this.file != null && EamDb.isEnabled()) { try { List<CorrelationAttribute.Type> artifactTypes = EamDb.getInstance().getDefinedCorrelationTypes(); String md5 = this.file.getMd5Hash(); if (md5 != null && !md5.isEmpty() && null != artifactTypes && !artifactTypes.isEmpty()) { for (CorrelationAttribute.Type aType : artifactTypes) { if (aType.getId() == CorrelationAttribute.FILES_TYPE_ID) { ret.add(new CorrelationAttribute(aType, md5)); break; } } } } catch (EamDbException ex) { LOGGER.log(Level.SEVERE, "Error connecting to DB", ex); } } else { try { ret.add(new CorrelationAttribute(CorrelationAttribute.getDefaultCorrelationTypes().get(0), this.file.getMd5Hash())); } catch (EamDbException ex) { LOGGER.log(Level.SEVERE, "Error connecting to DB", ex); } } return ret; }

Target:
private Collection<CorrelationAttribute> getCorrelationAttributesFromNode(Node node) { Collection<CorrelationAttribute> ret = new ArrayList<>(); BlackboardArtifact bbArtifact = getBlackboardArtifactFromNode(node); if (bbArtifact != null) { ret.addAll(EamArtifactUtil.getCorrelationAttributeFromBlackboardArtifact(bbArtifact, false, false)); } if (this.file != null && EamDb.isEnabled()) { try { List<CorrelationAttribute.Type> artifactTypes = EamDb.getInstance().getDefinedCorrelationTypes(); String md5 = this.file.getMd5Hash(); if (md5 != null && !md5.isEmpty() && null != artifactTypes && !artifactTypes.isEmpty()) { for (CorrelationAttribute.Type aType : artifactTypes) { if (aType.getId() == CorrelationAttribute.FILES_TYPE_ID) { ret.add(new CorrelationAttribute(aType, md5)); break; } } } } catch (EamDbException ex) { LOGGER.log(Level.SEVERE, "Error connecting to DB", ex); } } else { try { if(this.file != null) { String md5 = this.file.getMd5Hash(); if(md5 != null && !md5.isEmpty()) { ret.add(new CorrelationAttribute(CorrelationAttribute.getDefaultCorrelationTypes().get(0),md5)); } } } catch (EamDbException ex) { LOGGER.log(Level.SEVERE, "Error connecting to DB", ex); } } return ret; }
Source:
public void processMessage(final ObjectMessage message) throws JMSException { LOGGER.debug("Processing retrieve configuration objects request message"); final DlmsDeviceMessageMetadata messageMetadata = new DlmsDeviceMessageMetadata(); try { messageMetadata.handleMessage(message); final RetrieveConfigurationObjectsRequest synchronizeTimeRequest = (RetrieveConfigurationObjectsRequest) message .getObject(); this.adhocService.retrieveConfigurationObjects(messageMetadata, synchronizeTimeRequest, this.responseMessageSender); } catch (final JMSException exception) { this.logJmsException(LOGGER, exception, messageMetadata); } }

Target:
public void processMessage(final ObjectMessage message) throws JMSException { LOGGER.debug("Processing retrieve configuration objects request message"); final DlmsDeviceMessageMetadata messageMetadata = new DlmsDeviceMessageMetadata(); try { messageMetadata.handleMessage(message); final RetrieveConfigurationObjectsRequest retrieveConfigurationRequest = (RetrieveConfigurationObjectsRequest) message .getObject(); this.adhocService.retrieveConfigurationObjects(messageMetadata, retrieveConfigurationRequest, this.responseMessageSender); } catch (final JMSException exception) { this.logJmsException(LOGGER, exception, messageMetadata); } }
Source:
public GetTapesResult call() throws Exception {try { final GetTapesResponse response = getClient().getTapes(new GetTapesRequest()); return new GetTapesResult(response.getTapes()); } catch (final FailedRequestException e) { throw new CommandException("Failed Get Service", e); } }

Target:
public GetTapesResult call() throws Exception {try { final GetTapesResponse response = getClient().getTapes(new GetTapesRequest()); return new GetTapesResult(response.getTapes()); } catch (final FailedRequestException e) { throw new CommandException("Failed Get Tapes", e); } }
Source:
synchronized void commit(long offset, BigInteger v) { if (!validateOffset((int) offset) || v == null || chceckpoints[(int) offset] == null) { return; } if (offset <= s && offset > c && v.equals(chceckpoints[(int) offset])) { int ggap = (int) Math.min(lagLen, offset - c); if (ggap == lagLen) { c = offset - lagLen + 1; lag[idx(c)] = c; } lag[idx(offset)] = offset; while (ggap > 0 && lag[idx(c)] + 1 == lag[idx(c + 1)]) { ++c; } } }

Target:
synchronized void commit(long offset, BigInteger v) { if (!validateOffset((int) offset) || v == null || chceckpoints[(int) offset] == null) { return; } if (offset <= s && offset > c && v.equals(chceckpoints[(int) offset])) { int ggap = (int) Math.min(lagLen, offset - c); if (ggap == lagLen) { c = offset - lagLen + 1; lag[idx(c)] = c; } lag[idx(offset)] = offset; while (ggap > 0 && lag[idx(c)] + 1 == lag[idx(c + 1)]) { ++c; } if (offer >= 0 && (offer - c) < lag.length) { offer = -1L; notify(); } } }
Source:
public void removePage(int pageIndex) { if (0 > pageIndex || pageIndex >= getChildren().size()) { getChildren().remove(pageIndex); } }

Target:
public void removePage(int pageIndex) { if (0 <= pageIndex && pageIndex < getChildren().size()) { getChildren().remove(pageIndex); } }