auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<K extends Exception> void handleRequest( RetryableCassandraRequest<?, K> req, InetSocketAddress hostTried, Exception ex) throws K { req.incrementNumberOfAttempts(); req.triedOnHost(hostTried); this.handleExceptionInternal(req, hostTried, ex); if (isRetriableWithBackoffException(ex)) { int sleepDuration = req.getNumberOfAttempts() * 1000 + (ThreadLocalRandom.current().nextInt(1000) - 500); log.warn("Retrying a query, {}, with backoff of {}ms, intended for host {}.", UnsafeArg.of("queryString", req.getFunction().toString()), SafeArg.of("sleepDuration", sleepDuration), SafeArg.of("hostName", CassandraLogHelper.host(hostTried))); try { Thread.sleep(sleepDuration); } catch (InterruptedException i) { throw new RuntimeException(i); } if (req.getNumberOfAttempts() >= maxTriesSameHost.get()) { req.giveUpOnPreferredHost(); } } else if (isFastFailoverException(ex)) { log.info("Retrying with fast failover a query intended for host {}.", SafeArg.of("hostName", CassandraLogHelper.host(hostTried))); req.giveUpOnPreferredHost(); } }

Target:
<K extends Exception> void handleRequest( RetryableCassandraRequest<?, K> req, InetSocketAddress hostTried, Exception ex) throws K { req.triedOnHost(hostTried); this.handleExceptionInternal(req, hostTried, ex); if (isRetriableWithBackoffException(ex)) { int sleepDuration = req.getNumberOfAttempts() * 1000 + (ThreadLocalRandom.current().nextInt(1000) - 500); log.info("Retrying a query, {}, with backoff of {}ms, intended for host {}.", UnsafeArg.of("queryString", req.getFunction().toString()), SafeArg.of("sleepDuration", sleepDuration), SafeArg.of("hostName", CassandraLogHelper.host(hostTried))); try { Thread.sleep(sleepDuration); } catch (InterruptedException i) { throw new RuntimeException(i); } if (req.getNumberOfAttempts() >= maxTriesSameHost.get()) { req.giveUpOnPreferredHost(); } } else if (isFastFailoverException(ex)) { log.info("Retrying with fast failover a query intended for host {}.", SafeArg.of("hostName", CassandraLogHelper.host(hostTried))); req.giveUpOnPreferredHost(); } }
Source:
void moveToCatch() throws CommandLineException { if(catchList == null) { catchList = new ArrayList<>(); } switch(state) { case IN_TRY: state = IN_CATCH; break; case IN_CATCH: throw new CommandLineException("Already in catch block. Only one catch block is allowed."); case IN_FINALLY: throw new CommandLineException("Catch block is not allowed in finally"); default: throw new IllegalStateException("Unexpected block id: " + state); } }

