auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public RefactoringParticipant[] loadParticipants(RefactoringStatus status, RefactoringProcessor owner, String[] natures, SharableParticipants shared) { List<RefactoringParticipant> result= new ArrayList<>(); for (IJavaElement iJavaElement : fDelete) { result.addAll(Arrays.asList(ParticipantManager.loadDeleteParticipants(status, owner, iJavaElement, new DeleteArguments(), natures, shared))); } result.addAll(Arrays.asList(getResourceModifications().getParticipants(status, owner, natures, shared))); return result.toArray(new RefactoringParticipant[result.size()]); }

Target:
public RefactoringParticipant[] loadParticipants(RefactoringStatus status, RefactoringProcessor owner, String[] natures, SharableParticipants shared) { List<RefactoringParticipant> result= new ArrayList<>(); for (IJavaElement javaElement : fDelete) { result.addAll(Arrays.asList(ParticipantManager.loadDeleteParticipants(status, owner, javaElement, new DeleteArguments(), natures, shared))); } result.addAll(Arrays.asList(getResourceModifications().getParticipants(status, owner, natures, shared))); return result.toArray(new RefactoringParticipant[result.size()]); }
Source:
public void validate() { if (sheetName.indexOf(".") != -1) { throw new IllegalStateException("Sheet name cannot contain dots (.)"); } if (file.exists() && !overwriteFile) { throw new IllegalStateException("The file already exits and the columns selected do not match"); } }

Target:
public void validate() { if (sheetName.indexOf(".") != -1) { throw new IllegalStateException("Sheet name cannot contain dots (.)"); } if (file.exists() && !overwriteFileIfExists) { throw new IllegalStateException("The file already exists and the columns selected do not match. Please configure the job to overwrite the existing file."); } }
Source:
public long writeTo(int index, WritableByteChannel channel, long relativeOffset, long maxSize) throws IOException { validateIndex(index); long written = 0; BlobReadInfo blobReadInfo = blobReadInfoList.get(index); ByteBuffer outputBuffer; try { if (blobReadInfo.isPrefetched()) { outputBuffer = blobReadInfo.getPrefetchedBuffer(); } else { outputBuffer = blobReadInfo.downloadBlob(cloudDestination); } } catch (CloudStorageException ex) { throw new IOException("Download of cloud blob " + blobReadInfoList.get(index).getBlobId().getID() + " failed"); } logger.trace("Downloaded bytes to the write channel from the cloud blob : {}", written, blobReadInfoList.get(index).getBlobId().getID()); outputBuffer.flip(); return channel.write(outputBuffer); }

Target:
public long writeTo(int index, WritableByteChannel channel, long relativeOffset, long maxSize) throws IOException { validateIndex(index); long written = 0; BlobReadInfo blobReadInfo = blobReadInfoList.get(index); try { if (blobReadInfo.isPrefetched()) { ByteBuffer outputBuffer = blobReadInfo.getPrefetchedBuffer(); outputBuffer.flip(); written = channel.write(outputBuffer); } else { blobReadInfo.downloadBlob(blobStore, Channels.newOutputStream(channel)); written = blobReadInfo.getBlobSize(); } } catch (StoreException ex) { throw new IOException("Download of cloud blob " + blobReadInfoList.get(index).getBlobId().getID() + " failed"); } logger.trace("Downloaded bytes to the write channel from the cloud blob : {}", written, blobReadInfo.getBlobId().getID()); return written; }
Source:
public void testCNAMECachedWhenFullChainInResponse() throws IOException { final String firstName = "firstname.com"; final String secondName = "secondname.com"; final String ipv4Addr = "1.2.3.4"; TestDnsServer dnsServer2 = new TestDnsServer(new RecordStore() { @Override public Set<ResourceRecord> getRecords(QuestionRecord question) { if (question.getDomainName().equals(firstName)) { Set<ResourceRecord> records = new LinkedHashSet<ResourceRecord>(); ResourceRecordModifier rm = new ResourceRecordModifier(); rm.setDnsClass(RecordClass.IN); rm.setDnsName(question.getDomainName()); rm.setDnsTtl(100); rm.setDnsType(RecordType.CNAME); rm.put(DnsAttribute.DOMAIN_NAME, secondName); records.add(rm.getEntry()); rm = new ResourceRecordModifier(); rm.setDnsClass(RecordClass.IN); rm.setDnsName(question.getDomainName()); rm.setDnsTtl(100); rm.setDnsType(RecordType.A); rm.put(DnsAttribute.IP_ADDRESS, ipv4Addr); records.add(rm.getEntry()); return records; } else { return null; } } }); dnsServer2.start(); DnsNameResolver resolver = null; try { DnsNameResolverBuilder builder = newResolver() .resolveCache(NoopDnsCache.INSTANCE) .recursionDesired(true) .maxQueriesPerResolve(16) .nameServerProvider(new SingletonDnsServerAddressStreamProvider(dnsServer2.localAddress())); builder.resolvedAddressTypes(ResolvedAddressTypes.IPV4_PREFERRED); resolver = builder.build(); InetAddress resolvedAddress = resolver.resolve(firstName).syncUninterruptibly().getNow(); assertEquals(ipv4Addr, resolvedAddress.getHostAddress()); assertEquals(firstName, resolvedAddress.getHostName()); resolvedAddress = resolver.resolve(firstName).syncUninterruptibly().getNow(); assertEquals(ipv4Addr, resolvedAddress.getHostAddress()); assertEquals(firstName, resolvedAddress.getHostName()); } finally { dnsServer2.stop(); if (resolver != null) { resolver.close(); } } }

Target:
public void testCNAMECachedWhenFullChainInResponse() throws IOException { testCNAMECachedWhenFullChainInResponse(null); }
Source:
public SystemColumn[] buildColumnList() throws StandardException { return new SystemColumn[]{ SystemColumnImpl.getUUIDColumn(TABLEID, false), SystemColumnImpl.getIdentifierColumn(TABLENAME, false), SystemColumnImpl.getIndicatorColumn(TABLETYPE), SystemColumnImpl.getUUIDColumn(SCHEMAID, false), SystemColumnImpl.getIndicatorColumn(LOCKGRANULARITY), SystemColumnImpl.getIdentifierColumn(VERSION, true), SystemColumnImpl.getColumn(COLSEQUENCE, Types.INTEGER, false), SystemColumnImpl.getColumn(DELIMITED, Types.VARCHAR, true), SystemColumnImpl.getColumn(ESCAPED, Types.VARCHAR, true), SystemColumnImpl.getColumn(LINES, Types.VARCHAR, true), SystemColumnImpl.getColumn(STORED, Types.VARCHAR, true), SystemColumnImpl.getColumn(LOCATION, Types.VARCHAR, true), SystemColumnImpl.getColumn(COMPRESSION, Types.VARCHAR, true), SystemColumnImpl.getColumn(IS_PINNED, Types.BOOLEAN, false), SystemColumnImpl.getColumn(PURGE_DELETED_ROWS, Types.BOOLEAN, false), SystemColumnImpl.getColumn(MIN_RETENTION_PERIOD, Types.BIGINT, false), }; }

