auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public String build(StorageAccountParameters storageAccountParameters) { try { Map<String, Object> model = new HashMap<>(); model.put("storageAccountName", storageAccountParameters.getStorageAccountName()); model.put("location", storageAccountParameters.getStorageLocation()); model.put("skuName", storageAccountParameters.getStorageAccountSkuType().name().toString()); model.put("encrypted", storageAccountParameters.getEncrypted()); model.put("userDefinedTags", storageAccountParameters.getTags()); String generatedTemplate = freeMarkerTemplateUtils.processTemplateIntoString(getTemplate(), model); LOGGER.info("Generated stroage account Arm template: {}", generatedTemplate); return generatedTemplate; } catch (IOException | TemplateException e) { throw new CloudConnectorException("Failed to process the storage account ARM Template", e); } }

Target:
public String build(StorageAccountParameters storageAccountParameters) { try { Map<String, Object> model = new HashMap<>(); model.put("storageAccountName", storageAccountParameters.getStorageAccountName()); model.put("location", storageAccountParameters.getStorageLocation()); model.put("skuName", storageAccountParameters.getStorageAccountSkuType().name().toString()); model.put("encrypted", storageAccountParameters.getEncrypted()); model.put("userDefinedTags", storageAccountParameters.getTags()); String generatedTemplate = freeMarkerTemplateUtils.processTemplateIntoString(azureStorageAccoutTemplateProviderService.getTemplate(), model); LOGGER.info("Generated storage account Arm template: {}", generatedTemplate); return generatedTemplate; } catch (IOException | TemplateException e) { throw new CloudConnectorException("Failed to process the storage account ARM Template", e); } }
Source:
public ApiAuthenticationResult authenticate(HttpServletRequest httpServletRequest) { Assert.notNull(httpServletRequest, "httpRequest argument cannot be null."); Assert.isInstanceOf(javax.servlet.http.HttpServletRequest.class, httpServletRequest, "The specified httpRequest argument must be an instance of " + HTTP_SERVLET_REQUEST_FQCN); com.stormpath.sdk.impl.http.ServletHttpRequest stmpHttpRequest = new com.stormpath.sdk.impl.http.ServletHttpRequest(httpServletRequest); return (ApiAuthenticationResult) Applications.apiRequestAuthenticator(application).authenticate(stmpHttpRequest); }

Target:
public ApiAuthenticationResult authenticate(HttpServletRequest httpServletRequest) { Assert.notNull(httpServletRequest, "httpRequest argument cannot be null."); Assert.isInstanceOf(javax.servlet.http.HttpServletRequest.class, httpServletRequest, "The specified httpRequest argument must be an instance of " + HTTP_SERVLET_REQUEST_FQCN); com.stormpath.sdk.impl.http.ServletHttpRequest stmpHttpRequest = new com.stormpath.sdk.impl.http.ServletHttpRequest(httpServletRequest); return Applications.apiRequestAuthenticator(application).authenticate(stmpHttpRequest); }
Source:
public static List<Integer> expandVlanUri(final String vlanAuthority) { final List<Integer> expandedVlans = new ArrayList<>(); if (vlanAuthority == null || vlanAuthority.isEmpty()) { return expandedVlans; } for (final String vlanPart: vlanAuthority.split(",")) { if (vlanPart == null || vlanPart.isEmpty()) { continue; } final String[] range = vlanPart.split("-"); if (range.length == 2) { Integer start = NumbersUtil.parseInt(range[0], -1); Integer end = NumbersUtil.parseInt(range[1], -1); if (start <= end && end > -1 && start > -1) { while (start <= end) { expandedVlans.add(start++); } } } else { final Integer value = NumbersUtil.parseInt(range[0], -1); if (value > -1) { expandedVlans.add(value); } } } return expandedVlans; }

Target:
public static List<Integer> expandVlanUri(final String vlanAuthority) { final List<Integer> expandedVlans = new ArrayList<>(); if (Strings.isNullOrEmpty(vlanAuthority)) { return expandedVlans; } for (final String vlanPart: vlanAuthority.split(",")) { if (Strings.isNullOrEmpty(vlanPart)) { continue; } final String[] range = vlanPart.split("-"); if (range.length == 2) { Integer start = NumbersUtil.parseInt(range[0], -1); Integer end = NumbersUtil.parseInt(range[1], -1); if (start <= end && end > -1 && start > -1) { while (start <= end) { expandedVlans.add(start++); } } } else { final Integer value = NumbersUtil.parseInt(range[0], -1); if (value > -1) { expandedVlans.add(value); } } } return expandedVlans; }
Source:
private boolean validteHostsNumaCompatiblity(final Guid srcHost, final Guid destHost, final List<String> errMsgList){ List<Guid> srcHostList = new LinkedList<Guid>(){{add(srcHost);}}; List<Guid> destHostList = new LinkedList<Guid>(){{add(destHost);}}; return validator.areHostListsNumaCompatible(srcHostList, destHostList, errMsgList); }

Target:
private void validteHostsNumaCompatiblity(final Guid srcHost, final Guid destHost, final List<String> errMsgList){ assertTrue(hostsNumaCompatiblity(srcHost, destHost, errMsgList)); }
Source:
private void init () { short[] indices = new short[] { 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7, 0, 8, 1, 8, 2, 8, 3, 8, 9, 10, 11, 12, 13, 14, 15, 16, 8, 17, 17, 18, 19, 2, 2, 3, 3, 19}; int maxVertices = 20; mesh = new Mesh(false, maxVertices, indices.length, new VertexAttribute(Usage.Position, 3, "a_position"), new VertexAttribute( Usage.ColorUnpacked, 4, "a_color")); vertices = new float[maxVertices * (mesh.getVertexSize() / 4)]; mesh.setIndices(indices, 0, indices.length); }

Target:
private void init () { short[] indices = new short[] { 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7, 0, 8, 1, 8, 2, 8, 3, 8, 9, 10, 11, 12, 13, 14, 15, 16, 8, 17, 17, 18, 19, 2, 2, 3, 3, 19}; int maxVertices = 20; mesh = new Mesh(false, maxVertices, indices.length, new VertexAttribute(Usage.Position, 3, "a_position"), new VertexAttribute(Usage.ColorPacked, 4, "a_color")); mesh.setIndices(indices, 0, indices.length); vertices = new float[maxVertices * (mesh.getVertexSize() / 4)]; renderable.meshPart.mesh = mesh; renderable.meshPart.offset = 0; renderable.meshPart.size = mesh.getNumIndices(); renderable.meshPart.primitiveType = GL20.GL_LINES; renderable.material = new Material(); }
Source:
public void doAfterTest() throws Exception { getGDBLaunch().terminate(); fBreakpointService = null; fTraceService = null; fBreakpointsDmc = null; fTraceTargetDmc = null; if (fServicesTracker != null) { fServicesTracker.dispose(); fServicesTracker = null; } super.doAfterTest(); }