Target:
void moveToCatch() throws CommandLineException { switch(state) { case IN_TRY: catchList = new ArrayList<>(); state = IN_CATCH; break; case IN_CATCH: throw new CommandLineException("Already in catch block. Only one catch block is allowed."); case IN_FINALLY: throw new CommandLineException("Catch block is not allowed in finally"); default: throw new IllegalStateException("Unexpected block id: " + state); } }
Source:
public KeyPair generateAndAddKeyPairs() throws NoSuchAlgorithmException { KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA"); keyGen.initialize(1024, new SecureRandom()); return keyGen.generateKeyPair(); }

Target:
private KeyPair generateAndAddKeyPairs() throws NoSuchAlgorithmException { KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA"); keyGen.initialize(1024, new SecureRandom()); return keyGen.generateKeyPair(); }
Source:
public static Predicate<BlockRayHit> blockTypeFilter(final BlockType type) { return new Predicate<BlockRayHit>() { @Override public boolean apply(BlockRayHit lastHit) { return lastHit.getLocation().getType().equals(type); } }; }

Target:
public static Predicate<BlockRayHit> blockTypeFilter(final BlockType type) { return new Predicate<BlockRayHit>() { @Override public boolean apply(BlockRayHit lastHit) { return lastHit.getExtent().getBlockType(lastHit.getBlockX(), lastHit.getBlockY(), lastHit.getBlockZ()).equals(type); } }; }
Source:
private void showSlot(String selector, WebDriver driver) { changeVisibility(selector, "visible", driver); }

Target:
public void showSlot(String selector, WebDriver driver) { changeVisibility(selector, "visible", driver); }
Source:
boolean evaluate(Object principal, Action action, Node graphIRI) throws AuthenticationRequiredException; public boolean evaluate(Object principal, Action action, Node graphIRI, Triple triple) throws AuthenticationRequiredException; public default boolean evaluate(Object principal, Set<Action> actions, Node graphIRI) throws AuthenticationRequiredException { return actions.stream().allMatch(action -> evaluate(principal, action, graphIRI)); }

Target:
public boolean evaluate(Object principal, Action action, Node graphIRI) throws AuthenticationRequiredException; public boolean evaluate(Object principal, Action action, Node graphIRI, Triple triple) throws AuthenticationRequiredException; public default boolean evaluate(Object principal, Set<Action> actions, Node graphIRI) throws AuthenticationRequiredException { return actions.stream().allMatch(action -> evaluate(principal, action, graphIRI)); }
Source:
public Option<QuickOutlinePageDescriptor> getFirstPage() { QuickOutlinePageDescriptor firstPage = null; if (!this.pages.isEmpty()) { firstPage = this.pages.get(0); } return Options.newSome(firstPage); }

Target:
public Option<QuickOutlinePageDescriptor> getFirstPage() { QuickOutlinePageDescriptor firstPage = null; if (!this.pages.isEmpty()) { firstPage = this.pages.get(0); } return Options.fromNullable(firstPage); }
Source:
public void testExpandDims(){ INDArray array = Nd4j.create(2, 3); assertArrayEquals(Nd4j.expandDims(array, 0).shape(), new int[]{1,2,3}); assertArrayEquals(Nd4j.expandDims(array, 1).shape(), new int[]{2,1,3}); assertArrayEquals(Nd4j.expandDims(array, 2).shape(), new int[]{2,3,1}); assertArrayEquals(Nd4j.expandDims(array, -1).shape(), new int[]{2,1,3}); }

Target:
public void testExpandDims(){ final List<Pair<INDArray, String>> testMatricesC = NDArrayCreationUtil.getAllTestMatricesWithShape('c', 3, 5, 0xDEAD); final List<Pair<INDArray, String>> testMatricesF = NDArrayCreationUtil.getAllTestMatricesWithShape('f', 7, 11, 0xBEEF); final ArrayList<Pair<INDArray, String>> testMatrices = new ArrayList<>(testMatricesC); testMatrices.addAll(testMatricesF); for (Pair<INDArray, String> testMatrixPair : testMatrices) { final String recreation = testMatrixPair.getSecond(); final INDArray testMatrix = testMatrixPair.getFirst(); final char ordering = testMatrix.ordering(); final int[] shape = testMatrix.shape(); final int rank = testMatrix.rank(); for (int i = -rank; i <= rank; i++) { final INDArray expanded = Nd4j.expandDims(testMatrix, i); final String message = "Expanding in Dimension " + i + "; Shape before expanding: " + Arrays.toString(shape) + " "+ordering+" Order; Shape after expanding: " + Arrays.toString(expanded.shape()) + " "+expanded.ordering()+"; Input Created via: " + recreation; assertEquals(message, 1, expanded.shape()[i < 0 ? i + rank : i]); assertEquals(message, testMatrix.ravel(), expanded.ravel()); assertEquals(message, ordering, expanded.ordering()); testMatrix.assign(Nd4j.rand(shape)); assertEquals(message, testMatrix.ravel(), expanded.ravel()); } } }
Source:
public void notifyUserOfStreakChange(final RegisteredUserDTO user) { long userId = user.getId(); try { IUserAlert alert = new PgUserAlert(null, userId, objectMapper.writeValueAsString(ImmutableMap.of("streakRecord", this.getCurrentStreakRecord(user))), "progress", new Timestamp(System.currentTimeMillis()), null, null, null); UserAlertsWebSocket.notifyUserOfAlert(userId, alert); } catch (JsonProcessingException e) { e.printStackTrace(); } }

Target:
public void notifyUserOfStreakChange(final RegisteredUserDTO user) { long userId = user.getId(); try { IUserAlert alert = new PgUserAlert(null, userId, objectMapper.writeValueAsString(ImmutableMap.of("streakRecord", this.getCurrentStreakRecord(user))), "progress", new Timestamp(System.currentTimeMillis()), null, null, null); UserAlertsWebSocket.notifyUserOfAlert(userId, alert); } catch (JsonProcessingException e) { log.error(String.format("Unable to serialize user streak change JSON for user {}: {}", user.getId(), e.getMessage())); } }
Source:
public String getLocalNameByStandardVariableId(final Integer projectId, final Integer standardVariableId) throws MiddlewareQueryException { DmsProject dmsProject = new DmsProject(); dmsProject.setProjectId(projectId); ProjectProperty projectProperty = getProjectPropertyDao().getByStandardVariableId(dmsProject, standardVariableId); return (projectProperty == null) ? null : projectProperty.getAlias(); }

Target:
public String getLocalNameByStandardVariableId(final Integer projectId, final Integer standardVariableId) { DmsProject dmsProject = new DmsProject(); dmsProject.setProjectId(projectId); ProjectProperty projectProperty = getProjectPropertyDao().getByStandardVariableId(dmsProject, standardVariableId); return (projectProperty == null) ? null : projectProperty.getAlias(); }
Source:
private void addDefaultContracts() { contracts.add(EqualsTransitive.getInstance()); contracts.add(new EqualsReflexive()); contracts.add(new EqualsSymmetric()); contracts.add(new EqualsHashcode()); contracts.add(new EqualsToNullRetFalse()); }

Target:
private void addDefaultContracts() { contracts.add(new EqualsReflexive()); contracts.add(new EqualsSymmetric()); contracts.add(new EqualsHashcode()); contracts.add(new EqualsToNullRetFalse()); contracts.add(EqualsTransitive.getInstance()); }
Source:
public void testStoreResult() throws IOException, ProtocolException { final IMAPResponse[] content = new IMAPResponse[2]; content[0] = new IMAPResponse("* 1 FETCH (UID 4 MODSEQ (12121231000))"); content[1] = new IMAPResponse("* VANISHED (EARLIER) 41,43:116,118,120:211,214:540"); final List<IMAPResponse> imapResponses = Arrays.asList(content); final MessageNumberSet[] modifiedMsgNums = { new MessageNumberSet(1L, 1L) }; final StoreResult storeResult = new StoreResult(1L, imapResponses, modifiedMsgNums); final long highestModSeq = storeResult.getHighestModSeq(); final List<IMAPResponse> responses = storeResult.getIMAPResponses(); Assert.assertEquals(responses.size(), 2, "Result mismatched."); Assert.assertEquals(highestModSeq, 1L, "Result mismatched."); Assert.assertTrue(responses.get(0).keyEquals("FETCH"), "Result mismatched."); final long fetchedModSeq = new FetchResponse(responses.get(0)).getItem(MODSEQ.class).modseq; Assert.assertEquals(fetchedModSeq, 12121231000L, "Result mismatched."); Assert.assertTrue(responses.get(1).keyEquals("VANISHED"), "Result mismatched."); final String modifiedMsgsets = MessageNumberSet.buildString(storeResult.getModifiedMsgSets()); Assert.assertEquals(storeResult.getModifiedMsgSets().length, 1, "Result mismatched."); Assert.assertEquals(modifiedMsgsets, "1", "Result mismatched."); }

Target:
public void testStoreResult() throws IOException, ProtocolException { final FetchResponse fr = new FetchResponse(new IMAPResponse("* 1 FETCH (UID 4 MODSEQ (12121231000))")); final List<FetchResponse> fetchResponses = Collections.singletonList(fr); final MessageNumberSet[] modifiedMsgSet = { new MessageNumberSet(1L, 1L) }; final StoreResult storeResult = new StoreResult(1L, fetchResponses, modifiedMsgSet); final Long highestModSeq = storeResult.getHighestModSeq(); final List<FetchResponse> responses = storeResult.getFetchResponses(); Assert.assertEquals(responses.size(), 1, "getFetchResponses() mismatched."); Assert.assertNotNull(highestModSeq, "getHighestModSeq() should not return null"); Assert.assertEquals(highestModSeq, Long.valueOf(1L), "getHighestModSeq() mismatched."); final MessageNumberSet[] modifiedMsgsets = storeResult.getModifiedMsgSets(); Assert.assertNotNull(modifiedMsgsets, "getModifiedMsgSets() should not return null."); Assert.assertEquals(modifiedMsgsets.length, 1, "getModifiedMsgSets() size mismatched."); Assert.assertEquals(modifiedMsgsets[0], modifiedMsgSet[0], "getModifiedMsgSets() mismatched."); }
Source:
public Topology getTopology(Map<String, String> options) { return Topology.builder() .addComputation(EvaluateRuleComputation::new, Arrays.asList(INPUT_1 + ":" + ACTION_NAME, OUTPUT_1 + ":" + STATUS_STREAM)) .build(); }

Target:
public Topology getTopology(Map<String, String> options) { return Topology.builder() .addComputation(EvaluateRuleComputation::new, List.of(INPUT_1 + ":" + ACTION_NAME, OUTPUT_1 + ":" + STATUS_STREAM)) .build(); }
Source:
public static String account(String acc) { StringBuilder result = new StringBuilder(100); result.append('\"').append(acc) .append("\":{\"googleId\":\"").append(acc) .append("\",\"name\":\"").append(acc) .append("\",\"email\":\"").append(acc).append("@gmail.com\",\"institute\":\"\"}"); return result.toString(); }

Target:
public static String account(String acc) { return "\"" + acc + "\":{\"googleId\":\"" + acc + "\",\"name\":\"" + acc + "\",\"email\":\"" + acc + "@gmail.com\",\"institute\":\"\"}"; }
Source:
public void setInternal(String key, String value) { ValueEntry valueEntry = map.get(key); if (valueEntry != null) { valueEntry.value = value; } else { valueEntry = new ValueEntry(); valueEntry.scope = isLocalKey(key) ? Scope.LOCAL : Scope.TRANSIENT; map.put(key, valueEntry); } }

Target:
public void setInternal(String key, String value) { ValueEntry valueEntry = map.get(key); if (valueEntry != null) { valueEntry.value = value; } else { valueEntry = new ValueEntry(); valueEntry.scope = isLocalKey(key) ? Scope.LOCAL : Scope.TRANSIENT; valueEntry.value = value; map.put(key, valueEntry); } }
Source:
public static String currentTime() { Calendar calendar = Calendar.getInstance(); return FormatUtil.getTimeZoneFormat().format(calendar.getTime()); }

Target:
public static String currentTime() { Calendar calendar = SystemTime.asCalendar(); return FormatUtil.getTimeZoneFormat().format(calendar.getTime()); }
Source:
public void indexesShouldBeCreated() throws UnknownHostException { String dbName = mongoRule.getRandomTemporaryDatabaseName(); MongoOperations mongoOperations = MongoDBHelper.getDefaultMongoOperations(dbName); DBCollection dbCollection = mongoOperations.getCollection(collectionName); variantMongoWriter = new VariantMongoWriter(collectionName, mongoOperations, variantToMongoDbObjectConverter); Set<String> createdIndexes = dbCollection.getIndexInfo().stream().map(o -> o.get("name").toString()) .collect(Collectors.toSet()); Set<String> expectedIndexes = Sets.newHashSet("annot.xrefs.id_1_background_", "ids_1_background_", "_id_", "files.sid_1_files.fid_1_background_", "chr_1_start_1_end_1_background_", "annot_1_background_"); assertEquals(expectedIndexes, createdIndexes); }

Target:
public void indexesShouldBeCreated() throws UnknownHostException { String dbName = mongoRule.getRandomTemporaryDatabaseName(); MongoOperations mongoOperations = MongoDBHelper.getDefaultMongoOperations(dbName); DBCollection dbCollection = mongoOperations.getCollection(collectionName); variantMongoWriter = new VariantMongoWriter(collectionName, mongoOperations, variantToMongoDbObjectConverter); Set<String> createdIndexes = dbCollection.getIndexInfo().stream().map(o -> o.get("name").toString()) .collect(Collectors.toSet()); Set<String> expectedIndexes = new HashSet<>(); expectedIndexes.addAll(Arrays.asList("annot.xrefs.id_1_background_", "ids_1_background_", "_id_", "files.sid_1_files.fid_1_background_", "chr_1_start_1_end_1_background_", "annot_1_background_")); assertEquals(expectedIndexes, createdIndexes); }
Source:
private Button createCloseButton(Composite composite) { Button closeButton = new Button(composite, SWT.NONE); closeButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); closeButton.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE)); closeButton.addMouseListener(new MouseAdapter() { @Override public void mouseDown(MouseEvent e2) { clearFilter(); close(); } }); return closeButton; }