Target:
public SystemColumn[] buildColumnList() throws StandardException { return new SystemColumn[]{ SystemColumnImpl.getUUIDColumn(TABLEID, false), SystemColumnImpl.getIdentifierColumn(TABLENAME, false), SystemColumnImpl.getIndicatorColumn(TABLETYPE), SystemColumnImpl.getUUIDColumn(SCHEMAID, false), SystemColumnImpl.getIndicatorColumn(LOCKGRANULARITY), SystemColumnImpl.getIdentifierColumn(VERSION, true), SystemColumnImpl.getColumn(COLSEQUENCE, Types.INTEGER, false), SystemColumnImpl.getColumn(DELIMITED, Types.VARCHAR, true), SystemColumnImpl.getColumn(ESCAPED, Types.VARCHAR, true), SystemColumnImpl.getColumn(LINES, Types.VARCHAR, true), SystemColumnImpl.getColumn(STORED, Types.VARCHAR, true), SystemColumnImpl.getColumn(LOCATION, Types.VARCHAR, true), SystemColumnImpl.getColumn(COMPRESSION, Types.VARCHAR, true), SystemColumnImpl.getColumn(IS_PINNED, Types.BOOLEAN, false), SystemColumnImpl.getColumn(PURGE_DELETED_ROWS, Types.BOOLEAN, false), SystemColumnImpl.getColumn(MIN_RETENTION_PERIOD, Types.BIGINT, true), }; }
Source:
public RawTransaction setupRunTaskWithLocksThrowOnConflict(Iterable<LockRefreshToken> lockTokens) { LockImmutableTimestampResponse immutableTsResponse = timelockService.lockImmutableTimestamp( LockImmutableTimestampRequest.create()); try { LockTokenV2 immutableTsLock = immutableTsResponse.getLock(); long immutableTs = immutableTsResponse.getImmutableTimestamp(); recordImmutableTimestamp(immutableTsResponse.getImmutableTimestamp()); Supplier<Long> startTimestampSupplier = getStartTimestampSupplier(); AdvisoryLockPreCommitCheck advisoryLockCheck = AdvisoryLockPreCommitCheck.forLockServiceLocks(lockTokens, getLockService()); SnapshotTransaction transaction = createTransaction(immutableTs, startTimestampSupplier, immutableTsLock, advisoryLockCheck); return new RawTransaction(transaction, immutableTsLock); } catch (Throwable e) { timelockService.unlock(ImmutableSet.of(immutableTsResponse.getLock())); throw Throwables.rewrapAndThrowUncheckedException(e); } }

Target:
public RawTransaction setupRunTaskWithLocksThrowOnConflict(Iterable<LockRefreshToken> lockTokens) { LockImmutableTimestampResponse immutableTsResponse = timelockService.lockImmutableTimestamp( LockImmutableTimestampRequest.create()); try { LockTokenV2 immutableTsLock = immutableTsResponse.getLock(); long immutableTs = immutableTsResponse.getImmutableTimestamp(); recordImmutableTimestamp(immutableTs); Supplier<Long> startTimestampSupplier = getStartTimestampSupplier(); AdvisoryLockPreCommitCheck advisoryLockCheck = AdvisoryLockPreCommitCheck.forLockServiceLocks(lockTokens, getLockService()); SnapshotTransaction transaction = createTransaction(immutableTs, startTimestampSupplier, immutableTsLock, advisoryLockCheck); return new RawTransaction(transaction, immutableTsLock); } catch (Throwable e) { timelockService.unlock(ImmutableSet.of(immutableTsResponse.getLock())); throw Throwables.rewrapAndThrowUncheckedException(e); } }
Source:
private void exportJson(){ BulkExportServices bulkExportServices = uris -> { List<Object> list = Arrays.asList(uris.toArray()); for(Object i:list) { if(!(urisList.contains(i))) throw new InternalError("urisList does not contain "+i.toString()); urisList.remove(i); } return null; }; StructuredQueryBuilder structuredQueryBuilder = new StructuredQueryBuilder(); structuredQueryBuilder.directory(1,"/example/cookbook/bulkExport/"); QueryBatcher queryBatcher = moveMgr.newQueryBatcher(structuredQueryBuilder.collection("BulkExportWithDataService")) .withBatchSize(3) .withThreadCount(3) .onQueryFailure(batch -> new InternalError("An exception occured in queryBatcher")) .onUrisReady(batch -> bulkExportServices.readJsonDocs(Stream.of(batch.getItems()))); moveMgr.startJob(queryBatcher); queryBatcher.awaitCompletion(); moveMgr.stopJob(queryBatcher); }

Target:
private void exportJson(){ BulkExportServices bulkExportServices = BulkExportServices.on(dbClient); StructuredQueryBuilder structuredQueryBuilder = new StructuredQueryBuilder(); AtomicInteger docCount = new AtomicInteger(); QueryBatcher queryBatcher = moveMgr.newQueryBatcher(structuredQueryBuilder.collection("BulkExportWithDataService")) .withBatchSize(3) .withThreadCount(3) .onQueryFailure(batch -> new InternalError("An exception occured in queryBatcher")) .onUrisReady(batch -> (bulkExportServices.readJsonDocs(Stream.of(batch.getItems()))) .forEach(reader -> { try { BufferedReader br = new BufferedReader(reader); StringBuilder out = new StringBuilder(); String line; while ((line = br.readLine()) != null) { out.append(line); docCount.getAndIncrement(); } System.out.println(out.toString()); reader.close(); } catch (IOException e) { e.printStackTrace(); } })); moveMgr.startJob(queryBatcher); queryBatcher.awaitCompletion(); moveMgr.stopJob(queryBatcher); if(docCount.get()!= count) throw new InternalError("Mismatch between the number of documents written and read from the database."); }
Source:
private void setupNav(InlineHyperlink link, int key, String help, FileInfo info) { if (info != null) { final String url = url(info); link.setTargetHistoryToken(url); link.setTitle(getFileName(info.path())); keys.add(new KeyCommand(0, key, help) { @Override public void onKeyPress(KeyPressEvent event) { Gerrit.display(url); } }); } else { link.setVisible(false); keys.add(new UpToChangeCommand2(patchSetId, 0, key)); } }