Target:
public void doAfterTest() throws Exception { super.doAfterTest(); fBreakpointService = null; fTraceService = null; fBreakpointsDmc = null; fTraceTargetDmc = null; if (fServicesTracker != null) { fServicesTracker.dispose(); fServicesTracker = null; } }
Source:
public void updateParticipantTransfersSubstudyIdsForAdmins() { Set<String> substudies = ImmutableSet.of("substudyA", "substudyB"); StudyParticipant participant = mockSubstudiesInRequest(substudies, substudies, Roles.ADMIN); mockHealthCodeAndAccountRetrieval(); account.getAccountSubstudies().add(AccountSubstudy.create(STUDY.getIdentifier(), "substudyC", ID)); account.getAccountSubstudies().add(AccountSubstudy.create(STUDY.getIdentifier(), "substudyA", ID)); participantService.updateParticipant(STUDY, participant); verify(accountDao).updateAccount(accountCaptor.capture(), any()); Set<AccountSubstudy> accountSubstudies = accountCaptor.getValue().getAccountSubstudies(); assertEquals(2, accountSubstudies.size()); accountSubstudies.stream() .filter((as) -> as.getSubstudyId().equals("substudyA")).findAny().get(); accountSubstudies.stream() .filter((as) -> as.getSubstudyId().equals("substudyB")).findAny().get(); }

Target:
public void updateParticipantTransfersSubstudyIdsForAdmins() { Set<String> substudies = ImmutableSet.of("substudyA", "substudyB"); StudyParticipant participant = mockSubstudiesInRequest(substudies, substudies, Roles.ADMIN); mockHealthCodeAndAccountRetrieval(); account.getAccountSubstudies().add(AccountSubstudy.create(STUDY.getIdentifier(), "substudyC", ID)); account.getAccountSubstudies().add(AccountSubstudy.create(STUDY.getIdentifier(), "substudyA", ID)); participantService.updateParticipant(STUDY, participant); verify(accountDao).updateAccount(accountCaptor.capture(), eq(null)); Set<AccountSubstudy> accountSubstudies = accountCaptor.getValue().getAccountSubstudies(); assertEquals(2, accountSubstudies.size()); accountSubstudies.stream() .filter((as) -> as.getSubstudyId().equals("substudyA")).findAny().get(); accountSubstudies.stream() .filter((as) -> as.getSubstudyId().equals("substudyB")).findAny().get(); }
Source:
public void setExpiryPolicy(Set<? extends K> keys, ExpiryPolicy expiryPolicy) { ensureOpen(); validateNotNull(keys); validateNotNull(expiryPolicy); try { int partitionCount = partitionService.getPartitionCount(); List<Data>[] keysPerPartition = groupDataToPartitions(keys, partitionCount); setTTLAllPartitionsAndWaitForCompletion(keysPerPartition, serializationService.toData(expiryPolicy)); } catch (Exception e) { rethrow(e); } }

Target:
public void setExpiryPolicy(Set<? extends K> keys, ExpiryPolicy expiryPolicy) { if (isClusterVersionLessThan(Versions.V3_11)) { throw new UnsupportedOperationException("setExpiryPolicy operation is available" + "when cluster version is 3.11 or higher"); } ensureOpen(); validateNotNull(keys); validateNotNull(expiryPolicy); try { int partitionCount = partitionService.getPartitionCount(); List<Data>[] keysPerPartition = groupDataToPartitions(keys, partitionCount); setTTLAllPartitionsAndWaitForCompletion(keysPerPartition, serializationService.toData(expiryPolicy)); } catch (Exception e) { rethrow(e); } }
Source:
private void setClusterProperties() { tearDownMiniClusterAsync(1); clientProps.put(QueryServices.IS_NAMESPACE_MAPPING_ENABLED, Boolean.toString(true)); clientProps.put(QueryServices.IS_SYSTEM_TABLE_MAPPED_TO_NAMESPACE, Boolean.toString(true)); serverProps.putAll(clientProps); clientProps.put(QueryServices.INDEX_REGION_OBSERVER_ENABLED_ATTRIB, Boolean.toString(!upgrade)); }

Target:
private void setClusterProperties() { if (Boolean.toString(upgrade).equals(clientProps .get(QueryServices.INDEX_REGION_OBSERVER_ENABLED_ATTRIB)) || Boolean.toString(!isNamespaceEnabled).equals(serverProps .get(QueryServices.IS_NAMESPACE_MAPPING_ENABLED))) { tearDownMiniClusterAsync(1); } clientProps.put(QueryServices.IS_NAMESPACE_MAPPING_ENABLED, Boolean.toString(isNamespaceEnabled)); clientProps.put(QueryServices.IS_SYSTEM_TABLE_MAPPED_TO_NAMESPACE, Boolean.toString(isNamespaceEnabled)); serverProps.putAll(clientProps); clientProps.put(QueryServices.INDEX_REGION_OBSERVER_ENABLED_ATTRIB, Boolean.toString(!upgrade)); }
Source:
public void testTimeoutsConfigured() throws Exception { final DatabaseEngine de = DatabaseFactory.getConnection(this.dbProps); int loginTimeoutInSeconds = DriverManager.getLoginTimeout(); int socketConnectionTimeoutInMs = de.getConnection().getNetworkTimeout(); int checkConnectionTimeoutInMs = de.getProperties().getCheckConnectionTimeout(); assertEquals("Is the login timeout of the DB connection the expected?", LOGIN_TIMEOUT_SECONDS, loginTimeoutInSeconds); assertEquals("Is the socket timeout of the DB connection the expected?", TimeUnit.SECONDS.toMillis(SOCKET_TIMEOUT_SECONDS), socketConnectionTimeoutInMs); assertEquals("Is the check connection timeout of the DB connection the expected?", TimeUnit.SECONDS.toSeconds(CHECK_CONNECTION_TIMEOUT_SECONDS), checkConnectionTimeoutInMs); }