Target:
private Button createCloseButton(Composite composite) { Button closeButton = new Button(composite, SWT.NONE); closeButton.setToolTipText(Messages.TimeEventFilterDialog_CloseButton); closeButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); closeButton.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE)); closeButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { clearFilter(); close(); } }); return closeButton; }
Source:
public static boolean isUserClosed(String userUid) throws ApiCallException { if (Session.getCredentials() == null || Session.getCredentials().isDemoCredentials()) { return false; } String url = PreferencesState.getInstance().getDhisURL() + "/api/" + TAG_USER + String.format( QUERY_USER_ATTRIBUTES, userUid); url = ServerApiUtils.encodeBlanks(url); Date closedDate = null; Response response = ServerApiCallExecution.executeCall(null, url, "GET"); JsonNode jsonNode = ServerApiUtils.getJsonNodeMappedResponse(ServerApiUtils.getApiResponseAsJSONObject(response)); JsonNode jsonNodeArray = jsonNode.get(ATTRIBUTEVALUES); String closeDateAsString = ""; for (int i = 0; i < jsonNodeArray.size(); i++) { if (jsonNodeArray.get(i).get(ATTRIBUTE).get(CODE).textValue().equals( UserDB.ATTRIBUTE_USER_CLOSE_DATE)) { closeDateAsString = jsonNodeArray.get(i).get(VALUE).textValue(); } } if (closeDateAsString == null || closeDateAsString.equals("")) { return false; } closedDate = Utils.parseStringToCalendar(closeDateAsString, DHIS2_GMT_NEW_DATE_FORMAT).getTime(); if(closedDate == null) { return false; } return closedDate.before(new Date()); }

Target:
public static boolean isUserClosed(String userUid) throws ApiCallException { if (Session.getCredentials() != null && Session.getCredentials().isDemoCredentials()) { return false; } String url = PreferencesState.getInstance().getDhisURL() + "/api/" + TAG_USER + String.format( QUERY_USER_ATTRIBUTES, userUid); url = ServerApiUtils.encodeBlanks(url); Date closedDate = null; Response response = ServerApiCallExecution.executeCall(null, url, "GET"); JsonNode jsonNode = ServerApiUtils.getJsonNodeMappedResponse(ServerApiUtils.getApiResponseAsJSONObject(response)); JsonNode jsonNodeArray = jsonNode.get(ATTRIBUTEVALUES); String closeDateAsString = ""; for (int i = 0; i < jsonNodeArray.size(); i++) { if (jsonNodeArray.get(i).get(ATTRIBUTE).get(CODE).textValue().equals( UserDB.ATTRIBUTE_USER_CLOSE_DATE)) { closeDateAsString = jsonNodeArray.get(i).get(VALUE).textValue(); } } if (closeDateAsString == null || closeDateAsString.equals("")) { return false; } closedDate = Utils.parseStringToCalendar(closeDateAsString, DHIS2_GMT_NEW_DATE_FORMAT).getTime(); if(closedDate == null) { return false; } return closedDate.before(new Date()); }
Source:
protected Map<UUID, Long> collectMessagesCountByNodeId(String metricName) { Map<UUID, Long> res = new HashMap<>(); String mregPrefix = COMMUNICATION_METRICS_GROUP_NAME + MetricUtils.SEPARATOR; for (MetricRegistry mreg : mmgr) { if (mreg.name().startsWith(mregPrefix)) { String nodeIdStr = mreg.name().substring(mregPrefix.length()); try { UUID nodeId = UUID.fromString(nodeIdStr); res.put(nodeId, mreg.<LongMetric>findMetric(metricName).value()); } catch (IllegalArgumentException ignore) { } } } return res; }