Target:
private void setupNav(InlineHyperlink link, int key, String help, FileInfo info) { if (info != null) { final String url = url(info); link.setTargetHistoryToken(url); link.setTitle(getFileName(info.path())); keys.add(new KeyCommand(0, key, help) { @Override public void onKeyPress(KeyPressEvent event) { Gerrit.display(url); } }); } else { link.getElement().getStyle().setVisibility(Visibility.HIDDEN); keys.add(new UpToChangeCommand2(patchSetId, 0, key)); } }
Source:
private String buildURL() { try { final URL parsedUrl = new URL(url); String host = parsedUrl.getHost(); final String[] pieces = host.split("\\."); if (pieces.length > 1) { final String product = pieces[0]; final String domain = joinIgnoreNull(".", pieces[pieces.length - 2], pieces[pieces.length - 1]); String targetRegion = region; String targetEdge = edge; if (pieces.length == 4) { targetRegion = targetRegion != null ? targetRegion : pieces[1]; } else if (pieces.length == 5) { targetEdge = targetEdge != null ? targetEdge : pieces[1]; targetRegion = targetRegion != null ? targetRegion : pieces[2]; } if (targetEdge != null && targetRegion == null) targetRegion = DEFAULT_REGION; host = joinIgnoreNull(".", product, targetEdge, targetRegion, domain); } String getQuery = ""; if( parsedUrl.getQuery() != null ) { getQuery = "?" + parsedUrl.getQuery(); } String getFragment = ""; if( parsedUrl.getRef() != null ) { getFragment = "#" + parsedUrl.getRef(); } String constructedURI = new URI( parsedUrl.getProtocol(), parsedUrl.getUserInfo(), host, parsedUrl.getPort(), parsedUrl.getPath(), null,null).toString() + getQuery + getFragment; return new URI(constructedURI).toString(); } catch (final MalformedURLException | URISyntaxException e) { throw new ApiException("Bad URL: " + url, e); } }

Target:
private String buildURL() { try { final URL parsedUrl = new URL(url); String host = parsedUrl.getHost(); final String[] pieces = host.split("\\."); if (pieces.length > 1) { final String product = pieces[0]; final String domain = joinIgnoreNull(".", pieces[pieces.length - 2], pieces[pieces.length - 1]); String targetRegion = region; String targetEdge = edge; if (pieces.length == 4) { targetRegion = targetRegion != null ? targetRegion : pieces[1]; } else if (pieces.length == 5) { targetEdge = targetEdge != null ? targetEdge : pieces[1]; targetRegion = targetRegion != null ? targetRegion : pieces[2]; } if (targetEdge != null && targetRegion == null) targetRegion = DEFAULT_REGION; host = joinIgnoreNull(".", product, targetEdge, targetRegion, domain); } String urlPort = parsedUrl.getPort() != -1 ? ":" + parsedUrl.getPort() : null; String protocol = parsedUrl.getProtocol() + "://"; String[] pathPieces = parsedUrl.getPath().split("/"); for (int i = 0; i < pathPieces.length; i++) { pathPieces[i] = URLEncoder.encode(pathPieces[i], "UTF-8"); } String encodedPath = Joiner.on("/").join(pathPieces); String query = parsedUrl.getQuery() != null ? "?" + parsedUrl.getQuery() : null; String ref = parsedUrl.getRef() != null ? "#" + parsedUrl.getRef() : null; String credentials = parsedUrl.getUserInfo() != null ? parsedUrl.getUserInfo() + "@" : null; return joinIgnoreNull("", protocol, credentials, host, urlPort, encodedPath, query, ref); } catch (final MalformedURLException | UnsupportedEncodingException e) { throw new ApiException("Bad URL: " + url, e); } }
Source:
public void testDisabledDebugLogPrinting() { Logger logger = createLogger(LogLevel.INFO); String debug = "debug"; logger.debug(debug); assertLastMessageIsNull(); }

Target:
public void testDisabledDebugLogPrinting() { Logger logger = createLogger(LogLevel.INFO); String message = "debug"; logger.debug(message); assertNothingIsLogged(); }
Source:
void test() { MethodDefinedInSupertype i = new MethodOverrideInSubtype(); expectsSibling1(shouldReturnSibling1()); }

Target:
void test() { expectsSibling1(shouldReturnSibling1()); }
Source:
public void testProcessEapMessageResponse() throws Exception { EapCallback eapCallback = new EapCallback() { @Override public void onResponse(byte[] eapMsg) { assertArrayEquals(EAP_SIM_RESPONSE_PACKET, eapMsg); synchronized (mCallbackLock) { assertFalse("Callback has already been fired", mCallbackFired); mCallbackFired = true; mCallbackLock.notifyAll(); } } }; EapResponse eapResponse = new EapResponse(EAP_SIM_RESPONSE_PACKET); when(mMockEapStateMachine.process(eq(EAP_REQUEST_SIM_START_PACKET))) .thenReturn(eapResponse); getEapAuthenticatorWithCallback(eapCallback) .processEapMessage(EAP_REQUEST_SIM_START_PACKET); synchronized (mCallbackLock) { mCallbackLock.wait(TEST_TIMEOUT_MILLIS); assertTrue(mCallbackFired); } verify(mMockEapStateMachine).process(eq(EAP_REQUEST_SIM_START_PACKET)); verifyNoMoreInteractions(mMockEapStateMachine); }

Target:
public void testProcessEapMessageResponse() { EapCallback eapCallback = new EapCallback() { @Override public void onResponse(byte[] eapMsg) { assertArrayEquals(EAP_SIM_RESPONSE_PACKET, eapMsg); assertFalse("Callback has already been fired", mCallbackFired); mCallbackFired = true; } }; EapResponse eapResponse = new EapResponse(EAP_SIM_RESPONSE_PACKET); when(mMockEapStateMachine.process(eq(EAP_REQUEST_SIM_START_PACKET))) .thenReturn(eapResponse); getEapAuthenticatorWithCallback(eapCallback) .processEapMessage(EAP_REQUEST_SIM_START_PACKET); mTestLooper.dispatchAll(); assertTrue("Callback didn't fire", mCallbackFired); verify(mMockEapStateMachine).process(eq(EAP_REQUEST_SIM_START_PACKET)); verifyNoMoreInteractions(mMockEapStateMachine); }
Source:
public ReviewCard(String webUrl) throws CardBuilderException { this.cardType = CardType.REVIEW; webUrl(webUrl); MetaTagModel metaTagModel = MetaTagExtractor.getMetaTags(this.webUrl); review(new ReviewBuilder(metaTagModel).build()); }