Target:
public void testTimeoutsConfigured() throws Exception { final DatabaseEngine de = DatabaseFactory.getConnection(this.dbProps); int loginTimeoutInSeconds = DriverManager.getLoginTimeout(); int socketConnectionTimeoutInMs = de.getConnection().getNetworkTimeout(); int checkConnectionTimeoutInSec = de.getProperties().getCheckConnectionTimeout(); assertEquals("Is the login timeout of the DB connection the expected?", LOGIN_TIMEOUT_SECONDS, loginTimeoutInSeconds); assertEquals("Is the socket timeout of the DB connection the expected?", TimeUnit.SECONDS.toMillis(SOCKET_TIMEOUT_SECONDS), socketConnectionTimeoutInMs); assertEquals("Is the check connection timeout of the DB connection the expected?", CHECK_CONNECTION_TIMEOUT_SECONDS, checkConnectionTimeoutInSec); }
Source:
private IASTName buildName(int destructorOffset, IToken nt, boolean keywordTemplate) { IASTName name; if (destructorOffset < 0) { name= keywordTemplate ? getNodeFactory().newTemplateName(nt.getCharImage()) : getNodeFactory().newName(nt.getCharImage()); setRange(name, nt.getOffset(), nt.getEndOffset()); } else { char[] nchars= nt.getCharImage(); final int len= nchars.length; char[] image = new char[len + 1]; image[0]= '~'; System.arraycopy(nchars, 0, image, 1, len); name= keywordTemplate ? getNodeFactory().newTemplateName(image) : getNodeFactory().newName(image); setRange(name, destructorOffset, nt.getEndOffset()); } switch (nt.getType()) { case IToken.tEOC: case IToken.tCOMPLETION: createCompletionNode(nt).addName(name); break; } return name; }

Target:
private IASTName buildName(int destructorOffset, IToken nt, boolean keywordTemplate) { IASTName name; if (destructorOffset < 0) { if (keywordTemplate) { name= getNodeFactory().newTemplateName(nt.getCharImage()); } else { name= getNodeFactory().newName(nt.getCharImage()); } setRange(name, nt.getOffset(), nt.getEndOffset()); } else { char[] nchars= nt.getCharImage(); final int len= nchars.length; char[] image = new char[len + 1]; image[0]= '~'; System.arraycopy(nchars, 0, image, 1, len); name= getNodeFactory().newName(image); setRange(name, destructorOffset, nt.getEndOffset()); } switch (nt.getType()) { case IToken.tEOC: case IToken.tCOMPLETION: createCompletionNode(nt).addName(name); break; } return name; }
Source:
public LiveData<List<Feedback>> getFeedback() { if (feedbackList == null) { LiveRealmData<Feedback> feedbackLiveRealmData = RealmDataRepository.asLiveData(realmRepo.getFeedbacks()); feedbackList = Transformations.map(feedbackLiveRealmData, input -> input); } return feedbackList; }

Target:
public LiveRealmData<Feedback> getFeedback() { if (feedbackLiveRealmData == null) { feedbackLiveRealmData = RealmDataRepository.asLiveData(realmRepo.getFeedbacks()); } return feedbackLiveRealmData; }
Source:
public static Node<View, Edge> getDockSourceNode(final Node<? extends View, ?> node) { return (Node<View, Edge>) node .getInEdges() .stream() .filter(PropertyWriterUtils::isDockEdge) .map(Edge::getSourceNode) .findFirst() .orElse(null); }

Target:
public static Optional<Node<View, Edge>> getDockSourceNode(final Node<? extends View, ?> node) { return node.getInEdges().stream() .filter(PropertyWriterUtils::isDockEdge) .map(Edge::getSourceNode) .map(n -> (Node<View, Edge>) n) .findFirst(); }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); try { Map<String, String> m = new HashMap<String, String>(); rec = DineOnReceiver.createDineOnRecevier( this.getClass().getMethod("onCheckInCallback", m.getClass()), this, this.getClass(), "uw.cse.dineon.user.CONFIRM_DINING_SESSION", "uw.cse.dineon.user." + ParseUser.getCurrentUser().getUsername()); } catch (NoSuchMethodException e) { Log.d(TAG, "Error: " + e.getMessage()); } if(savedInstanceState != null) { Intent i = getIntent(); if(i != null) { mUser = (User) savedInstanceState.get(DineOnConstants.KEY_USER); if(mUser == null) { showAlertNotLoggedIn(); } } } }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); try { rec = DineOnReceiver.createDineOnReceiver(this.getClass().getMethod("onCheckInCallback", Map.class)); } catch (NoSuchMethodException e) { Log.d(TAG, "Error: " + e.getMessage()); } }
Source:
protected void assertValidation(IType expectedReturnTypes[], IType expectedAllReturnTypes[], String serviceName, IType parameterTypes[]) { final IService service = serviceLookUp(serviceName, parameterTypes); assertTrue("Service not found.", service != null); Set<IType> types = service.getType(getValidationServices(), getQueryEnvironment(), Arrays .asList(parameterTypes)); assertEquals(expectedReturnTypes.length, types.size()); int i = 0; for (IType type : types) { assertEqualsITypes(expectedReturnTypes[i++], type); } final Map<List<IType>, Set<IType>> allTypes = new LinkedHashMap<List<IType>, Set<IType>>(); allTypes.put(Arrays.asList(parameterTypes), types); types = service.validateAllType(getValidationServices(), getQueryEnvironment(), allTypes); assertEquals(expectedAllReturnTypes.length, types.size()); i = 0; for (IType type : types) { assertEqualsITypes(expectedAllReturnTypes[i++], type); } }

Target:
protected void assertValidation(IType expectedReturnTypes[], IType expectedAllReturnTypes[], String serviceName, IType parameterTypes[]) { final IService service = serviceLookUp(serviceName, parameterTypes); assertNotNull("Service not found.", service != null); Set<IType> types = service.getType(getValidationServices(), getQueryEnvironment(), Arrays .asList(parameterTypes)); assertEquals(expectedReturnTypes.length, types.size()); int i = 0; for (IType type : types) { assertEqualsITypes(expectedReturnTypes[i++], type); } final Map<List<IType>, Set<IType>> allTypes = new LinkedHashMap<List<IType>, Set<IType>>(); allTypes.put(Arrays.asList(parameterTypes), types); types = service.validateAllType(getValidationServices(), getQueryEnvironment(), allTypes); assertEquals(expectedAllReturnTypes.length, types.size()); i = 0; for (IType type : types) { assertEqualsITypes(expectedAllReturnTypes[i++], type); } }
Source:
public void writeStepdefsJson(List<String> featurePaths, URL dotCucumber) throws IOException { if (dotCucumber != null) { List<CucumberFeature> features = load(new FileResourceLoader(), featurePaths, NO_FILTERS, null); List<MetaStepdef> metaStepdefs = new StepdefGenerator().generate(stepDefinitionsByPattern.values(), features); Gson gson = new GsonBuilder().setPrettyPrinting().create(); String json = gson.toJson(metaStepdefs); Writer stepdefsJson = new UTF8OutputStreamWriter(new URLOutputStream(new URL(dotCucumber, "stepdefs.json"))); stepdefsJson.append(json); stepdefsJson.close(); } }