Target:
protected Map<UUID, Long> collectMessagesCountByNodeId(String metricName) { Map<UUID, Long> res = new HashMap<>(); String mregPrefix = COMMUNICATION_METRICS_GROUP_NAME + SEPARATOR; for (MetricRegistry mreg : mmgr) { if (mreg.name().startsWith(mregPrefix)) { String nodeIdStr = mreg.name().substring(mregPrefix.length()); UUID nodeId = UUID.fromString(nodeIdStr); res.put(nodeId, mreg.<LongMetric>findMetric(metricName).value()); } } return res; }
Source:
public void testGetId() { byte[] id0 = new UniqueId().getId(); byte[] id1 = new UniqueId().getId(); assertNotEquals(id0, id1); }

Target:
public void testGetId() { UniqueId uniqueId = new UniqueId(); assertNotEquals(uniqueId.getId(), uniqueId.getId()); }
Source:
public String toString() { return "EmbeddedMaxIdleExpirableMetadata{" + "version=" + version() + ", maxIdle=" + maxIdle + '}'; }

Target:
public String toString() { return "EmbeddedMaxIdleExpirableMetadata{" + "version=" + version + ", maxIdle=" + maxIdle + '}'; }
Source:
public static GameObject getEntity(GameObjectDAO data, EntityType type) { switch (type) { case ENEMY_CHARACTER: { BoDCharacter enemy = null; Point2D position = new Point2D(data.x, data.y); switch (data.specialization) { case BLASTER: enemy = new Blaster(data.objectId, position, defaultImages.get(EntityType.ENEMY_CHARACTER)); break; case ROLLER: enemy = new Roller(data.objectId, position, defaultImages.get(EntityType.ENEMY_CHARACTER)); break; case HEAVY: enemy = new Heavy(data.objectId, position, defaultImages.get(EntityType.ENEMY_CHARACTER)); break; default: break; } enemy.setNickname(data.nickname); return enemy; } case BULLET: { return new Bullet(data.objectId, new Point2D(data.x, data.y), data.height, new Vector2(data.velocityX, data.velocityY), data.damage, data.bulletType, (Image) Weapon.getBulletImages().get(data.bulletType), data.ownerId); } default: return null; } }

Target:
public static GameObject getEntity(GameObjectDAO data, EntityType type) { switch (type) { case ENEMY_CHARACTER: { BoDCharacter enemy = null; Point2D position = new Point2D(data.x, data.y); switch (data.specialization) { case BLASTER: enemy = new Blaster(data.objectId, position, defaultImages.get(EntityType.ENEMY_CHARACTER)); break; case ROLLER: enemy = new Roller(data.objectId, position, defaultImages.get(EntityType.ENEMY_CHARACTER)); break; case HEAVY: enemy = new Heavy(data.objectId, position, defaultImages.get(EntityType.ENEMY_CHARACTER)); break; default: return null; } enemy.setNickname(data.nickname); return enemy; } case BULLET: { return new Bullet(data.objectId, new Point2D(data.x, data.y), data.height, new Vector2(data.velocityX, data.velocityY), data.damage, data.bulletType, (Image)Weapon.getBulletImages().get(data.bulletType), data.ownerId); } default: return null; } }
Source:
public KubernetesSlave(PodTemplate template, String nodeDescription, KubernetesCloud cloud, Label label) throws Descriptor.FormException, IOException { super(getSlaveName(template), nodeDescription, template.getRemoteFs(), 1, Node.Mode.NORMAL, label == null ? null : label.toString(), new JNLPLauncher(), new OnceRetentionStrategy(cloud.getRetentionTimeout()), template.getNodeProperties()); this.cloud = cloud; }