Target:
public ReviewCard(String webUrl) throws CardBuilderException { super(webUrl); this.cardType = CardType.REVIEW; review(new ReviewBuilder(this.getMetaTagModel()).build()); }
Source:
private String prepareEntityNamesForMessage(List<String> entityNames) { StringBuilder domainNamesForMessage = new StringBuilder(); for (String domainName : entityNames) { domainNamesForMessage.append(domainName); domainNamesForMessage.append(","); } domainNamesForMessage.deleteCharAt(domainNamesForMessage.length() - 1); return domainNamesForMessage.toString(); }

Target:
private String prepareEntityNamesForMessage(List<String> entityNames) { return StringUtils.join(entityNames, ","); }
Source:
public CompletableFuture<Void> joinGame(Game game, String password) { if (isRunning()) { logger.debug("Game is running, ignoring join request"); return completedFuture(null); } logger.info("Joining game: '{}' ({})", game.getTitle(), game.getId()); stopSearchLadder1v1(); Map<String, Integer> featuredModVersions = game.getFeaturedModVersions(); Set<String> simModUIds = game.getSimMods().keySet(); return modService.getFeaturedMod(game.getFeaturedMod()) .thenCompose(featuredModBean -> updateGameIfNecessary(featuredModBean, null, featuredModVersions, simModUIds)) .thenAccept(aVoid -> { try { modService.enableSimMods(simModUIds); } catch (IOException e) { logger.warn("SimMods were not enabled", e); } }) .thenCompose(aVoid -> downloadMapIfNecessary(game.getMapFolderName())) .thenCompose(aVoid -> fafService.requestJoinGame(game.getId(), password)) .thenAccept(gameLaunchMessage -> { synchronized (currentGame) { game.setPassword(password); currentGame.set(game); } startGame(gameLaunchMessage, null, RatingMode.GLOBAL); }); }

Target:
public CompletableFuture<Void> joinGame(Game game, String password) { if (isRunning()) { logger.debug("Game is running, ignoring join request"); return completedFuture(null); } logger.info("Joining game: '{}' ({})", game.getTitle(), game.getId()); stopSearchLadder1v1(); Map<String, Integer> featuredModVersions = game.getFeaturedModVersions(); Set<String> simModUIds = game.getSimMods().keySet(); return modService.getFeaturedMod(game.getFeaturedMod()) .thenCompose(featuredModBean -> updateGameIfNecessary(featuredModBean, null, featuredModVersions, simModUIds)) .thenAccept(aVoid -> { try { modService.enableSimMods(simModUIds); } catch (IOException e) { logger.warn("SimMods could not be enabled", e); } }) .thenCompose(aVoid -> downloadMapIfNecessary(game.getMapFolderName())) .thenCompose(aVoid -> fafService.requestJoinGame(game.getId(), password)) .thenAccept(gameLaunchMessage -> { synchronized (currentGame) { game.setPassword(password); currentGame.set(game); } startGame(gameLaunchMessage, null, RatingMode.GLOBAL); }); }
Source:
public Predicate<String> provideServerStoppedPredicate(final DimensionDataCloudControlApi api, final ComputeServiceConstants.Timeouts timeouts, final ComputeServiceConstants.PollPeriod pollPeriod) { return retry(new ServerStatus(api.getServerApi(), false, true), timeouts.imageAvailable, pollPeriod.pollInitialPeriod, pollPeriod.pollMaxPeriod); }

Target:
public Predicate<String> provideServerStoppedPredicate(final DimensionDataCloudControlApi api, final ComputeServiceConstants.Timeouts timeouts, final ComputeServiceConstants.PollPeriod pollPeriod) { return retry(new ServerStatus(api.getServerApi(), false, true), timeouts.nodeSuspended, pollPeriod.pollInitialPeriod, pollPeriod.pollMaxPeriod); }
Source:
public void onWebSocketConnect(final Session frontEndSession) { container = ContainerProvider.getWebSocketContainer(); container.setDefaultMaxBinaryMessageBufferSize(Integer.MAX_VALUE); container.setDefaultMaxTextMessageBufferSize(Integer.MAX_VALUE); final ProxyInboundClient backendSocket = new ProxyInboundClient(getMessageCallback()); try { backendSession = container.connectToServer(backendSocket, clientConfig, backend); LOG.onConnectionOpen(backend.toString()); } catch (DeploymentException e) { LOG.connectionFailed(e); throw new RuntimeException(e); } catch (IOException e) { LOG.connectionFailed(e); throw new RuntimeIOException(e); } super.onWebSocketConnect(frontEndSession); this.frontendSession = frontEndSession; }

Target:
public void onWebSocketConnect(final Session frontEndSession) { container = ContainerProvider.getWebSocketContainer(); container.setDefaultMaxTextMessageBufferSize(frontEndSession.getPolicy().getMaxTextMessageBufferSize()); container.setDefaultMaxBinaryMessageBufferSize(frontEndSession.getPolicy().getMaxBinaryMessageBufferSize()); container.setAsyncSendTimeout(frontEndSession.getPolicy().getAsyncWriteTimeout()); container.setDefaultMaxSessionIdleTimeout(frontEndSession.getPolicy().getIdleTimeout()); final ProxyInboundClient backendSocket = new ProxyInboundClient(getMessageCallback()); try { backendSession = container.connectToServer(backendSocket, clientConfig, backend); LOG.onConnectionOpen(backend.toString()); } catch (DeploymentException e) { LOG.connectionFailed(e); throw new RuntimeException(e); } catch (IOException e) { LOG.connectionFailed(e); throw new RuntimeIOException(e); } super.onWebSocketConnect(frontEndSession); this.frontendSession = frontEndSession; }
Source:
protected void registerConfigProvider(ConfigProvider configProvider) { try { permissionConfig = configProvider.getConfigurationObject(PermissionConfig.class); } catch (ConfigurationException e) { log.error("Error occurred while fetching permission configuration.", e); throw new PermissionException("Error occurred while fetching permission configuration.", e); } }