Target:
public void writeStepdefsJson(List<String> featurePaths, URL dotCucumber) throws IOException { if (dotCucumber != null) { List<CucumberFeature> features = load(new FileResourceLoader(), featurePaths, NO_FILTERS); List<MetaStepdef> metaStepdefs = new StepdefGenerator().generate(stepDefinitionsByPattern.values(), features); Gson gson = new GsonBuilder().setPrettyPrinting().create(); String json = gson.toJson(metaStepdefs); Writer stepdefsJson = new UTF8OutputStreamWriter(new URLOutputStream(new URL(dotCucumber, "stepdefs.json"))); stepdefsJson.append(json); stepdefsJson.close(); } }
Source:
public Node visitKeywordSend(KeywordSendContext ctx) { StatNode statement = (StatNode) visit(ctx.stmt()); String selector = ""; List<ExprNode> arguments = new ArrayList<>(); for (int i = 0; i < ctx.ID().size(); i += 1) { selector += ctx.ID(i) + ":"; arguments.add((ExprNode) visit(ctx.expr(i))); } return new SendNode(statement, selector, arguments); }

Target:
public Node visitKeywordSend(KeywordSendContext ctx) { ExprNode expression = (ExprNode) visit(ctx.expr()); String selector = buildSelector(ctx.ID()); List<ExprNode> arguments = visitExprArguments(ctx.subexpr()); return new SendNode(expression, selector, arguments); }
Source:
private RepositoryCache() { cacheMap = new ConcurrentHashMap<Key, Reference<Repository>>(); openLocks = new Lock[4]; for (int i = 0; i < openLocks.length; i++) openLocks[i] = new Lock(); Runnable terminator = new Runnable() { @Override public void run() { try { for (Reference<Repository> ref : cache.cacheMap.values()) { Repository repository = ref.get(); if (repository != null) { if (repository.useCnt.get() == 0 && (System.currentTimeMillis() - repository.closedAt.get() > 20000)) { RepositoryCache.close(repository); } } } } catch (Throwable e) { LOG.error(e.getMessage(), e); } } }; AlarmQueue.getExecutor().scheduleWithFixedDelay(terminator, 10, 10, TimeUnit.SECONDS); }

Target:
private RepositoryCache() { cacheMap = new ConcurrentHashMap<Key, Reference<Repository>>(); openLocks = new Lock[4]; for (int i = 0; i < openLocks.length; i++) { openLocks[i] = new Lock(); } Runnable terminator = new Runnable() { @Override public void run() { try { for (Reference<Repository> ref : cache.cacheMap .values()) { Repository db = ref.get(); if (db != null && isExpired(db)) { RepositoryCache.close(db); } } } catch (Throwable e) { LOG.error(e.getMessage(), e); } } private boolean isExpired(Repository db) { return db.useCnt.get() == 0 && (System.currentTimeMillis() - db.closedAt.get() > 20000); } }; WorkQueue.getExecutor().scheduleWithFixedDelay(terminator, 10, 10, TimeUnit.SECONDS); }
Source:
public void testPushWhenLocalRepositoryIsUpToDate(GitConnectionFactory connectionFactory) throws IOException, ServerException, URISyntaxException, UnauthorizedException { GitConnection remoteConnection = connectToGitRepositoryWithContent(connectionFactory, repository); GitConnection localConnection = connectionFactory.getConnection(remoteRepo.getAbsolutePath()); localConnection.clone(newDto(CloneRequest.class).withRemoteUri(remoteConnection.getWorkingDir().getAbsolutePath())); PushResponse pushResponse = localConnection.push(newDto(PushRequest.class) .withRefSpec( Collections.singletonList("refs/heads/master:refs/heads/master")) .withRemote("origin") .withTimeout(-1)); assertEquals(pushResponse.getCommandOutput(), "Everything up-to-date"); }

Target:
public void testPushWhenLocalRepositoryIsUpToDate(GitConnectionFactory connectionFactory) throws IOException, ServerException, URISyntaxException, UnauthorizedException { GitConnection remoteConnection = connectToGitRepositoryWithContent(connectionFactory, repository); GitConnection localConnection = connectionFactory.getConnection(remoteRepo.getAbsolutePath()); localConnection.clone(newDto(CloneRequest.class).withRemoteUri(remoteConnection.getWorkingDir().getAbsolutePath())); PushResponse pushResponse = localConnection.push(newDto(PushRequest.class) .withRefSpec(singletonList("refs/heads/master:refs/heads/master")) .withRemote("origin") .withTimeout(-1)); assertEquals(pushResponse.getCommandOutput(), "Everything up-to-date"); }
Source:
protected String inputListToIterate() { return contractInput.eContainer() != null && parentBusinessObject != null && withComplexMultipleInHierarchy().apply(contractInput) ? iteratorName(parentBusinessObject) + "." + Joiner.on(".").join(toAncestorNameListUntilMultipleComplex().apply(contractInput)) : super.inputListToIterate(); }

Target:
protected String inputListToIterate() { return shouldUseParentIterator() ? buildListAccessorWithIteratorName() : super.inputListToIterate(); }
Source:
protected static void clipForOverlappingReads(final SAMRecord read1, final SAMRecord read2, final boolean useHardClipping) { if (!(read1.getReadUnmappedFlag() || read2.getReadUnmappedFlag())) { if (read1.getReadNegativeStrandFlag() != read2.getReadNegativeStrandFlag()) { final SAMRecord pos = (read1.getReadNegativeStrandFlag()) ? read2 : read1; final SAMRecord neg = (read1.getReadNegativeStrandFlag()) ? read1 : read2; if (pos.getAlignmentStart() < neg.getAlignmentEnd()) { final int posClipFrom = getDistanceFrom3PrimeEndToClipFrom(pos, neg.getUnclippedEnd() + 1); final int negClipFrom = getDistanceFrom3PrimeEndToClipFrom(neg, pos.getUnclippedStart() - 1); final CigarOperator clippingOperator = useHardClipping ? CigarOperator.HARD_CLIP : CigarOperator.SOFT_CLIP; if(posClipFrom > 0) { clipRead(pos, posClipFrom, useHardClipping); } if(negClipFrom > 0) { clipRead(neg, negClipFrom, useHardClipping); } } } } }