Target:
public KubernetesSlave(PodTemplate template, String nodeDescription, KubernetesCloud cloud, Label label) throws Descriptor.FormException, IOException { this(template, nodeDescription, cloud, label.toString(), new OnceRetentionStrategy(cloud.getRetentionTimeout())) ; }
Source:
public void checkAttributeValue(PerunSessionImpl perunSession, Facility facility, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongReferenceAttributeValueException { if(attribute.getValue() == null) return; Integer quotaEnabled = (Integer) attribute.getValue(); if(quotaEnabled > 1 || quotaEnabled < 0) throw new WrongAttributeValueException(attribute, "Attribute has only two possible options for quota: 0 - means not enabled, 1 - means enabled."); }

Target:
public void checkAttributeValue(PerunSessionImpl perunSession, Facility facility, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongReferenceAttributeValueException { if(attribute.getValue() == null) return; Integer quotaEnabled = (Integer) attribute.getValue(); if(quotaEnabled > 1 || quotaEnabled < 0) throw new WrongAttributeValueException(attribute, facility, null, "Attribute has only two possible options for quota: 0 - means not enabled, 1 - means enabled."); }
Source:
DoublesSketchAggregatorFactory(final String name, final String fieldName, final Integer k, final byte cacheTypeId) { if (name == null) { throw new IAE("Must have a valid, non-null aggregator name"); } this.name = name; if (fieldName == null) { throw new IAE("Parameter fieldName must be specified"); } this.fieldName = fieldName; this.k = k == null ? DEFAULT_K : k; Util.checkIfPowerOf2(this.k, "size"); this.cacheTypeId = cacheTypeId; }

Target:
DoublesSketchAggregatorFactory(final String name, final String fieldName, final Integer k, final byte cacheTypeId) { if (name == null) { throw new IAE("Must have a valid, non-null aggregator name"); } this.name = name; if (fieldName == null) { throw new IAE("Parameter fieldName must be specified"); } this.fieldName = fieldName; this.k = k == null ? DEFAULT_K : k; Util.checkIfPowerOf2(this.k, "k"); this.cacheTypeId = cacheTypeId; }
Source:
private boolean verify(HttpServletRequest req, Response rsp) throws IOException { final String hdr = req.getHeader(AUTHORIZATION); if (hdr == null || !hdr.startsWith(LIT_BASIC)) { rsp.sendError(SC_UNAUTHORIZED); return false; } final byte[] decoded = Base64.decodeBase64(hdr.substring(LIT_BASIC.length())); String[] auths = new String(decoded, encoding(req)).split(":"); if(auths.length < 2) { rsp.sendError(SC_UNAUTHORIZED); return false; } String username = auths[0]; String password = auths[1]; final AccountState who = accountCache.getByUsername(username); if (who == null || !who.getAccount().isActive()) { rsp.sendError(SC_UNAUTHORIZED); return false; } AuthRequest whoAuth = getAuthRequest(who, password); if (whoAuth == null) { rsp.sendError(SC_UNAUTHORIZED); return false; } try { AuthResult whoAuthResult = accountManager.authenticate(whoAuth); session.get().setUserAccountId(whoAuthResult.getAccountId(), AuthMethod.PASSWORD); return true; } catch (AccountException e) { rsp.sendError(SC_UNAUTHORIZED); return false; } }

Target:
private boolean verify(HttpServletRequest req, Response rsp) throws IOException { final String hdr = req.getHeader(AUTHORIZATION); if (hdr == null) { return true; } final byte[] decoded = Base64.decodeBase64(hdr.substring(LIT_BASIC.length())); String usernamePassword = new String(decoded, encoding(req)); int splitPos = usernamePassword.indexOf(':'); if (splitPos < 1) { rsp.sendError(SC_UNAUTHORIZED); return false; } String username = usernamePassword.substring(0, splitPos); String password = usernamePassword.substring(splitPos + 1); if (Strings.isNullOrEmpty(password)) { rsp.sendError(SC_UNAUTHORIZED); return false; } final AccountState who = accountCache.getByUsername(username); if (who == null || !who.getAccount().isActive()) { log.warn("Authentication failed for " + username + ": account inactive or not provisioned in Gerrit"); rsp.sendError(SC_UNAUTHORIZED); return false; } AuthRequest whoAuth = AuthRequest.forUser(username); whoAuth.setPassword(password); try { AuthResult whoAuthResult = accountManager.authenticate(whoAuth); session.get().setUserAccountId(whoAuthResult.getAccountId(), AuthMethod.PASSWORD); return true; } catch (AccountException e) { log.warn("Authentication failed for " + username, e); rsp.sendError(SC_UNAUTHORIZED); return false; } }
Source:
public Number getLineMiterLimit() { if (paint.get("line-miter_limit") != null) { return (Number) paint.get("line-miter-limit"); } else { return 2; } }

Target:
public Number getLineMiterLimit() { if (paint.get("line-miter-limit") != null) { return (Number) paint.get("line-miter-limit"); } else { return 2; } }
Source:
private void trackMediaAddedToMediaLibrary(SiteModel selectedSite) { ArrayList<Uri> mediaUrls = new ArrayList<>(); if (countMedia() == 1) { Uri singleMedia = getIntent().getParcelableExtra(Intent.EXTRA_STREAM); mediaUrls.add(singleMedia); } else { ArrayList<Uri> imageUris = getIntent().getParcelableArrayListExtra(Intent.EXTRA_STREAM); mediaUrls.addAll(imageUris); } for (Uri uri : mediaUrls) { String mimeType = getContentResolver().getType(uri); boolean isVideo = mimeType != null && mimeType.startsWith("video"); Map<String, Object> properties = AnalyticsUtils.getMediaProperties(this, isVideo, uri, null); AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.MEDIA_LIBRARY_ADDED_PHOTO, selectedSite, properties); } }

Target:
private void trackMediaAddedToMediaLibrary(SiteModel selectedSite) { ArrayList<Uri> mediaUrls = new ArrayList<>(); if (countMedia() == 1) { Uri singleMedia = getIntent().getParcelableExtra(Intent.EXTRA_STREAM); mediaUrls.add(singleMedia); } else { ArrayList<Uri> imageUris = getIntent().getParcelableArrayListExtra(Intent.EXTRA_STREAM); mediaUrls.addAll(imageUris); } for (Uri uri : mediaUrls) { String mimeType = getContentResolver().getType(uri); boolean isVideo = mimeType != null && mimeType.startsWith("video"); Map<String, Object> properties = AnalyticsUtils.getMediaProperties(this, isVideo, uri, null); AnalyticsTracker.Stat mediaTypeTrack = isVideo ? AnalyticsTracker.Stat.MEDIA_LIBRARY_ADDED_VIDEO : AnalyticsTracker.Stat.MEDIA_LIBRARY_ADDED_PHOTO; AnalyticsUtils.trackWithSiteDetails(mediaTypeTrack, selectedSite, properties); } }
Source:
public void notifyNotEnoughResourcesAvailable(Collection<ResourceRequirement> acquiredResources) { assertRunningInMainThread(); componentMainThreadExecutor.schedule( failPendingRequests(), resourceAcquisitionTimeout.toMillis(), TimeUnit.MILLISECONDS); }

Target:
public void notifyNotEnoughResourcesAvailable(Collection<ResourceRequirement> acquiredResources) { assertRunningInMainThread(); failPendingRequests(); }
Source:
public byte[] encryptBytes(byte[] data) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException, IllegalBlockSizeException, BadPaddingException { Cipher encCipher = Cipher.getInstance(algModePadding); if (this.mode.equals("CBC") || this.mode.equals("OFB") || this.mode.equals("CFB") || this.mode.equals("CTR")) { encCipher.init(Cipher.ENCRYPT_MODE, this.secretKey, new IvParameterSpec(this.initvector)); } else if (this.mode.equals("ECB")) { encCipher.init(Cipher.ENCRYPT_MODE, this.secretKey); } byte[] encryptedData = encCipher.doFinal(data); return encryptedData; }

Target:
public byte[] encryptBytes(byte[] data) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException, IllegalBlockSizeException, BadPaddingException { Cipher encCipher = Cipher.getInstance(algModePadding); if (this.mode.equals(Mode.CBC) || this.mode.equals(Mode.OFB) || this.mode.equals(Mode.CFB) || this.mode.equals(Mode.CTR)) { encCipher.init(Cipher.ENCRYPT_MODE, this.secretKey, new IvParameterSpec(this.initvector)); } else if (this.mode.equals(Mode.ECB)) { encCipher.init(Cipher.ENCRYPT_MODE, this.secretKey); } byte[] encryptedData = encCipher.doFinal(data); return encryptedData; }
Source:
private String formatAnnotations(Collection<? extends Annotation> annos) { StringBuilder sb = new StringBuilder(); for (Annotation tla : annos) { if (!tla.def.name.contains("+")) { sb.append(formatAnnotation(tla)); sb.append(" "); } } return sb.toString(); }

Target:
private static String formatAnnotations(Collection<? extends Annotation> annos) { StringBuilder sb = new StringBuilder(); for (Annotation tla : annos) { if (!isInternalJDKAnnotation(tla.def.name)) { sb.append(formatAnnotation(tla)); sb.append(" "); } } return sb.toString(); }
Source:
public void rebase(final PatchSet.Id patchSetId, final IdentifiedUser uploader) throws NoSuchChangeException, EmailException, OrmException, IOException, InvalidChangeOperationException { final Change.Id changeId = patchSetId.getParentKey(); final ChangeControl changeControl = changeControlFactory.validateFor(changeId, uploader); if (!changeControl.canRebase()) { throw new InvalidChangeOperationException( "Cannot rebase: New patch sets are not allowed to be added to change: " + changeId.toString()); } final Change change = changeControl.getChange(); Repository git = null; RevWalk rw = null; ObjectInserter inserter = null; try { git = gitManager.openRepository(change.getProject()); rw = new RevWalk(git); inserter = git.newObjectInserter(); final String baseRev = findBaseRevision(patchSetId, db.get(), change.getDest(), git, null, null, null); final RevCommit baseCommit = rw.parseCommit(ObjectId.fromString(baseRev)); PersonIdent committerIdent = uploader.newCommitterIdent(myIdent.getWhen(), myIdent.getTimeZone()); rebase(git, rw, inserter, patchSetId, change, uploader, baseCommit, mergeUtilFactory.create( changeControl.getProjectControl().getProjectState(), true), committerIdent, true, true, ValidatePolicy.GERRIT); } catch (PathConflictException e) { throw new IOException(e.getMessage()); } finally { if (inserter != null) { inserter.release(); } if (rw != null) { rw.release(); } if (git != null) { git.close(); } } }

Target:
public void rebase(final PatchSet.Id patchSetId, final IdentifiedUser uploader) throws NoSuchChangeException, EmailException, OrmException, IOException, InvalidChangeOperationException { final Change.Id changeId = patchSetId.getParentKey(); final ChangeControl changeControl = changeControlFactory.validateFor(changeId, uploader); if (!changeControl.canRebase()) { throw new InvalidChangeOperationException( "Cannot rebase: New patch sets are not allowed to be added to change: " + changeId.toString()); } final Change change = changeControl.getChange(); Repository git = null; RevWalk rw = null; ObjectInserter inserter = null; try { git = gitManager.openRepository(change.getProject()); rw = new RevWalk(git); inserter = git.newObjectInserter(); final String baseRev = findBaseRevision(patchSetId, db.get(), change.getDest(), git, null, null, null); final RevCommit baseCommit = rw.parseCommit(ObjectId.fromString(baseRev)); PersonIdent committerIdent = uploader.newCommitterIdent(TimeUtil.nowTs(), myIdent.getTimeZone()); rebase(git, rw, inserter, patchSetId, change, uploader, baseCommit, mergeUtilFactory.create( changeControl.getProjectControl().getProjectState(), true), committerIdent, true, true, ValidatePolicy.GERRIT); } catch (PathConflictException e) { throw new IOException(e.getMessage()); } finally { if (inserter != null) { inserter.release(); } if (rw != null) { rw.release(); } if (git != null) { git.close(); } } }
Source:
default String getDragComponentTitle() { final String componentName = getComponentName(); return componentName == null ? "Unknow" : componentName; }

Target:
public default String getDragComponentTitle() { final String componentName = getComponentName(); return componentName == null ? "Unknown" : componentName; }
Source:
public void train(final Matrix input, final int[] labels) { final int labelRows = getShapeLength(layers[layers.length - 1].getOutputShape()); final int labelCols = labels.length; if (labelMatrix.getRows() != labelRows || labelMatrix.getColumns() != labelCols) { labelMatrix.free(); labelMatrix = matrixFactory.create(labelRows, labelCols); } setOutputMatrix(labelMatrix, labels, labelRows); train(input, labelMatrix); }

Target:
public void train(final Matrix input, final int[] labels) { final int labelRows = getShapeLength(layers[layers.length - 1].getOutputShape()); final int labelCols = labels.length; if (labelMatrix.getColumns() != labelCols) { MatrixUtils.free(labelMatrix); labelMatrix = matrixFactory.create(labelRows, labelCols); } setOutputMatrix(labelMatrix, labels, labelRows); train(input, labelMatrix); }
Source:
private synchronized Map<String, Ref> getRefs(final Repository repo, final String prefix) throws IOException { Map<String, Ref> allRefs = branchRefs.get(repo); if (allRefs == null) { allRefs = repo.getRefDatabase().getRefs(RefDatabase.ALL); branchRefs.put(repo, allRefs); RefsChangedListener listener = new RefsChangedListener() { public void onRefsChanged(RefsChangedEvent event) { synchronized (RepositoriesViewContentProvider.this) { branchRefs.remove(repo); refsChangedListener.remove(); } } }; refsChangedListener = repo.getListenerList().addRefsChangedListener(listener); } if (prefix.equals(RefDatabase.ALL)) return allRefs; Map<String, Ref> filtered = new HashMap<String, Ref>(); for (Map.Entry<String, Ref> entry : allRefs.entrySet()) { if (entry.getKey().startsWith(prefix)) filtered.put(entry.getKey(), entry.getValue()); } return filtered; }

Target:
private synchronized Map<String, Ref> getRefs(final Repository repo, final String prefix) throws IOException { Map<String, Ref> allRefs = branchRefs.get(repo); if (allRefs == null) { allRefs = repo.getRefDatabase().getRefs(RefDatabase.ALL); branchRefs.put(repo, allRefs); if (refsChangedListeners.get(repo) == null) { RefsChangedListener listener = new RefsChangedListener() { public void onRefsChanged(RefsChangedEvent event) { System.out.println("onRefsChanged in " + repo); synchronized (RepositoriesViewContentProvider.this) { branchRefs.remove(repo); } } }; System.out.println("Add onRefsChanges listener to " + repo); refsChangedListeners.put(repo, repo.getListenerList() .addRefsChangedListener(listener)); } } if (prefix.equals(RefDatabase.ALL)) return allRefs; Map<String, Ref> filtered = new HashMap<String, Ref>(); for (Map.Entry<String, Ref> entry : allRefs.entrySet()) { if (entry.getKey().startsWith(prefix)) filtered.put(entry.getKey(), entry.getValue()); } return filtered; }
Source:
public void deleteAllLogsTest() throws Exception { CountDownAsyncJobListener countDownListener = new CountDownAsyncJobListener(1); ((ExecutorServiceImpl) getExecutorService()).addAsyncJobListener(countDownListener); String id = caseService.startCase(DEPLOYMENT_UNIT, LOG_CLEANUP_ID); logger.info("CASE CREATED: {}", id); Thread.sleep(1010); Assertions.assertThat(getCaseFileDataLogSize(LOG_CLEANUP_ID)).isEqualTo(1); Assertions.assertThat(getCaseAssignmentRoleLogSize(LOG_CLEANUP_ID)).isPositive(); scheduleLogCleanup(null, "1s", LOG_CLEANUP_ID); countDownListener.waitTillCompleted(); Assertions.assertThat(getCaseFileDataLogSize(LOG_CLEANUP_ID)).isZero(); Assertions.assertThat(getCaseAssignmentRoleLogSize(LOG_CLEANUP_ID)).isZero(); }

Target:
public void deleteAllLogsTest() throws Exception { CountDownAsyncJobListener countDownListener = new CountDownAsyncJobListener(1); ((ExecutorServiceImpl) getExecutorService()).addAsyncJobListener(countDownListener); String caseIdIncomplete = caseService.startCase(DEPLOYMENT_UNIT, LOG_INCOMPLETE_CLEANUP_ID); logger.info("CASE CREATED: {}", caseIdIncomplete); caseService.cancelCase(caseIdIncomplete); Thread.sleep(1010); Assertions.assertThat(getCaseFileDataLogSize()).isEqualTo(1); Assertions.assertThat(getCaseAssignmentRoleLogSize()).isPositive(); scheduleLogCleanup(null, "1s", Collections.emptyMap()); countDownListener.waitTillCompleted(); Assertions.assertThat(getCaseFileDataLogSize()).isZero(); Assertions.assertThat(getCaseAssignmentRoleLogSize()).isZero(); Assertions.assertThat(getProcessLogSize(LOG_INCOMPLETE_CLEANUP_ID)).isZero(); Assertions.assertThat(getTaskLogSize(LOG_INCOMPLETE_CLEANUP_ID)).isZero(); Assertions.assertThat(getNodeInstanceLogSize(LOG_INCOMPLETE_CLEANUP_ID)).isZero(); Assertions.assertThat(getVariableLogSize(LOG_INCOMPLETE_CLEANUP_ID)).isZero(); }
Source:
protected AssertionType getAssertion(WebServiceContext context, AssertionType assertionIn) { AssertionType assertion; WSAHeaderHelper wsaHelper = new WSAHeaderHelper(); if (assertionIn == null) { assertion = SAML2AssertionExtractor.getInstance().extractSamlAssertion(context); } else { assertion = assertionIn; } if (assertion != null) { if (NullChecker.isNullish(assertion.getMessageId())) { assertion.setMessageId(extractor.getOrCreateAsyncMessageId(context)); } else { assertion.setMessageId(wsaHelper.fixMessageIDPrefix(assertion.getMessageId())); } } if (assertion != null) { List<String> relatesToList = extractor.getAsyncRelatesTo(context); if (NullChecker.isNotNullish(relatesToList)) { assertion.getRelatesToList().add(relatesToList.get(0)); } } try { if (assertion != null && getPropertyAccessor().getPropertyBoolean(NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.READ_HTTP_HEADERS)) { MessageContext messageContext = getMessageContext(context); if (messageContext != null || (messageContext instanceof WrappedMessageContext)) { readHttpHeaders(messageContext, assertion); } } } catch (PropertyAccessException ex) { LOG.warn("Unable to access property for reading HTTP headers.", ex); } return assertion; }

Target:
protected AssertionType getAssertion(WebServiceContext context, AssertionType assertionIn) { AssertionType assertion; WSAHeaderHelper wsaHelper = new WSAHeaderHelper(); if (assertionIn == null) { assertion = SAML2AssertionExtractor.getInstance().extractSamlAssertion(context); } else { assertion = assertionIn; } if (assertion != null) { handleMessageId(assertion, context, wsaHelper); handleRelatesTo(context, assertion); handleHttpHeaders(assertion, context); } return assertion; }
Source:
public static void signIn(User user) throws ValidationException { info("Sign in a User: " + user); openAndFillSignInDialog(user); checkFormValidation(signInPage.getErrorFormElements()); if (signInPage.isSignInDialogOpened()) { info("WARNING: Sign in dialog is still opened after successful validation"); signInPage.clickSubmitButton(); } info("Sign in dialog is closed"); if (!mainPage.userIsLoggedIn()) { LOGGER.error("Could not find username in top right corner: {}", driver.getPageSource()); throw new CouldNotOpenPageException("User does not appear to be logged on: " + user.getUsername()); } }

Target:
public static void signIn(User user) throws ValidationException { info("Sign in a User: " + user); openAndFillSignInDialog(user); checkFormValidation(signInPage.getErrorFormElements()); if (signInPage.isSignInDialogOpened()) { info("WARNING: Sign in dialog is still opened after successful validation. Trying to click submit once again."); signInPage.clickSubmitButton(); checkFormValidation(signInPage.getErrorFormElements()); } else { info("Sign in dialog is closed"); } if (!mainPage.userIsLoggedIn()) { LOGGER.error("Could not find username in top right corner: {}", driver.getPageSource()); throw new CouldNotOpenPageException("User does not appear to be logged on: " + user.getUsername()); } }
Source:
public ObjectTag getContext(String name) { if (name.equals("delay")) { return new ElementTag(event.getToggleDelay()); } else if (name.equals("weapon")) { return new ElementTag(event.getWeaponTitle()); } return super.getContext(name); }

Target:
public ObjectTag getContext(String name) { if (name.equals("delay")) { return new DurationTag(event.getToggleDelay()); } else if (name.equals("weapon")) { return new ElementTag(event.getWeaponTitle()); } return super.getContext(name); }
Source:
public UsersWorkspaceDto startByName(@QueryParam("name") String name, @QueryParam("environment") String envName, @QueryParam("accountId") String accountId) throws ServerException, BadRequestException, NotFoundException, ForbiddenException { final UsersWorkspace workspace = workspaceManager.getWorkspace(name, getCurrentUserId()); ensureUserIsWorkspaceOwner(workspace.getId()); final ImmutableMap<String, String> params = ImmutableMap.of("accountId", accountId, "workspaceId", workspace.getId()); permissionManager.checkPermission(START_WORKSPACE, getCurrentUserId(), params); return injectLinks(DtoConverter.asDto(workspaceManager.startWorkspaceByName(name, envName, getCurrentUserId(), accountId))); }

Target:
public UsersWorkspaceDto startByName(@QueryParam("name") String name, @QueryParam("environment") String envName, @QueryParam("accountId") String accountId) throws ServerException, BadRequestException, NotFoundException, ForbiddenException { final UsersWorkspace workspace = workspaceManager.getWorkspace(name, getCurrentUserId()); ensureUserIsWorkspaceOwner(workspace.getId()); permissionManager.checkPermission(START_WORKSPACE, getCurrentUserId(), ImmutableMap.of("accountId", accountId, "workspaceId", workspace.getId())); return injectLinks(DtoConverter.asDto(workspaceManager.startWorkspaceByName(name, envName, getCurrentUserId(), accountId))); }
Source:
protected void onPause() { super.onPause(); if (null != playerSkinLayoutController) { playerSkinLayoutController.onPause(); } if (null != player) { player.suspend(); } Log.d(TAG, "Player Activity Stopped"); }

Target:
protected void onPause() { super.onPause(); if (null != playerSkinLayoutController) { playerSkinLayoutController.onPause(); } if (null != player) { player.suspend(); } Log.d(TAG, "Player Activity Paused"); }
Source:
public static Uri getOptimizedMedia(Activity activity, SiteModel siteModel, String path, boolean isVideo) { boolean isOptimized = false; if (!NetworkUtils.isWiFiConnected(activity) && !isVideo) { SiteSettingsInterface siteSettings = SiteSettingsInterface.getInterface(activity, siteModel, null); if (siteSettings != null && siteSettings.init(false).getOptimizedImage()) { String optimizedPath = ImageUtils.optimizeImage(activity, path, 3000, 85); if (optimizedPath == null) { AppLog.e(AppLog.T.EDITOR, "Optimized picture was null!"); AnalyticsTracker.track(AnalyticsTracker.Stat.MEDIA_PHOTO_OPTIMIZE_ERROR); } else { AnalyticsTracker.track(AnalyticsTracker.Stat.MEDIA_PHOTO_OPTIMIZED); return Uri.parse(optimizedPath); } } } return null; }

Target:
public static Uri getOptimizedMedia(Activity activity, SiteModel siteModel, String path, boolean isVideo) { if (isVideo || !NetworkUtils.isMobileConnected(activity)) { return null; } SiteSettingsInterface siteSettings = SiteSettingsInterface.getInterface(activity, siteModel, null); if (siteSettings != null && siteSettings.init(false).getOptimizedImage()) { String optimizedPath = ImageUtils.optimizeImage(activity, path, OPTIMIZE_IMAGE_MAX_WIDTH, OPTIMIZE_IMAGE_ENCODER_QUALITY); if (optimizedPath == null) { AppLog.e(AppLog.T.EDITOR, "Optimized picture was null!"); AnalyticsTracker.track(AnalyticsTracker.Stat.MEDIA_PHOTO_OPTIMIZE_ERROR); } else { AnalyticsTracker.track(AnalyticsTracker.Stat.MEDIA_PHOTO_OPTIMIZED); return Uri.parse(optimizedPath); } } return null; }
Source:
public FStatelessNatsServer(Connection conn, FProcessor processor, FProtocolFactory protoFactory, String subject, String queue, int workerCount, int queueLength) { this.conn = conn; this.processor = processor; this.inputProtoFactory = protoFactory; this.outputProtoFactory = protoFactory; this.subject = subject; this.queue = queue; BlockingQueue<Runnable> workQueue = new ArrayBlockingQueue<>(queueLength); this.workerPool = new ThreadPoolExecutor(1, workerCount, 30, TimeUnit.SECONDS, workQueue, new BlockingRejectedExecutionHandler()); }

Target:
private FStatelessNatsServer(Connection conn, FProcessor processor, FProtocolFactory protoFactory, String subject, String queue, int workerCount, int queueLength) { this.conn = conn; this.processor = processor; this.inputProtoFactory = protoFactory; this.outputProtoFactory = protoFactory; this.subject = subject; this.queue = queue; BlockingQueue<Runnable> workQueue = new ArrayBlockingQueue<>(queueLength); this.workerPool = new ThreadPoolExecutor(1, workerCount, 30, TimeUnit.SECONDS, workQueue, new BlockingRejectedExecutionHandler()); }
Source:
public void serializabilityTest() throws Exception { DimensionalTable<Integer> table = createTestTable(); KryoCloneUtils.cloneByKryo(new Kryo(), table); }

Target:
public void serializabilityTest() throws Exception { DimensionalTable<Integer> table = createTestTable(); KryoCloneUtils.cloneObject(table); }
Source:
public StmtSubqueryScan(AbstractParsedStmt subqueryStmt, String tableAlias, int stmtId) { super(tableAlias, stmtId); m_subqueryStmt = subqueryStmt; while (subqueryStmt instanceof ParsedUnionStmt) { assert( ! ((ParsedUnionStmt)subqueryStmt).m_children.isEmpty()); subqueryStmt = ((ParsedUnionStmt)subqueryStmt).m_children.get(0); } assert (subqueryStmt instanceof ParsedSelectStmt); int i = 0; for (ParsedColInfo col: ((ParsedSelectStmt)subqueryStmt).displayColumns()) { String colAlias = col.alias == null? col.columnName : col.alias; SchemaColumn scol = new SchemaColumn(col.tableName, col.tableAlias, col.columnName, col.alias, col.expression, col.differentiator); m_outputColumnList.add(scol); m_outputColumnIndexMap.put(Pair.of(colAlias, col.differentiator), i); i++; } }

Target:
public StmtSubqueryScan(AbstractParsedStmt subqueryStmt, String tableAlias, int stmtId) { super(tableAlias, stmtId); m_subqueryStmt = subqueryStmt; while (subqueryStmt instanceof ParsedUnionStmt) { assert( ! ((ParsedUnionStmt)subqueryStmt).m_children.isEmpty()); subqueryStmt = ((ParsedUnionStmt)subqueryStmt).m_children.get(0); } assert (subqueryStmt instanceof ParsedSelectStmt); int i = 0; for (ParsedColInfo col: ((ParsedSelectStmt)subqueryStmt).displayColumns()) { String colAlias = col.alias == null? col.columnName : col.alias; SchemaColumn scol = col.asSchemaColumn(); m_outputColumnList.add(scol); m_outputColumnIndexMap.put(Pair.of(colAlias, col.differentiator), i); i++; } }