Target:
protected void registerConfigProvider(ConfigProvider configProvider) { try { permissionConfig = configProvider.getConfigurationObject(PermissionConfig.class); } catch (ConfigurationException e) { throw new PermissionException("Error occurred while fetching permission configuration.", e); } }
Source:
private void validateAndNormalizeEventRecord(DatastreamProducerRecord record) { Validate.notNull(record, "null event record."); Validate.notNull(record.getEvents(), "null event payload."); Validate.notNull(record.getCheckpoint(), "null event checkpoint."); for (Pair<byte[], byte[]> event : record.getEvents()) { Validate.notNull(event, "null event"); Validate.notNull(event.getKey(), "null key"); Validate.notNull(event.getValue(), "null payload"); } }

Target:
private void validateAndNormalizeEventRecord(DatastreamProducerRecord record) { Validate.notNull(record, "null event record."); Validate.notNull(record.getEvents(), "null event payload."); Validate.notNull(record.getCheckpoint(), "null event checkpoint."); for (Pair<byte[], byte[]> event : record.getEvents()) { Validate.notNull(event, "null event"); Validate.notNull(event.getKey(), "null key"); Validate.notNull(event.getValue(), "null value"); } }
Source:
public PinotConfiguration clone() { return new PinotConfiguration(ConfigurationUtils.cloneConfiguration(configuration)); }

Target:
public PinotConfiguration clone() { return new PinotConfiguration(configuration); }
Source:
public int update(String table, String key, HashMap<String, ByteIterator> values) { try { MongoCollection<Document> collection = database.getCollection(table); Document query = new Document("_id", key); Document fieldsToSet = new Document(); for (Map.Entry<String, ByteIterator> entry : values.entrySet()) { fieldsToSet.put(entry.getKey(), entry.getValue().toArray()); } Document update = new Document("$set", fieldsToSet); UpdateResult result = collection.updateOne(query, update); if (result.wasAcknowledged() && result.getMatchedCount() == 0) { System.err.println("Nothing updated for key " + key); return StatusCode.ERROR; } return StatusCode.OK; } catch (Exception e) { System.err.println(e.toString()); return StatusCode.ERROR; } }

Target:
public Status update(String table, String key, HashMap<String, ByteIterator> values) { try { MongoCollection<Document> collection = database.getCollection(table); Document query = new Document("_id", key); Document fieldsToSet = new Document(); for (Map.Entry<String, ByteIterator> entry : values.entrySet()) { fieldsToSet.put(entry.getKey(), entry.getValue().toArray()); } Document update = new Document("$set", fieldsToSet); UpdateResult result = collection.updateOne(query, update); if (result.wasAcknowledged() && result.getMatchedCount() == 0) { System.err.println("Nothing updated for key " + key); return Status.NOT_FOUND; } return Status.OK; } catch (Exception e) { System.err.println(e.toString()); return Status.ERROR; } }
Source:
public static JSONObject jsonForPropertyChange(int propertyName, int newState) { String name; switch (propertyName) { case 0: name = "torchOn"; break; case 1: name = "switchCamera"; break; case 2: name = "recognitionMode"; break; case 3: name = "relativeZoom"; break; default: name = ""; break; } JSONObject json = new JSONObject(); try { json.put("name", name); json.put("newState", newState); } catch (JSONException e) { e.printStackTrace(); } return json; }

Target:
public static JSONObject jsonForPropertyChange(int propertyName, int newState) { String name; switch (propertyName) { case PropertyChangeListener.TORCH: name = "torchOn"; break; case PropertyChangeListener.SWITCH_CAMERA: name = "switchCamera"; break; case PropertyChangeListener.RECOGNITION_MODE: name = "recognitionMode"; break; case PropertyChangeListener.RELATIVE_ZOOM: name = "relativeZoom"; break; default: name = ""; break; } JSONObject json = new JSONObject(); try { json.put("name", name); json.put("newState", newState); } catch (JSONException e) { e.printStackTrace(); } return json; }
Source:
public void unsubscribe(String topic, TopicListener<String> topicListener) { if (topic == null) { throw new IllegalArgumentException("topic cannot be null"); } if (topicListener == null) { throw new IllegalArgumentException("topicListener cannot be null"); } String topicPath = makeTopicPath(topic); HelixPropertyListener helixListener = topicListenerToHelixListenerMap.remove(topicListener); helixStore.unsubscribe(topicPath, helixListener); List<TopicListener> topicListeners = topicToListenerMap.get(topic); if (topicListeners != null) { topicListeners.remove(topicListener); } }

Target:
public void unsubscribe(String topic, TopicListener<String> topicListener) { if (topic == null) { throw new IllegalArgumentException("topic cannot be null"); } if (topicListener == null) { throw new IllegalArgumentException("topicListener cannot be null"); } String topicPath = getTopicPath(topic); HelixPropertyListener helixListener = topicListenerToHelixListenerMap.remove(topicListener); helixStore.unsubscribe(topicPath, helixListener); logger.trace("TopicListener={} has been unsubscribed from topic={}", topicListener, topic); }
Source:
private Constraint distanceToPreviousStandstill(ConstraintFactory constraintFactory) { return constraintFactory.from(Visit.class) .penalizeLong("Distance to previous standstill", SimpleLongScore.of(1), Visit::getDistanceFromPreviousStandstill); }

Target:
private Constraint distanceToPreviousStandstill(ConstraintFactory constraintFactory) { return constraintFactory.from(Visit.class) .penalizeLong("Distance to previous standstill", SimpleLongScore.ONE, Visit::getDistanceFromPreviousStandstill); }
Source:
private ITmfTrace put(String path, String name, String typeID) throws TmfTraceException, TmfTraceImportException, InstantiationException, IllegalAccessException { List<TraceTypeHelper> traceTypes = TmfTraceType.selectTraceType(path, typeID); if (traceTypes.isEmpty()) { return null; } TraceTypeHelper helper = traceTypes.get(0); ITmfTrace trace = helper.getTraceClass().newInstance(); org.eclipse.core.runtime.Path ipath = new org.eclipse.core.runtime.Path(path); IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(ipath); trace.initTrace(resource, path, ITmfEvent.class, name, typeID); trace.indexTrace(false); TmfSignalManager.dispatchSignal(new TmfTraceOpenedSignal(this, trace, null)); return trace; }

Target:
private ITmfTrace put(String path, String name, String typeID) throws TmfTraceException, TmfTraceImportException, InstantiationException, IllegalAccessException { List<TraceTypeHelper> traceTypes = TmfTraceType.selectTraceType(path, typeID); if (traceTypes.isEmpty()) { return null; } IResource resource; try { resource = getResource(path); } catch (CoreException e) { Activator.getInstance().logError(e.getMessage(), e); return null; } TraceTypeHelper helper = traceTypes.get(0); ITmfTrace trace = helper.getTraceClass().newInstance(); trace.initTrace(resource, path, ITmfEvent.class, name, typeID); trace.indexTrace(false); TmfSignalManager.dispatchSignal(new TmfTraceOpenedSignal(this, trace, null)); return trace; }
Source:
private Set<TemplateParam> getRequiredParamSet(TemplateDelegateNode delTemplate) { Set<TemplateParam> paramSet = new HashSet<>(); for (TemplateParam param : delTemplate.getParams()) { if (param.isRequired()) { paramSet.add(param); } } return paramSet; }