Target:
protected static void clipForOverlappingReads(final SAMRecord read1, final SAMRecord read2, final boolean useHardClipping) { if (!(read1.getReadUnmappedFlag() || read2.getReadUnmappedFlag())) { if (read1.getReadNegativeStrandFlag() != read2.getReadNegativeStrandFlag()) { final SAMRecord pos = (read1.getReadNegativeStrandFlag()) ? read2 : read1; final SAMRecord neg = (read1.getReadNegativeStrandFlag()) ? read1 : read2; if (pos.getAlignmentStart() < neg.getAlignmentEnd()) { final int posClipFrom = getReadPositionAtReferencePositionIgnoreSoftClips(pos, neg.getUnclippedEnd() + 1); int negClipFrom = getReadPositionAtReferencePositionIgnoreSoftClips(neg, pos.getUnclippedStart() - 1); negClipFrom = negClipFrom > 0 ? (neg.getReadLength() + 1) - negClipFrom : 0; if(posClipFrom > 0) { clip3PrimeEndOfRead(pos, posClipFrom, useHardClipping); } if(negClipFrom > 0) { clip3PrimeEndOfRead(neg, negClipFrom, useHardClipping); } } } } }
Source:
protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) throws ServletException, IOException { String action = request.getParameter("action"); Object result = null; try { switch (action) { case "start": result = doStartProcess(request); break; case "list": result = doProcessList(); break; case "status": result = doProcessStatusCheck(request); break; case "halt": result = doHaltProcess(request); break; case "haltAll": result = doHaltAllProcesses(request); break; case "purge": result = doPurgeCompleted(request); break; default: throw new Exception("Action not understood."); } } catch (Exception ex) { result = "Exception occurred "+ex.getMessage(); LOG.error(ex.getMessage() + " -- End of line.", ex); } Gson gson = new Gson(); gson.toJson(result, response.getWriter()); }

Target:
protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) throws ServletException, IOException { String action = request.getRequestPathInfo().getSelectorString(); Object result = null; try { switch (action) { case "start": result = doStartProcess(request); break; case "list": result = doProcessList(); break; case "status": result = doProcessStatusCheck(request); break; case "halt": result = doHaltProcess(request); break; case "haltAll": case "halt.all": case "halt-all": result = doHaltAllProcesses(request); break; case "purge": result = doPurgeCompleted(request); break; default: throw new Exception("Action not understood."); } } catch (Exception ex) { result = "Exception occurred " + ex.getMessage(); LOG.error(ex.getMessage() + " -- End of line.", ex); } Gson gson = new Gson(); gson.toJson(result, response.getWriter()); }
Source:
public Set<byte[]> getAllColumnNames() { Set<byte[]> ret = Sets.newTreeSet(UnsignedBytes.lexicographicalComparator()); if (dynamicColumn != null) { for (NameComponentDescription rowPart: dynamicColumn.getColumnNameDesc().getRowParts()) { ret.add(rowPart.getComponentName().getBytes()); } return ret; } for (NamedColumnDescription col : namedColumns) { ret.add(col.getShortName().getBytes()); } return ret; }

Target:
public Set<byte[]> getAllColumnNames() { if (dynamicColumn != null) { return dynamicColumn.getColumnNameDesc().getRowParts().stream() .map(rowPart -> rowPart.getComponentName().getBytes()) .collect(Collectors.toCollection(() -> Sets.newTreeSet(UnsignedBytes.lexicographicalComparator()))); } else { return namedColumns.stream() .map(column -> column.getShortName().getBytes()) .collect(Collectors.toCollection(() -> Sets.newTreeSet(UnsignedBytes.lexicographicalComparator()))); } }
Source:
public synchronized void doExecute() throws SQLException { if (isDryRun() || shouldSkipTask()) { return; } initializeExecutor(); try { while(true) { MyRowCallbackHandler rch = new MyRowCallbackHandler(); getTxTemplate().execute(t -> { JdbcTemplate jdbcTemplate = newJdbcTemplate(); jdbcTemplate.setMaxRows(100000); String sql = "SELECT * FROM " + getTableName() + " WHERE " + getColumnName() + " IS NULL"; logInfo(ourLog, "Finding up to rows in that requires calculations", myBatchSize, getTableName()); jdbcTemplate.query(sql, rch); rch.done(); return null; }); rch.submitNext(); List<Future<?>> futures = rch.getFutures(); if (futures.isEmpty()) { break; } logInfo(ourLog, "Waiting for tasks to complete", futures.size()); for (Future<?> next : futures) { try { next.get(); } catch (Exception e) { throw new SQLException(e); } } } } finally { destroyExecutor(); } }

Target:
public synchronized void doExecute() throws SQLException { if (isDryRun() || shouldSkipTask()) { return; } initializeExecutor(); try { while(true) { MyRowCallbackHandler rch = new MyRowCallbackHandler(); getTxTemplate().execute(t -> { JdbcTemplate jdbcTemplate = newJdbcTemplate(); jdbcTemplate.setMaxRows(100000); String sql = "SELECT * FROM " + getTableName() + " WHERE " + getWhereClause(); logInfo(ourLog, "Finding up to rows in that requires calculations, using query: {}", myBatchSize, getTableName(), sql); jdbcTemplate.query(sql, rch); rch.done(); return null; }); rch.submitNext(); List<Future<?>> futures = rch.getFutures(); if (futures.isEmpty()) { break; } logInfo(ourLog, "Waiting for tasks to complete", futures.size()); for (Future<?> next : futures) { try { next.get(); } catch (Exception e) { throw new SQLException(e); } } } } finally { destroyExecutor(); } }
Source:
public void addOrUpdate(Storable storable) { if (storable == null) { throw new IllegalArgumentException("Invalid " + Storable.class.getSimpleName() + " : null"); } Connection connection = null; try { connection = getConnection(); PreparedStatement preparedStatement = new MySqlInsertUpdateDuplicate(storable) .getPreparedStatement(connection, queryTimeoutSecs); preparedStatement.executeUpdate(); } catch (SQLException e) { throw new StorageException(e); } finally { closeConnection(connection); } }