Target:
private static Set<TemplateParam> getRequiredParamSet(TemplateDelegateNode delTemplate) { Set<TemplateParam> paramSet = new HashSet<>(); for (TemplateParam param : delTemplate.getParams()) { if (param.isRequired()) { paramSet.add(param); } } return paramSet; }
Source:
public Launcher createLauncher(TaskListener listener) { SlaveComputer c = getComputer(); if (c == null) { listener.error("Issue with creating launcher for agent " + name + ". Computer has been disconnected"); return new Launcher.DummyLauncher(listener); } else { Slave node = c.getNode(); if (node != this) { String message = "Issue with creating launcher for agent " + name + ". Computer has been reconnected"; if (LOGGER.isLoggable(Level.WARNING)) { LOGGER.log(Level.WARNING, message, new IllegalStateException("Computer has been reconnected, this Node instance cannot be used anymore")); } return new Launcher.DummyLauncher(listener); } final Channel channel = c.getChannel(); final Boolean isUnix = channel != null ? c.isUnix() : null; if (channel == null || isUnix == null ) { String message = "Issue with creating launcher for agent " + name + ". No remoting channel to the agent OR it has not been fully initialized yet."; listener.error(message); if (LOGGER.isLoggable(Level.WARNING)) { LOGGER.log(Level.WARNING, message + "Probably there is a race condition with Agent reconnection, check other log entries" , new IllegalStateException("Channel is null for the agent " + name)); } return new Launcher.DummyLauncher(listener); } return new RemoteLauncher(listener, channel, isUnix).decorateFor(this); } }

Target:
public Launcher createLauncher(TaskListener listener) { SlaveComputer c = getComputer(); if (c == null) { listener.error("Issue with creating launcher for agent " + name + ". Computer has been disconnected"); return new Launcher.DummyLauncher(listener); } else { Slave node = c.getNode(); if (node != this) { String message = "Issue with creating launcher for agent " + name + ". Computer has been reconnected"; if (LOGGER.isLoggable(Level.WARNING)) { LOGGER.log(Level.WARNING, message, new IllegalStateException("Computer has been reconnected, this Node instance cannot be used anymore")); } return new Launcher.DummyLauncher(listener); } final Channel channel = c.getChannel(); if (channel == null) { reportLauncerCreateError("The agent has not been fully initialized yet", "No remoting channel to the agent OR it has not been fully initialized yet", listener); return new Launcher.DummyLauncher(listener); } if (channel.isClosingOrClosed()) { reportLauncerCreateError("The agent is being disconnected", "Remoting channel is either in the process of closing down or has closed down", listener); return new Launcher.DummyLauncher(listener); } final Boolean isUnix = c.isUnix(); if (isUnix == null) { reportLauncerCreateError("The agent has not been fully initialized yet", "Cannot determing if the agent is a Unix one, the System status request has not completed yet. " + "It is an invalid channel state, please report a bug to Jenkins if you see it.", listener); return new Launcher.DummyLauncher(listener); } return new RemoteLauncher(listener, channel, isUnix).decorateFor(this); } }
Source:
private boolean isEcho(String dsid, short sceneId) { if (structureManager.getDeviceByDSUID(dsid) != null) { dsid = structureManager.getDeviceByDSUID(dsid).getDSID().getValue(); } String echo = dsid + "-" + sceneId; logger.debug(echo); return isEcho(echo); }

Target:
private boolean isEcho(String dsid, short sceneId) { if (structureManager.getDeviceByDSUID(dsid) != null) { dsid = structureManager.getDeviceByDSUID(dsid).getDSID().getValue(); } String echo = dsid + "-" + sceneId; logger.debug("An echo scene event was detected: {}", echo); return isEcho(echo); }
Source:
CompactAllPolicy(StoreConfig storeConfig, Time time) { this.storeConfig = storeConfig; this.time = time; this.messageRetentionTimeInMs = (long) storeConfig.storeDeletedMessageRetentionDays * Time.SecsPerDay * Time.MsPerSec; }

Target:
CompactAllPolicy(StoreConfig storeConfig, Time time) { this.storeConfig = storeConfig; this.time = time; this.messageRetentionTimeInMs = storeConfig.storeDeletedMessageRetentionDays * Time.SecsPerDay * Time.MsPerSec; }
Source:
public void init(String name, Class<? extends ITmfEvent> type) { super.init(name); fType = type; fDataQueue = (fQueueSize > 1) ? new LinkedBlockingQueue<ITmfEvent>(fQueueSize) : new SynchronousQueue<ITmfEvent>(); if (fExecutor != null) { fExecutor.stop(); } fExecutor = new TmfRequestExecutor(); fSignalDepth = 0; fLogData = TmfCoreTracer.isEventTraced(); TmfProviderManager.register(fType, this); }

Target:
public void init(String name, Class<? extends ITmfEvent> type) { super.init(name); fType = type; fDataQueue = (fQueueSize > 1) ? new LinkedBlockingQueue<ITmfEvent>(fQueueSize) : new SynchronousQueue<ITmfEvent>(); fExecutor.init(); fSignalDepth = 0; fLogData = TmfCoreTracer.isEventTraced(); TmfProviderManager.register(fType, this); }
Source:
Iterator<Event> iterator(EventStreamQuery query) { checkNotNull(query); final EntityFilters filters = toEntityFilters(query); final Iterator<EEntity> entities = find(filters, FieldMask.getDefaultInstance()); final Predicate<EEntity> detailedLookupFilter = createEntityFilter(query); final Iterator<EEntity> filtered = filter(entities, detailedLookupFilter); final List<EEntity> mutableList = newArrayList(filtered); sort(mutableList, comparator()); final Iterator<Event> result = Iterators.transform(mutableList.iterator(), getEventFunc()); return result; }

Target:
Iterator<Event> iterator(EventStreamQuery query) { checkNotNull(query); final EntityFilters filters = toEntityFilters(query); final Iterator<EEntity> entities = find(filters, FieldMask.getDefaultInstance()); final Predicate<EEntity> detailedLookupFilter = createEntityFilter(query); final Iterator<EEntity> filtered = filter(entities, detailedLookupFilter); final List<EEntity> entityList = newArrayList(filtered); sort(entityList, comparator()); final Iterator<Event> result = transform(entityList.iterator(), getEvent()); return result; }
Source:
public void setUp() throws Exception { super.setUp(); actionGroup = RandomUtils.instance().pickRandom(ActionGroup.values()); when(getQueryParameters().getActionGroup()).thenReturn(actionGroup); sessionID = RandomUtils.instance().nextString(10); when(getQueryParameters().getSessionId()).thenReturn(sessionID); DbFacade dbFacadeMock = mock(DbFacade.class); EngineSessionDAO engineSessionDAOMock = mock(EngineSessionDAO.class); when(engineSessionDAOMock.save(any(EngineSession.class))).thenReturn(RandomUtils.instance().nextLong()); when(engineSessionDAOMock.remove(any(Long.class))).thenReturn(1); when(engineSessionDAOMock.remove(any(Long.class))).thenReturn(1); when(dbFacadeMock.getEngineSessionDao()).thenReturn(engineSessionDAOMock); PermissionDAO permissionsDAOMock = mock(PermissionDAO.class); when(permissionsDAOMock.getAllForEntity(any(Guid.class), any(Guid.class), any(Boolean.class))).thenReturn(new ArrayList<Permissions>()); when(dbFacadeMock.getPermissionDao()).thenReturn(permissionsDAOMock); SessionDataContainer.getInstance().setDbFacade(dbFacadeMock); SessionDataContainer.getInstance().setUser(sessionID, getUser()); }

Target:
public void setUp() throws Exception { super.setUp(); actionGroup = RandomUtils.instance().pickRandom(ActionGroup.values()); when(getQueryParameters().getActionGroup()).thenReturn(actionGroup); sessionID = RandomUtils.instance().nextString(10); when(getQueryParameters().getSessionId()).thenReturn(sessionID); DbFacade dbFacadeMock = mock(DbFacade.class); EngineSessionDAO engineSessionDAOMock = mock(EngineSessionDAO.class); when(engineSessionDAOMock.save(any(EngineSession.class))).thenReturn(RandomUtils.instance().nextLong()); when(engineSessionDAOMock.remove(any(Long.class))).thenReturn(1); when(dbFacadeMock.getEngineSessionDao()).thenReturn(engineSessionDAOMock); PermissionDAO permissionsDAOMock = mock(PermissionDAO.class); when(permissionsDAOMock.getAllForEntity(any(Guid.class), any(Guid.class), any(Boolean.class))).thenReturn(new ArrayList<Permissions>()); when(dbFacadeMock.getPermissionDao()).thenReturn(permissionsDAOMock); SessionDataContainer.getInstance().setDbFacade(dbFacadeMock); SessionDataContainer.getInstance().setUser(sessionID, getUser()); }
Source:
public void setUp() throws Exception { BUNDLE_DIR = new File(TEST_PLUGIN_BUNDLE_PATH); monitor = mock(DefaultPluginJarLocationMonitor.class); registry = mock(DefaultPluginRegistry.class); goPluginOSGiFramework = mock(GoPluginOSGiFramework.class); jarChangeListener = mock(DefaultPluginJarChangeListener.class); systemEnvironment = mock(SystemEnvironment.class); when(systemEnvironment.get(PLUGIN_BUNDLE_PATH)).thenReturn(TEST_PLUGIN_BUNDLE_PATH); when(systemEnvironment.get(PLUGIN_FRAMEWORK_ENABLED)).thenReturn(Boolean.TRUE); applicationAccessor = mock(GoApplicationAccessor.class); }

Target:
public void setUp() throws Exception { BUNDLE_DIR = new File(TEST_PLUGIN_BUNDLE_PATH); monitor = mock(DefaultPluginJarLocationMonitor.class); registry = mock(DefaultPluginRegistry.class); goPluginOSGiFramework = mock(GoPluginOSGiFramework.class); jarChangeListener = mock(DefaultPluginJarChangeListener.class); systemEnvironment = mock(SystemEnvironment.class); applicationAccessor = mock(GoApplicationAccessor.class); when(systemEnvironment.get(PLUGIN_BUNDLE_PATH)).thenReturn(TEST_PLUGIN_BUNDLE_PATH); when(systemEnvironment.get(PLUGIN_FRAMEWORK_ENABLED)).thenReturn(Boolean.TRUE); }
Source:
public Object[][] identifyContaminantTestDataProvider() { final Path NA12878_fingerprint = Paths.get(TEST_DATA_DIR.getAbsolutePath(), "NA12878_chr1_fingerprint.vcf"); final Path NA24385_fingerprint = Paths.get(TEST_DATA_DIR.getAbsolutePath(), "NA24385_chr1_fingerprint.vcf"); final Path NA12878_contaminated_by_NA24358 = Paths.get(TEST_DATA_DIR.getAbsolutePath(), "NA12878_contaminated_with_NA24385_at_10_pct_chr1_fingerprint_sites.bam"); final Path NA24385_contaminated_by_NA12878 = Paths.get(TEST_DATA_DIR.getAbsolutePath(), "NA24385_contaminated_with_NA12878_at_8_percent_chr1_fingerprint_sites.bam"); return new Object[][] { {NA12878_contaminated_by_NA24358, NA12878_fingerprint, NA24385_fingerprint, .1}, {NA24385_contaminated_by_NA12878, NA24385_fingerprint, NA12878_fingerprint, .08} }; }