Target:
public void addOrUpdate(Storable storable) throws StorageException { log.debug("Adding or updating storable [{}]", storable); sqlExecutor.insertOrUpdate(storable); }
Source:
private Dialog getCheckListDialog() { CharSequence[] items = new CharSequence[mListItems.size()]; boolean[] checkedItems = new boolean[mListItems.size()]; for (int i = 0; i < mListItems.size(); i++) { items[i] = mListItems.get(i).mItemName; checkedItems[i] = mListItems.get(i).mIsChecked; } AlertDialog.Builder builder = new MaterialAlertDialogBuilder(getContext()) .setTitle(mTitleTextView.getText()) .setNegativeButton(android.R.string.cancel, null) .setPositiveButton(android.R.string.ok, (dialog, which) -> { SparseBooleanArray checkedItems1 = ((AlertDialog) dialog).getListView().getCheckedItemPositions(); mListItems.setCheckedItems(checkedItems1); doPrefChanged(); }) .setMultiChoiceItems(items, checkedItems, null); return builder.create(); }

Target:
private Dialog getCheckListDialog() { CharSequence[] items = new CharSequence[mListItems.size()]; boolean[] checkedItems = new boolean[mListItems.size()]; for (int i = 0; i < mListItems.size(); i++) { items[i] = mListItems.get(i).mItemName; checkedItems[i] = mListItems.get(i).mIsChecked; } AlertDialog.Builder builder = new MaterialAlertDialogBuilder(getContext()) .setTitle(mTitleTextView.getText()) .setNegativeButton(android.R.string.cancel, null) .setPositiveButton(android.R.string.ok, (dialog, which) -> { SparseBooleanArray userCheckedItems = ((AlertDialog) dialog).getListView().getCheckedItemPositions(); mListItems.setCheckedItems(userCheckedItems); doPrefChanged(); }) .setMultiChoiceItems(items, checkedItems, null); return builder.create(); }
Source:
public void addDeferredTask(TaskWrapper task, long countdownTime) { Queue requiredQueue = QueueFactory.getQueue(task.getQueueName()); TaskOptions taskToBeAdded = TaskOptions.Builder.withUrl(task.getWorkerUrl()); if (countdownTime > 0) { taskToBeAdded.countdownMillis(countdownTime); } if (task.getRequestBody() == null) { for (Map.Entry<String, String[]> entry : task.getParamMap().entrySet()) { String name = entry.getKey(); String[] values = entry.getValue(); for (String value : values) { taskToBeAdded = taskToBeAdded.param(name, value); } } } else { taskToBeAdded = taskToBeAdded.payload(JsonUtils.toJson(task.getRequestBody())); } requiredQueue.add(taskToBeAdded); }

Target:
public void addDeferredTask(TaskWrapper task, long countdownTime) { Queue requiredQueue = QueueFactory.getQueue(task.getQueueName()); TaskOptions taskToBeAdded = TaskOptions.Builder.withUrl(task.getWorkerUrl()); if (countdownTime > 0) { taskToBeAdded.countdownMillis(countdownTime); } if (task.getRequestBody() == null) { task.getParamMap().forEach((key, value) -> taskToBeAdded.param(key, value)); } else { taskToBeAdded.payload(JsonUtils.toJson(task.getRequestBody())); } requiredQueue.add(taskToBeAdded); }
Source:
public void provideDynamicMetrics(MetricDescriptor descriptor, MetricsCollectionContext context) { descriptor.withPrefix("nearCache"); for (NearCache nearCache : nearCacheManager.listAllNearCaches()) { String nearCacheName = nearCache.getName(); NearCacheStatsImpl nearCacheStats = (NearCacheStatsImpl) nearCache.getNearCacheStats(); context.collect(descriptor.copy().withDiscriminator("name", nearCacheName), nearCacheStats); } }

Target:
public void provideDynamicMetrics(MetricDescriptor descriptor, MetricsCollectionContext context) { descriptor.withPrefix("nearcache"); for (NearCache nearCache : nearCacheManager.listAllNearCaches()) { String nearCacheName = nearCache.getName(); NearCacheStatsImpl nearCacheStats = (NearCacheStatsImpl) nearCache.getNearCacheStats(); context.collect(descriptor.copy().withDiscriminator("name", nearCacheName), nearCacheStats); } }
Source:
public void initialize() { if (initialized.compareAndSet(false, true)) { taskStateMachine.addStateChangeListener(new StateChangeListener<TaskState>() { @Override public void stateChanged(TaskState newState) { if (newState.isDone()) { executionEndTime.set(DateTime.now()); endNanos.set(System.nanoTime()); } } }); } }

Target:
private void initialize() { taskStateMachine.addStateChangeListener(newState -> { if (newState.isDone()) { executionEndTime.set(DateTime.now()); endNanos.set(System.nanoTime()); } }); }
Source:
public void testGetOsImage_404() throws Exception { server.enqueue(response404()); OsImage osImage = api.getServerImageApi().getOsImage("id"); assertNull(osImage); assertSent(HttpMethod.GET, getImageUrl().appendPath("/osImage/id").toString()); }

Target:
public void testGetOsImage_404() throws Exception { server.enqueue(response404()); OsImage osImage = api.getServerImageApi().getOsImage("id"); assertNull(osImage); assertSent(HttpMethod.GET, getOsImageUrl().appendPath("/id").toString()); }
Source:
private static WaitAllTracesOpened openTraceIfNecessary(IProject project, List<Path> tracePaths, Collection<TmfCommonProjectElement> existingTraces, IProgressMonitor monitor) { WaitAllTracesOpened waitService = new WaitAllTracesOpened(tracePaths, existingTraces); if (!existingTraces.isEmpty()) { Display.getDefault().asyncExec(() -> { for (TmfCommonProjectElement existingTrace : existingTraces) { if (monitor.isCanceled()) { return; } try { IStatus status = TmfOpenTraceHelper.openFromElement(existingTrace); if (!status.isOK()) { waitService.registerStatus(new Path(existingTrace.getLocation().getPath()), status); } } catch (Exception e) { waitService.registerException(new Path(existingTrace.getLocation().getPath()), e); } } }); } if (tracePaths.isEmpty()) { return waitService; } TmfTraceFolder destinationFolder = TmfProjectRegistry.getProject(project, true).getTracesFolder(); if (!tracePaths.isEmpty()) { Display.getDefault().asyncExec(() -> { for (Path tracePath : tracePaths) { if (monitor.isCanceled()) { return; } try { IStatus status = TmfOpenTraceHelper.openTraceFromPath(destinationFolder, tracePath.toOSString(), TracingRcpPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell()); if (!status.isOK()) { waitService.registerStatus(tracePath, status); } else if (status.getCode() == IStatus.OK) { waitService.registerStatus(tracePath, status); } } catch (CoreException e) { waitService.registerException(tracePath, e); } } }); } return waitService; }