Target:
public Object[][] identifyContaminantTestDataProvider() { final Path NA12878_fingerprint = TEST_DATA_DIR.toPath().resolve("NA12878_chr1_fingerprint.vcf"); final Path NA24385_fingerprint = TEST_DATA_DIR.toPath().resolve("NA24385_chr1_fingerprint.vcf"); final Path NA12878_contaminated_by_NA24358 = TEST_DATA_DIR.toPath().resolve("NA12878_contaminated_with_NA24385_at_10_pct_chr1_fingerprint_sites.bam"); final Path NA24385_contaminated_by_NA12878 = TEST_DATA_DIR.toPath().resolve("NA24385_contaminated_with_NA12878_at_8_percent_chr1_fingerprint_sites.bam"); return new Object[][] { {NA12878_contaminated_by_NA24358, NA12878_fingerprint, NA24385_fingerprint, .1}, {NA24385_contaminated_by_NA12878, NA24385_fingerprint, NA12878_fingerprint, .08} }; }
Source:
protected void executeCommand() { GlusterVolumeSnapshotSchedule fetchedSchedule = getGlusterVolumeSnapshotScheduleDao().getByVolumeId(volumeId); String jobId = fetchedSchedule.getJobId(); SchedulerUtil scheduler = DBSchedulerUtilQuartzImpl.getInstance(); scheduler.deleteJob(jobId); if (schedule.getRecurrence() != null) { String cronExpression = GlusterUtil.getInstance().getCronExpression(schedule); String newJobId = scheduler.scheduleACronJob(new GlusterSnapshotScheduleJob(), "onTimer", new Class[] { String.class, String.class, String.class, String.class, Boolean.class }, new Object[] { upServer.getId().toString(), volumeId.toString(), schedule.getSnapshotNamePrefix(), schedule.getSnapshotDescription(), force }, cronExpression); if (newJobId != null) { setSucceeded(true); schedule.setJobId(newJobId); getGlusterVolumeSnapshotScheduleDao().updateScheduleByVolumeId(volumeId, schedule); } } else { getGlusterVolumeSnapshotScheduleDao().removeByVolumeId(volumeId); setSucceeded(true); } }

Target:
protected void executeCommand() { GlusterVolumeSnapshotSchedule fetchedSchedule = getGlusterVolumeSnapshotScheduleDao().getByVolumeId(volumeId); String jobId = fetchedSchedule.getJobId(); SchedulerUtil scheduler = DBSchedulerUtilQuartzImpl.getInstance(); scheduler.deleteJob(jobId); if (schedule.getRecurrence() != null) { Time originalExecutionTime = schedule.getExecutionTime(); if (schedule.getExecutionTime() != null) { Time convertedTime = GlusterUtil.getInstance().convertTime(schedule.getExecutionTime(), schedule.getTimeZone()); schedule.setExecutionTime(convertedTime); } String cronExpression = GlusterUtil.getInstance().getCronExpression(schedule); String newJobId = scheduler.scheduleACronJob(new GlusterSnapshotScheduleJob(), "onTimer", new Class[] { String.class, String.class, String.class, String.class, Boolean.class }, new Object[] { upServer.getId().toString(), volumeId.toString(), schedule.getSnapshotNamePrefix(), schedule.getSnapshotDescription(), force }, cronExpression, schedule.getStartDate(), schedule.getEndByDate()); if (newJobId != null) { setSucceeded(true); schedule.setJobId(newJobId); schedule.setExecutionTime(originalExecutionTime); getGlusterVolumeSnapshotScheduleDao().updateScheduleByVolumeId(volumeId, schedule); } } else { getGlusterVolumeSnapshotScheduleDao().removeByVolumeId(volumeId); setSucceeded(true); } }
Source:
public PrintWriter format(String format, Object ... args) { try { synchronized (lock) { ensureOpen(); if ((formatter == null) || (formatter.locale() != Locale.getDefault())) formatter = new Formatter(this); formatter.format(Locale.getDefault(), format, args); if (autoFlush) out.flush(); } } catch (InterruptedIOException x) { Thread.currentThread().interrupt(); } catch (IOException x) { trouble = true; } return this; }

Target:
public PrintWriter format(String format, Object ... args) { try { synchronized (lock) { ensureOpen(); if ((formatter == null) || (formatter.locale() != Locale.getDefault())) formatter = new Formatter(WeakProxy.forObject(this)); formatter.format(Locale.getDefault(), format, args); if (autoFlush) out.flush(); } } catch (InterruptedIOException x) { Thread.currentThread().interrupt(); } catch (IOException x) { trouble = true; } return this; }
Source:
public void afterShortExpirationEntryShouldBeAway() throws InterruptedException { final String KEY = "key"; Config hConfig = new Config().setInstanceName("instance") .addMapConfig(new MapConfig().setName("test") .setMaxSizeConfig(new MaxSizeConfig(200, MaxSizeConfig.MaxSizePolicy.FREE_HEAP_SIZE)) .setTimeToLiveSeconds(20)); final HazelcastInstance node = Hazelcast.newHazelcastInstance(hConfig); try { IMap map = node.getMap("test"); map.put(KEY, "value", 1, TimeUnit.SECONDS); map.lock(KEY); Object object = map.get(KEY); map.unlock(KEY); assertNotNull(object); Thread.sleep(1200); map.lock(KEY); object = map.get(KEY); map.unlock(KEY); assertNull(object); } finally { node.shutdown(); } }

Target:
public void afterShortExpirationEntryShouldBeAway() throws InterruptedException { final String KEY = "key"; Config hConfig = new Config().setInstanceName("instance") .addMapConfig(new MapConfig().setName("test") .setMaxSizeConfig(new MaxSizeConfig(200, MaxSizeConfig.MaxSizePolicy.FREE_HEAP_SIZE)) .setTimeToLiveSeconds(20)); final HazelcastInstance node = createHazelcastInstance(hConfig); try { IMap<String, String> map = node.getMap("test"); map.put(KEY, "value", 1, TimeUnit.SECONDS); map.lock(KEY); Object object = map.get(KEY); map.unlock(KEY); assertNotNull(object); Thread.sleep(1200); map.lock(KEY); object = map.get(KEY); map.unlock(KEY); assertNull(object); } finally { node.shutdown(); } }
Source:
public String getDefaultExtension() { return "pro"; }

Target:
public String getDefaultExtension() { return EXT_PRO; }
Source:
private void checkRequirementForRemovedTransparency(Surveillance surv, SurveillanceRequirement req) { if (req.getType() != null && !StringUtils.isEmpty(req.getType().getName()) && req.getType().getName().equalsIgnoreCase(SurveillanceRequirementType.TRANS_DISCLOSURE_REQ)) { String requirement = req.getRequirement(); if (requirement != null && requirement.equalsIgnoreCase("170.523 (k)(2)")) { surv.getErrorMessages().add( msgUtil.getMessage("surveillance.requirementNotAddedForRemovedRequirement", req.getRequirement())); } } }

Target:
private void checkRequirementForRemovedTransparency(Surveillance surv, SurveillanceRequirement req) { if (req.getType() != null && !StringUtils.isEmpty(req.getType().getName()) && req.getType().getName().equalsIgnoreCase(SurveillanceRequirementType.TRANS_DISCLOSURE_REQ)) { String requirement = req.getRequirement(); if (requirement != null && requirement.equalsIgnoreCase(RequirementTypeEnum.K2.getName())) { surv.getErrorMessages().add( msgUtil.getMessage("surveillance.requirementNotAddedForRemovedRequirement", req.getRequirement())); } } }