Target:
private static WaitAllTracesOpened openTraceIfNecessary(IProject project, List<Path> tracePaths, Collection<TmfCommonProjectElement> existingTraces, IProgressMonitor monitor) { WaitAllTracesOpened waitService = new WaitAllTracesOpened(tracePaths, existingTraces); if (!existingTraces.isEmpty()) { Display.getDefault().asyncExec(() -> { for (TmfCommonProjectElement existingTrace : existingTraces) { if (monitor.isCanceled()) { return; } try { IStatus status = TmfOpenTraceHelper.openFromElement(existingTrace); if (!status.isOK() || (status.getCode() != IStatus.OK)) { waitService.registerStatus(new Path(existingTrace.getLocation().getPath()), status); } } catch (Exception e) { waitService.registerException(new Path(existingTrace.getLocation().getPath()), e); } } }); } if (tracePaths.isEmpty()) { return waitService; } TmfTraceFolder destinationFolder = TmfProjectRegistry.getProject(project, true).getTracesFolder(); if (!tracePaths.isEmpty()) { Display.getDefault().asyncExec(() -> { for (Path tracePath : tracePaths) { if (monitor.isCanceled()) { return; } try { IStatus status = TmfOpenTraceHelper.openTraceFromPath(destinationFolder, tracePath.toOSString(), TracingRcpPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell()); if (!status.isOK() || (status.getCode() != IStatus.OK)) { waitService.registerStatus(tracePath, status); } } catch (CoreException e) { waitService.registerException(tracePath, e); } } }); } return waitService; }
Source:
public boolean addOrUpdate(ConstructorItem item, String autocompleteSection) throws ConstructorException { return add(item.getItemName(), autocompleteSection, item.toJsonParams()); }

Target:
public boolean addOrUpdate(ConstructorItem item, String autocompleteSection) throws ConstructorException { return addOrUpdate(item.getItemName(), autocompleteSection, item.toJsonParams()); }
Source:
public synchronized void refresh() { try { _propertyStore.subscribeChildChanges(PROPERTYSTORE_TABLE_CONFIGS_PREFIX, _tableConfigChangeListener); _propertyStore.subscribeDataChanges(PROPERTYSTORE_TABLE_CONFIGS_PREFIX, _tableConfigChangeListener); List<ZNRecord> children = _propertyStore.getChildren(PROPERTYSTORE_TABLE_CONFIGS_PREFIX, null, AccessOption.PERSISTENT); if (children != null) { for (ZNRecord znRecord : children) { try { TableConfig tableConfig = TableConfigUtils.fromZNRecord(znRecord); String tableNameWithType = tableConfig.getTableName(); _tableConfigMap.put(tableNameWithType.toLowerCase(), tableConfig); String rawTableName = TableNameBuilder.extractRawTableName(tableNameWithType); _tableNameMap.put(tableNameWithType.toLowerCase(), tableNameWithType); _tableNameMap.put(rawTableName.toLowerCase(), rawTableName); _table2SchemaConfigMap.put(tableNameWithType.toLowerCase(), rawTableName); _table2SchemaConfigMap.put(rawTableName.toLowerCase(), rawTableName); } catch (Exception e) { LOGGER.warn("Exception loading table config for: {}: {}", znRecord.getId(), e.getMessage()); } } } } catch (Exception e) { LOGGER.warn("Exception subscribing/reading tableconfigs", e); } }

Target:
public synchronized void refresh() { try { _propertyStore.subscribeChildChanges(PROPERTYSTORE_TABLE_CONFIGS_PREFIX, _tableConfigChangeListener); _propertyStore.subscribeDataChanges(PROPERTYSTORE_TABLE_CONFIGS_PREFIX, _tableConfigChangeListener); List<ZNRecord> children = _propertyStore.getChildren(PROPERTYSTORE_TABLE_CONFIGS_PREFIX, null, AccessOption.PERSISTENT); if (children != null) { for (ZNRecord znRecord : children) { try { TableConfig tableConfig = TableConfigUtils.fromZNRecord(znRecord); String tableNameWithType = tableConfig.getTableName(); _tableConfigMap.put(tableNameWithType, tableConfig); String rawTableName = TableNameBuilder.extractRawTableName(tableNameWithType); _tableNameMap.put(tableNameWithType.toLowerCase(), tableNameWithType); _tableNameMap.put(rawTableName.toLowerCase(), rawTableName); _table2SchemaConfigMap.put(tableNameWithType.toLowerCase(), rawTableName); _table2SchemaConfigMap.put(rawTableName.toLowerCase(), rawTableName); } catch (Exception e) { LOGGER.warn("Exception loading table config for: {}: {}", znRecord.getId(), e.getMessage()); } } } } catch (Exception e) { LOGGER.warn("Exception subscribing/reading tableconfigs", e); } }
Source:
long menuForEvent (long id, long sel, long theEvent) { if (!isEnabled ()) return 0; NSPoint pt = NSEvent.mouseLocation(); pt.y = (int) (display.getPrimaryFrame().height - pt.y); int x = (int) pt.x; int y = (int) pt.y; Event event = new Event (); event.x = x; event.y = y; NSEvent nsEvent = new NSEvent(theEvent); event.detail = nsEvent.buttonNumber() > 0 ? SWT.MENU_MOUSE : SWT.MENU_KEYBOARD; int count = 0; boolean menuAlreadyHandledByDisplay = false; if (display.popups != null) { while (count < display.popups.length && display.popups[count] != null) { if (display.popups[count] == menu) { menuAlreadyHandledByDisplay = true; } count++; } } sendEvent(SWT.MenuDetect, event); if (isDisposed ()) return 0; Menu menu = getMenu (); if (event.doit && menu != null && !menu.isDisposed () && !menuAlreadyHandledByDisplay) { if (x != event.x || y != event.y) { menu.setLocation (event.x, event.y); } return menu.nsMenu.id; } int count2 = 0; if (display.popups != null) { while (count2 < display.popups.length && display.popups[count2] != null) { count2++; } } if (count2 != count && count2 > 0) { Menu menu1 = display.popups[count2 - 1]; display.popups[count2 - 1] = null; return menu1.nsMenu.id; } if (!event.doit) return 0; return super.menuForEvent (id, sel, theEvent); }

Target:
long menuForEvent (long id, long sel, long theEvent) { if (!isEnabled ()) return 0; NSPoint pt = NSEvent.mouseLocation(); pt.y = (int) (display.getPrimaryFrame().height - pt.y); int x = (int) pt.x; int y = (int) pt.y; Event event = new Event (); event.x = x; event.y = y; NSEvent nsEvent = new NSEvent(theEvent); event.detail = nsEvent.buttonNumber() > 0 ? SWT.MENU_MOUSE : SWT.MENU_KEYBOARD; int initialNofPopups = 0; boolean menuAlreadyHandledByDisplay = false; if (display.popups != null) { while (initialNofPopups < display.popups.length && display.popups[initialNofPopups] != null) { if (display.popups[initialNofPopups] == menu) { menuAlreadyHandledByDisplay = true; } initialNofPopups++; } } sendEvent(SWT.MenuDetect, event); if (isDisposed ()) return 0; Menu menu = getMenu (); int newNofPopups = 0; if (display.popups != null) { while (newNofPopups < display.popups.length && display.popups[newNofPopups] != null) { newNofPopups++; } } if (event.doit && menu != null && !menu.isDisposed () && !menuAlreadyHandledByDisplay) { if (newNofPopups != initialNofPopups && newNofPopups > 0 && display.popups[newNofPopups - 1] == menu) { display.popups[newNofPopups - 1] = null; } if (x != event.x || y != event.y) { menu.setLocation (event.x, event.y); } return menu.nsMenu.id; } if (newNofPopups != initialNofPopups && newNofPopups > 0) { Menu menu1 = display.popups[newNofPopups - 1]; display.popups[newNofPopups - 1] = null; return menu1.nsMenu.id; } if (!event.doit) return 0; return super.menuForEvent (id, sel, theEvent); }
Source:
public MessagesCreated apply(HttpResponse from) { MessagesCreated rawMessagesCreated = json.apply(from); List<String> messageIds = new ArrayList<String>(rawMessagesCreated.getMessageIds().size()); for (String rawMessageHref: rawMessagesCreated.getMessageIds()) { messageIds.add(ParseMessages.getMessageId(rawMessageHref)); } MessagesCreated messagesCreated = MessagesCreated.builder() .partial(rawMessagesCreated.isPartial()) .messageIds(messageIds) .build(); return messagesCreated; }

Target:
public MessagesCreated apply(HttpResponse from) { MessagesCreated rawMessagesCreated = json.apply(from); List<String> messageIds = Lists.transform(rawMessagesCreated.getMessageIds(), TO_MESSAGE_ID); MessagesCreated messagesCreated = MessagesCreated.builder() .messageIds(messageIds) .build(); return messagesCreated; }
Source:
static private String buildQuery(List<DataSource> dataSources, boolean showAll, int cntDaysFromRecent, boolean noTimeStamp) { String mostRecentQuery = ""; if (!showAll && cntDaysFromRecent > 0) { mostRecentQuery = String.format("AND value_int64 > (%s)", String.format(MOST_RECENT_TIME, cntDaysFromRecent, BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_CREATED.getTypeID(), getWaypointListQuery(dataSources) )); } String query = String.format(GEO_ARTIFACT_QUERY, BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_CREATED.getTypeID()); query += String.format("AND artifact_id IN(%s)", getWaypointListQuery(dataSources)); query += mostRecentQuery; if (noTimeStamp) { query = String.format("%s UNION %s", buildQueryForWaypointsWOTimeStamps(dataSources), query); } return query; }

Target:
static private String buildQuery(List<DataSource> dataSources, boolean showAll, int cntDaysFromRecent, boolean noTimeStamp) { String mostRecentQuery = ""; if (!showAll && cntDaysFromRecent > 0) { mostRecentQuery = String.format("AND value_int64 > (%s)", String.format(MOST_RECENT_TIME, cntDaysFromRecent, BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_CREATED.getTypeID(), getWaypointListQuery(dataSources) )); } String query = String.format(GEO_ARTIFACT_QUERY, BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_CREATED.getTypeID()); query += String.format("AND artifact_id IN(%s)", getWaypointListQuery(dataSources)); query += mostRecentQuery; if (showAll || noTimeStamp) { query = String.format("%s UNION %s", buildQueryForWaypointsWOTimeStamps(dataSources), query); } return query; }
Source:
public GetTaskListCommandParameters() { storagePoolId = null; compatbilityVersion = null; }

Target:
public GetTaskListCommandParameters() { }
Source:
protected final void registerRemoveRevisionDelta(CDOObject object, EStructuralFeature feature, int index) { final CDORemoveFeatureDeltaImpl featureDelta = new CDORemoveFeatureDeltaImpl(feature, 0); getRevisionDelta(object).addFeatureDelta(featureDelta); }

Target:
protected final void registerRemoveRevisionDelta(CDOObject object, EStructuralFeature feature, int index) { final CDORemoveFeatureDeltaImpl featureDelta = new CDORemoveFeatureDeltaImpl(feature, index); getRevisionDelta(object).addFeatureDelta(featureDelta); }
Source:
protected Map<String, SubType> getCoreAllowedSubtypes(Type type) { SchemaManagerImpl schemaManager = (SchemaManagerImpl) Framework.getService(SchemaManager.class); Collection<String> coreAllowedSubtypes = schemaManager.getAllowedSubTypes(type.getId()); Map<String, SubType> ecmSubTypes = type.getAllowedSubTypes(); Map<String, SubType> allowedSubTypes = new HashMap<>(); SubType subtype; if (coreAllowedSubtypes != null) { for (String name : coreAllowedSubtypes) { if (ecmSubTypes.containsKey(name)) { subtype = ecmSubTypes.get(name); } else { subtype = new SubType(); subtype.setName(name); } allowedSubTypes.put(name, subtype); } } return allowedSubTypes; }

Target:
protected Map<String, SubType> getCoreAllowedSubtypes(Type type) { SchemaManager schemaManager = Framework.getService(SchemaManager.class); Collection<String> coreAllowedSubtypes = schemaManager.getAllowedSubTypes(type.getId()); if (coreAllowedSubtypes == null) { return Collections.emptyMap(); } Map<String, SubType> ecmSubTypes = type.getAllowedSubTypes(); Map<String, SubType> allowedSubTypes = new HashMap<>(); SubType subtype; for (String name : coreAllowedSubtypes) { if (ecmSubTypes.containsKey(name)) { subtype = ecmSubTypes.get(name); } else { subtype = new SubType(); subtype.setName(name); } allowedSubTypes.put(name, subtype); } return allowedSubTypes; }
Source:
public static Map<Object, Object> singularMap(Object key, Object value) { Map<Object, Object> query = new HashMap<Object, Object>(); query.put(key, value); return query; }

Target:
private static Map<Object, Object> singularMap(Object key, Object value) { Map<Object, Object> query = new HashMap<Object, Object>(); query.put(key, value); return query; }