auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void writeBatchScores(final List<AggregateScore> scores) { final List<WriteRequest> scoreList = new ArrayList<>(); for (final AggregateScore score : scores) { LOGGER.debug("Batch: {}, {}, {}", score.accountId, score.date, score.score); final HashMap<String, AttributeValue> item = new HashMap<>(); item.put(ACCOUNT_ID_ATTRIBUTE_NAME, new AttributeValue().withN(String.valueOf(score.accountId))); item.put(DATE_ATTRIBUTE_NAME, new AttributeValue().withS(score.date)); item.put(SCORE_ATTRIBUTE_NAME, new AttributeValue().withN(String.valueOf(score.score))); item.put(MESSAGE_ATTRIBUTE_NAME, new AttributeValue().withS(score.message)); item.put(TYPE_ATTRIBUTE_NAME, new AttributeValue().withS(score.scoreType)); item.put(VERSION_ATTRIBUTE_NAME, new AttributeValue().withS(score.version)); scoreList.add(new WriteRequest().withPutRequest(new PutRequest().withItem(item))); } Map<String, List<WriteRequest>> requestItems = new HashMap<>(); requestItems.put(this.tableName, scoreList); BatchWriteItemResult result; final BatchWriteItemRequest batchWriteItemRequest = new BatchWriteItemRequest(); do { batchWriteItemRequest.withRequestItems(requestItems); result = this.dynamoDBClient.batchWriteItem(batchWriteItemRequest); requestItems = result.getUnprocessedItems(); LOGGER.debug("Unprocessed put request count {}", requestItems.size()); } while (result.getUnprocessedItems().size() > 0); }

Target:
public void writeBatchScores(final List<AggregateScore> scores) { final List<WriteRequest> scoreList = new ArrayList<>(); for (final AggregateScore score : scores) { LOGGER.debug("Batch: {}, {}, {}", score.accountId, score.date, score.score); final HashMap<String, AttributeValue> item = this.createItem(score); scoreList.add(new WriteRequest().withPutRequest(new PutRequest().withItem(item))); } Map<String, List<WriteRequest>> requestItems = new HashMap<>(); requestItems.put(this.tableName, scoreList); BatchWriteItemResult result; final BatchWriteItemRequest batchWriteItemRequest = new BatchWriteItemRequest(); do { batchWriteItemRequest.withRequestItems(requestItems); result = this.dynamoDBClient.batchWriteItem(batchWriteItemRequest); requestItems = result.getUnprocessedItems(); LOGGER.debug("Unprocessed put request count {}", requestItems.size()); } while (result.getUnprocessedItems().size() > 0); }
Source:
public void validatesMultipleXmlsInThreads() throws Exception { final int zero = 0; final int ten = 10; final int hundred = 100; final int fifty = 50; final XSD xsd = new XSDDocument( StringUtils.join( "<xs:schema xmlns:xs ='<LINK_0>' >", "<xs:element name='r'><xs:complexType><xs:sequence>", "<xs:element name='x' maxOccurs='unbounded'><xs:simpleType>", "<xs:restriction base='xs:integer'>", "<xs:maxInclusive value='100'/></xs:restriction>", "</xs:simpleType></xs:element>", "</xs:sequence></xs:complexType></xs:element></xs:schema>" ) ); final Random rnd = new SecureRandom(); final XML xml = new XMLDocument( StringUtils.join( Iterables.concat( Collections.singleton("<r>"), Iterables.transform( Collections.nCopies(ten, zero), new Function<Integer, String>() { @Override public String apply(final Integer pos) { return String.format( "<x>%d</x>", rnd.nextInt(hundred) ); } } ), Collections.singleton("<x>101</x></r>") ), " " ) ); final AtomicInteger done = new AtomicInteger(); final Callable<Void> callable = new Callable<Void>() { @Override public Void call() throws Exception { try { new StrictXML(xml, xsd); } catch (final IllegalArgumentException ex) { done.incrementAndGet(); } return null; } }; final ExecutorService executorService = Executors.newFixedThreadPool(5); for (int count = zero; count < fifty; count = count + 1) { executorService.submit(callable); } executorService.awaitTermination(ten, TimeUnit.SECONDS); executorService.shutdown(); MatcherAssert.assertThat(done.get(), Matchers.equalTo(fifty)); }

Target:
public void validatesMultipleXmlsInThreads() throws Exception { final int timeout = 10; final int numrun = 100; final int loop = 50; final XSD xsd = new XSDDocument( StringUtils.join( "<xs:schema xmlns:xs ='<LINK_0>' >", "<xs:element name='r'><xs:complexType><xs:sequence>", "<xs:element name='x' maxOccurs='unbounded'><xs:simpleType>", "<xs:restriction base='xs:integer'>", "<xs:maxInclusive value='100'/></xs:restriction>", "</xs:simpleType></xs:element>", "</xs:sequence></xs:complexType></xs:element></xs:schema>" ) ); final Random rnd = new SecureRandom(); final XML xml = new XMLDocument( StringUtils.join( Iterables.concat( Collections.singleton("<r>"), Iterables.transform( Collections.nCopies(timeout, 0), new Function<Integer, String>() { @Override public String apply(final Integer pos) { return String.format( "<x>%d</x>", rnd.nextInt(numrun) ); } } ), Collections.singleton("<x>101</x></r>") ), " " ) ); final AtomicInteger done = new AtomicInteger(); final Callable<Void> callable = new Callable<Void>() { @Override public Void call() throws Exception { try { new StrictXML(xml, xsd); } catch (final IllegalArgumentException ex) { done.incrementAndGet(); } return null; } }; final ExecutorService executorService = Executors.newFixedThreadPool(5); for (int count = 0; count < loop; count = count + 1) { executorService.submit(callable); } executorService.shutdown(); MatcherAssert.assertThat( executorService.awaitTermination(timeout, TimeUnit.SECONDS), Matchers.is(true) ); executorService.shutdownNow(); MatcherAssert.assertThat(done.get(), Matchers.equalTo(loop)); }
Source:
private String getCrumb(String baseUrl, String token) throws Exception{ final String crumbUrl = baseUrl + "/crumbIssuer/api/xml?xpath=concat( final int maxRetries = 3; final int sleepRetryMS = 3000; for( int retry = 0; retry < maxRetries; ++retry ) { try { final HttpURLConnection connection = setupConnection(crumbUrl, token); connection.connect(); final int status = connection.getResponseCode(); if (status == 200) { return new BufferedReader(new InputStreamReader((connection.getInputStream()))).readLine(); } else { if( retry+1 < maxRetries ) { logger.warn("Could not connect to " + baseUrl + ", got HTTP status " + status + " will retry in " + sleepRetryMS + "ms"); } else { return null; } } } catch(final Exception e) { if( retry+1 < maxRetries ) { logger.warn("Could not connect to " + baseUrl + ", will retry in " + sleepRetryMS + "ms", e); } else { throw e; } } Thread.sleep(sleepRetryMS); } return null; }

Target:
private String getCrumb(String baseUrl, String token) throws Exception{ final String crumbUrl = baseUrl + "/crumbIssuer/api/xml?xpath=concat( final int maxRetries = 3; final int sleepRetryMS = 3000; for( int retry = 1; retry <= maxRetries; ++retry ) { try { final HttpURLConnection connection = setupConnection(crumbUrl, token); connection.connect(); final int status = connection.getResponseCode(); if (status == 200) { return new BufferedReader(new InputStreamReader((connection.getInputStream()))).readLine(); } else { logger.warn("Could not connect to " + baseUrl + ", got HTTP status " + status + "."); return null; } } catch(final SSLException e) { if( retry < maxRetries ) { logger.warn("Could not connect to " + baseUrl + ", will retry in " + sleepRetryMS + "ms", e); } else { throw e; } } Thread.sleep(sleepRetryMS); } return null; }
Source:
public List<OrderGroup> getOrderGroupsByPatient(Patient patient) { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(OrderGroup.class); if (patient != null) { criteria.add(Restrictions.eq("patient", patient)); } else{ criteria.add(Restrictions.isNull("patient")); } return criteria.list(); }

Target:
public List<OrderGroup> getOrderGroupsByPatient(Patient patient) throws APIException { if (patient == null) { throw new APIException("Patient cannot be null"); } Criteria criteria = sessionFactory.getCurrentSession().createCriteria(OrderGroup.class); criteria.add(Restrictions.eq("patient", patient)); return criteria.list(); }
Source:
static Mono<Object> decode(HttpResponse httpResponse, SerializerAdapter serializer, HttpResponseDecodeData decodeData) { Type headerType = decodeData.getHeadersType(); if (headerType == null) { return Mono.empty(); } else { return Mono.defer(() -> { try { return Mono.justOrEmpty(deserializeHeaders(httpResponse.getHeaders(), serializer, decodeData)); } catch (IOException e) { return Mono.error(new HttpResponseException( "HTTP response has malformed headers", httpResponse, e)); } }); } }

Target:
static Mono<Object> decode(HttpResponse httpResponse, SerializerAdapter serializer, HttpResponseDecodeData decodeData) { Type headerType = decodeData.getHeadersType(); if (headerType == null) { return Mono.empty(); } else { return Mono.fromCallable(() -> serializer.deserialize(httpResponse.getHeaders(), decodeData.getHeadersType())) .onErrorResume(IOException.class, e -> Mono.error(new HttpResponseException( "HTTP response has malformed headers", httpResponse, e))); } }
Source:
private static String getMetastoreJdbcPasswd(HiveConf conf) { try { return ShimLoader.getHadoopShims().getPassword(conf, HiveConf.ConfVars.METASTOREPWD.varname); } catch (IOException io) { } return null; }

Target:
private static String getMetastoreJdbcPasswd(HiveConf conf) throws IOException { return ShimLoader.getHadoopShims().getPassword(conf, HiveConf.ConfVars.METASTOREPWD.varname); }
Source:
public void shouldUpdateSourceTopicsWithNewMatchingTopic() { topology.addSource("source-1", "topic-1"); final ProcessorTopology processorTopology = topology.getInternalBuilder("X").buildTopology(); assertNull(processorTopology.source("topic-2")); processorTopology.updateSourceTopics(Collections.singletonMap("source-1", asList("topic-1", "topic-2"))); assertThat(processorTopology.source("topic-2"), instanceOf(SourceNode.class)); }

Target:
public void shouldUpdateSourceTopicsWithNewMatchingTopic() { topology.addSource("source-1", "topic-1"); final ProcessorTopology processorTopology = topology.getInternalBuilder("X").buildTopology(); assertNull(processorTopology.source("topic-2")); processorTopology.updateSourceTopics(Collections.singletonMap("source-1", asList("topic-1", "topic-2"))); assertThat(processorTopology.source("topic-2").name(), equalTo("source-1")); }
Source:
private void validateContent(JSONObject payloadObject, String schemaString, MessageContext messageContext) { logger.debug("Validating JSON content against the schema"); String finalMessage = ""; List<String> errorMessages; JSONObject jsonSchema = new JSONObject(schemaString); Schema schema = SchemaLoader.load(jsonSchema); if (schema == null) { return; } try { schema.validate(payloadObject); } catch (ValidationException e) { errorMessages = e.getAllMessages(); for (String message : errorMessages) { finalMessage += message + ", "; } if (messageContext.isResponse()) { logger.error("Schema validation failed in the Response :" + e.getMessage(), e); GatewayUtils.handleThreat(messageContext, APIMgtGatewayConstants.INTERNAL_ERROR_CODE, "Schema validation failed in the Response :" + finalMessage); } else { logger.error("Schema validation failed in the Request :" + e.getMessage(), e); GatewayUtils.handleThreat(messageContext, APIMgtGatewayConstants.HTTP_SC_CODE, "Schema validation failed in the Request :" + finalMessage); } } }

Target:
private void validateContent(JSONObject payloadObject, String schemaString, MessageContext messageContext) { logger.debug("Validating JSON content against the schema"); StringBuilder finalMessage = new StringBuilder(); List<String> errorMessages; JSONObject jsonSchema = new JSONObject(schemaString); Schema schema = SchemaLoader.load(jsonSchema); if (schema == null) { return; } try { schema.validate(payloadObject); } catch (ValidationException e) { errorMessages = e.getAllMessages(); for (String message : errorMessages) { finalMessage.append(message).append(", "); } if (messageContext.isResponse()) { String message = "Schema validation failed in the Response: "; logger.error(message + e.getMessage(), e); GatewayUtils.handleThreat(messageContext, APIMgtGatewayConstants.INTERNAL_ERROR_CODE, message + finalMessage); } else { String errMessage = "Schema validation failed in the Request: "; logger.error(errMessage + e.getMessage(), e); GatewayUtils.handleThreat(messageContext, APIMgtGatewayConstants.HTTP_SC_CODE, errMessage + finalMessage); } } }
Source:
public InputStream call(InputStream endpointState, SessionState session, InputStream workUnit, InputStream[] input) { newCallContext().withEndpointState(endpointState).withSessionState(session) .withWorkUnit(workUnit); return call(newCallContext(), input); }

Target:
public InputStream call(InputStream endpointState, SessionState session, InputStream workUnit, InputStream[] input) { CallContext callContext = newCallContext().withEndpointState(endpointState).withSessionState(session) .withWorkUnit(workUnit); return call(callContext, input); }
Source:
private static void triggerSecureStorageOfPasswordInConnectionDialog(String username, String server, boolean storePassword, ServerType serverType) { OpenShiftExplorerView explorer = new OpenShiftExplorerView(); AbstractOpenShiftConnection connection = explorer.getOpenShiftConnection(username, server, serverType); connection.select(); if (ServerType.OPENSHIFT_2.equals(serverType)) { waitForLoadingConnectionDetails(connection); } new ContextMenu(OpenShiftLabel.ContextMenu.EDIT_CONNECTION).select(); new DefaultShell(OpenShiftLabel.Shell.EDIT_CONNECTION); if (!(new CheckBox(1).isChecked()) && storePassword) { new CheckBox(1).click(); new FinishButton().click(); acceptSSLCertificate(); boolean firstStorage = provideSecureStoragePassword(SystemProperties.SECURE_STORAGE_PASSWORD); if (firstStorage) { try { new DefaultShell(OpenShiftLabel.Shell.PASSWORD_HINT_NEEDED); new NoButton().click(); } catch (SWTLayerException ex) { } new DefaultShell(OpenShiftLabel.Shell.SECURE_STORAGE).setFocus(); new NoButton().click(); } } else if (new CheckBox(1).isChecked() && !storePassword) { new CheckBox(1).click(); new FinishButton().click(); } new WaitWhile(new JobIsRunning()); }

Target:
private static void triggerSecureStorageOfPasswordInConnectionDialog(String username, String server, boolean storePassword, ServerType serverType) { OpenShiftExplorerView explorer = new OpenShiftExplorerView(); AbstractOpenShiftConnection connection = explorer.getOpenShiftConnection(username, server, serverType); connection.select(); if (ServerType.OPENSHIFT_2.equals(serverType)) { waitForLoadingConnectionDetails(connection); } new ContextMenu(OpenShiftLabel.ContextMenu.EDIT_CONNECTION).select(); new DefaultShell(OpenShiftLabel.Shell.EDIT_CONNECTION); if (!(new CheckBox(1).isChecked()) && storePassword) { new CheckBox(1).click(); new FinishButton().click(); acceptSSLCertificate(); boolean firstStorage = provideSecureStoragePassword(SystemProperties.SECURE_STORAGE_PASSWORD); if (firstStorage) { try { new DefaultShell(OpenShiftLabel.Shell.PASSWORD_HINT_NEEDED); new NoButton().click(); } catch (SWTLayerException ex) { LOGGER.debug("Password hint did not appear. Skipping."); } } } else if (new CheckBox(1).isChecked() && !storePassword) { new CheckBox(1).click(); new FinishButton().click(); } new WaitWhile(new JobIsRunning()); }
Source:
public ForumBoardPageObject openForumBoard() { WebElement forumBoardLink = null; found: for(int i = 0; i < getForumElementsList().size(); i++) { if(!getForumElementsList().get(i).toString().contains("%")) { forumBoardLink = getForumElementsList().get(i); break found; } } waitForElementByElement(forumBoardLink); waitForElementClickableByElement(forumBoardLink); scrollAndClick(forumBoardLink); PageObjectLogging.log("openForumBoard", "click on the forum Board", true, driver); return new ForumBoardPageObject(driver); }

Target:
public ForumBoardPageObject openForumBoard() { WebElement forumBoardLink = null; for(int i = 0; i < getForumElementsList().size(); i++) { if(!getForumElementsList().get(i).toString().contains("%")) { forumBoardLink = getForumElementsList().get(i); break; } } waitForElementByElement(forumBoardLink); waitForElementClickableByElement(forumBoardLink); scrollAndClick(forumBoardLink); PageObjectLogging.log("openForumBoard", "click on the forum Board", true, driver); return new ForumBoardPageObject(driver); }
Source:
protected void searchAndLaunch(final Object[] elements, String mode) { if (elements[0] instanceof IResource) { ICElement cElement = CoreModel.getDefault().create( (IResource) elements[0]); if (cElement != null) { super.searchAndLaunch(new Object[] { cElement }, mode); return; } } super.searchAndLaunch(elements, mode); }

Target:
protected void searchAndLaunch(final Object[] elements, String mode) { if (elements == null || elements.length == 0) { return; } if (elements[0] instanceof IResource) { ICElement cElement = CoreModel.getDefault().create( (IResource) elements[0]); if (cElement != null) { super.searchAndLaunch(new Object[] { cElement }, mode); return; } } super.searchAndLaunch(elements, mode); }
Source:
public void testRegistryUrlNotFoundDialog() { String shellTitle = OpenShiftLabel.Shell.REGISTRY_URL_NOT_FOUND; wizard.getImageRegistryUrl().setText(""); wizard.finish(); stopServerAdapter(); wizard = getOpenshiftConnectionWizard(findOpenShiftConnection(null, OPENSHIFT_USERNAME)); switchOffPasswordSaving(wizard); try { wizard.discover(); fail("Expected OpenshiftToolsException was not thrown, possibly no dialog is shown."); } catch (OpenShiftToolsException osExc) { assertTrue("Registry URL not found dialog did not appear.", osExc.getMessage().contains(shellTitle)); new WaitUntil(new ShellIsAvailable(shellTitle), TimePeriod.SHORT); new DefaultShell(shellTitle); new OkButton().click(); } wizard.cancel(); }

Target:
public void testRegistryUrlNotFoundDialog() { wizard.getImageRegistryUrl().setText(""); wizard.finish(); stopServerAdapter(); wizard = getOpenshiftConnectionWizard(findOpenShiftConnection(null, OPENSHIFT_USERNAME)); switchOffPasswordSaving(wizard); try { wizard.discover(); fail("Expected OpenshiftToolsException was not thrown, possibly no dialog is shown."); } catch (OpenShiftToolsException osExc) { assertTrue("Registry URL not found dialog did not appear.", osExc.getMessage().contains(OpenShiftLabel.Shell.REGISTRY_URL_NOT_FOUND)); new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.REGISTRY_URL_NOT_FOUND), TimePeriod.SHORT); new DefaultShell(OpenShiftLabel.Shell.REGISTRY_URL_NOT_FOUND); new OkButton().click(); } wizard.cancel(); }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_recycler_view_sample); Ingredient beef = new Ingredient("beef"); Ingredient cheese = new Ingredient("cheese"); Ingredient salsa = new Ingredient("salsa"); Ingredient tortilla = new Ingredient("tortilla"); Recipe taco = new Recipe("taco", Arrays.asList(beef, cheese, salsa, tortilla)); Recipe quesadilla = new Recipe("quesadilla", Arrays.asList(cheese, tortilla)); final List<Recipe> recipes = Arrays.asList(taco, quesadilla); RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerview); mAdapter = new RecipeAdapter(this, recipes); mAdapter.setExpandCollapseListener(new ExpandableRecyclerAdapter.ExpandCollapseListener() { @Override public void onListItemExpanded(int position) { Recipe expandedRecipe = recipes.get(position); Toast.makeText(VerticalLinearRecyclerViewSampleActivity.this, "expanded: " + expandedRecipe.getName(), Toast.LENGTH_SHORT) .show(); } @Override public void onListItemCollapsed(int position) { Recipe collapsedRecipe = recipes.get(position); Toast.makeText(VerticalLinearRecyclerViewSampleActivity.this, "collapsed: " + collapsedRecipe.getName(), Toast.LENGTH_SHORT) .show(); } }); recyclerView.setAdapter(mAdapter); recyclerView.setLayoutManager(new LinearLayoutManager(this)); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_recycler_view_sample); Ingredient beef = new Ingredient("beef"); Ingredient cheese = new Ingredient("cheese"); Ingredient salsa = new Ingredient("salsa"); Ingredient tortilla = new Ingredient("tortilla"); Ingredient ketchup = new Ingredient("ketchup"); Ingredient bun = new Ingredient("bun"); Recipe taco = new Recipe("taco", Arrays.asList(beef, cheese, salsa, tortilla)); Recipe quesadilla = new Recipe("quesadilla", Arrays.asList(cheese, tortilla)); Recipe burger = new Recipe("burger", Arrays.asList(beef, cheese, ketchup, bun)); final List<Recipe> recipes = Arrays.asList(taco, quesadilla, burger); RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerview); mAdapter = new RecipeAdapter(this, recipes); mAdapter.setExpandCollapseListener(new ExpandableRecyclerAdapter.ExpandCollapseListener() { @Override public void onListItemExpanded(int position) { Recipe expandedRecipe = recipes.get(position); String toastMsg = getResources().getString(R.string.expanded, expandedRecipe.getName()); Toast.makeText(VerticalLinearRecyclerViewSampleActivity.this, toastMsg, Toast.LENGTH_SHORT) .show(); } @Override public void onListItemCollapsed(int position) { Recipe collapsedRecipe = recipes.get(position); String toastMsg = getResources().getString(R.string.collapsed, collapsedRecipe.getName()); Toast.makeText(VerticalLinearRecyclerViewSampleActivity.this, toastMsg, Toast.LENGTH_SHORT) .show(); } }); recyclerView.setAdapter(mAdapter); recyclerView.setLayoutManager(new LinearLayoutManager(this)); }
Source:
public BinaryStatistics() { this(Types.optional(PrimitiveType.PrimitiveTypeName.BINARY).named("")); }

Target:
public BinaryStatistics() { this(DEFAULT_FAKE_TYPE); }
Source:
public MergeCollection execute(RepositoryContext context) { final RemoteJobs jobs = context.service(RemoteJobTracker.class).search(Expressions.matchAll(), Integer.MAX_VALUE); final ObjectMapper mapper = context.service(ObjectMapper.class); final Stream<RemoteJobEntry> resultingJobs = jobs.stream().filter(RemoteJobEntry::isDone); if (!Strings.isNullOrEmpty(source)) { addSourceClause(mapper, resultingJobs); } if (!Strings.isNullOrEmpty(target)) { addTargetClause(mapper, resultingJobs); } if (!Strings.isNullOrEmpty(status)) { addStatusClause(mapper, resultingJobs); } final List<Merge> matchingMerges = resultingJobs.map(job -> job.getResultAs(mapper, Merge.class)).collect(Collectors.toList()); return new MergeCollection(matchingMerges); }

Target:
public MergeCollection execute(RepositoryContext context) { final ExpressionBuilder expressionBuilder = Expressions.builder(); if (!Strings.isNullOrEmpty(source)) { expressionBuilder.filter(nestedMatch(RemoteJobEntry.Fields.PARAMETERS, exactMatch(SOURCE_FIELD, source))); } if (!Strings.isNullOrEmpty(target)) { expressionBuilder.filter(nestedMatch(RemoteJobEntry.Fields.PARAMETERS, exactMatch(TARGET_FIELD, target))); } if (!Strings.isNullOrEmpty(status)) { expressionBuilder.filter(nestedMatch(RemoteJobEntry.Fields.PARAMETERS, exactMatch(STATUS_FIELD, status))); } final RemoteJobs jobs = context.service(RemoteJobTracker.class).search(expressionBuilder.build(), Integer.MAX_VALUE); final ObjectMapper mapper = context.service(ObjectMapper.class); return new MergeCollection(jobs.stream().filter(RemoteJobEntry::isDone).map(job -> job.getResultAs(mapper, Merge.class)).collect(Collectors.toList())); }
Source:
public void testGetBestSolution() throws Exception { SolverInstance instance = new SolverInstance(); instance.setSolverConfigFile( SOLVER_1_CONFIG ); assertSuccess( client.createContainer( CONTAINER_1_ID, new KieContainerResource( CONTAINER_1_ID, kjar1 ) ) ); assertSuccess( solverClient.createSolver( CONTAINER_1_ID, SOLVER_1_ID, instance ) ); instance.setStatus( SolverInstance.SolverStatus.SOLVING ); instance.setPlanningProblem( loadPlanningProblem( 10, 30 ) ); ServiceResponse<SolverInstance> response = solverClient.updateSolverState( CONTAINER_1_ID, SOLVER_1_ID, instance ); assertSuccess( response ); assertEquals( SolverInstance.SolverStatus.SOLVING, response.getResult().getStatus() ); Thread.sleep(5000); ServiceResponse<SolverInstance> solutionResponse = solverClient.getSolverBestSolution(CONTAINER_1_ID, SOLVER_1_ID); assertSuccess(solutionResponse); Solution solution = solutionResponse.getResult().getBestSolution(); assertTrue(solution.getScore() != null); List<?> computerList = (List<?>) valueOf(solution, "computerList"); assertEquals(10, computerList.size()); List<?> processList = (List<?>) valueOf(solution, "processList"); assertEquals(30, processList.size()); for(Object process : processList) { Object computer = valueOf(process, "computer"); assertNotNull(computer); } assertSuccess( solverClient.disposeSolver( CONTAINER_1_ID, SOLVER_1_ID ) ); }

Target:
public void testGetBestSolution() throws Exception { SolverInstance instance = new SolverInstance(); instance.setSolverConfigFile( SOLVER_1_CONFIG ); assertSuccess( client.createContainer( CONTAINER_1_ID, new KieContainerResource( CONTAINER_1_ID, kjar1 ) ) ); assertSuccess( solverClient.createSolver( CONTAINER_1_ID, SOLVER_1_ID, instance ) ); instance.setStatus( SolverInstance.SolverStatus.SOLVING ); instance.setPlanningProblem( loadPlanningProblem( 10, 30 ) ); ServiceResponse<SolverInstance> response = solverClient.updateSolverState( CONTAINER_1_ID, SOLVER_1_ID, instance ); assertSuccess( response ); assertEquals( SolverInstance.SolverStatus.SOLVING, response.getResult().getStatus() ); Solution solution = null; while (!Thread.currentThread().isInterrupted()) { ServiceResponse<SolverInstance> solutionResponse = solverClient.getSolverBestSolution(CONTAINER_1_ID, SOLVER_1_ID); assertSuccess(solutionResponse); solution = solutionResponse.getResult().getBestSolution(); if (solution != null && solution.getScore() != null) { break; } Thread.sleep(1000); } assertTrue(solution.getScore() != null); List<?> computerList = (List<?>) valueOf(solution, "computerList"); assertEquals(10, computerList.size()); List<?> processList = (List<?>) valueOf(solution, "processList"); assertEquals(30, processList.size()); for(Object process : processList) { Object computer = valueOf(process, "computer"); assertNotNull(computer); } assertSuccess( solverClient.disposeSolver( CONTAINER_1_ID, SOLVER_1_ID ) ); }
Source:
private NoteService<?> serviceForEntityType(String entityType) { switch (entityType) { case "sample": return sampleService; case "library": return libraryService; case "pool": return poolService; case "run": return runService; case "projectoverview": return projectOverviewWrapper; default: throw new UnsupportedOperationException("Unknown entity type: " + entityType); } }

Target:
private NoteService<?> serviceForEntityType(String entityType) { switch (entityType) { case "sample": return sampleService; case "library": return libraryService; case "pool": return poolService; case "run": return runService; case "projectoverview": return projectOverviewWrapper; default: throw new RestException("Unknown entity type: " + entityType, Status.NOT_FOUND); } }
Source:
public void onMouseEnterUsername() { if (player == null || player.getChatOnly() || usernameLabel.getTooltip() != null) { return; } Tooltip tooltip = new Tooltip(); usernameLabel.setTooltip(tooltip); Runnable setClanTooltip = new Runnable() { @Override public void run() { if (clanMenu.getTooltip() == null && clan != null) { Tooltip clanTooltip = new Tooltip(); clanMenu.setTooltip(clanTooltip); if (clan.getDescription() == null) { clan.setDescription("-"); } clanTooltip.setText(i18n.get("clan.clanName") + "\n" + clan.getClanName() + "\n\r" + i18n.get("clan.describtion") + "\n" + clan.getDescription() + "\n\r" + i18n.get("clan.clanMembers") + "\n" + clan.getClanMembers() + "\n\r" + i18n.get("clan.leader") + "\n" + clan.getLeaderName()); } } }; executorService.submit(setClanTooltip); executorService.shutdown(); tooltip.textProperty().bind(Bindings.createStringBinding( () -> i18n.get("userInfo.ratingFormat", getGlobalRating(player), getLeaderboardRating(player)), player.leaderboardRatingMeanProperty(), player.leaderboardRatingDeviationProperty(), player.globalRatingMeanProperty(), player.globalRatingDeviationProperty() )); }

Target:
public void onMouseEnterUsername() { if (player == null || player.getChatOnly() || usernameLabel.getTooltip() != null) { return; } Tooltip userTooltip = new Tooltip(); usernameLabel.setTooltip(userTooltip); userTooltip.textProperty().bind(Bindings.createStringBinding( () -> i18n.get("userInfo.ratingFormat", getGlobalRating(player), getLeaderboardRating(player)), player.leaderboardRatingMeanProperty(), player.leaderboardRatingDeviationProperty(), player.globalRatingMeanProperty(), player.globalRatingDeviationProperty() )); }
Source:
private static Optional<Pair<URI, FedoraResource>> getEffectiveAcl(final FedoraResource resource) { try { final IdentifierConverter<Resource, FedoraResource> translator = new DefaultIdentifierTranslator(resource.getNode().getSession()); final List<String> acls = new ArrayList<>(); final Model model = createDefaultModel(); resource.getTriples(translator, PropertiesRdfContext.class) .filter(t -> model.asStatement(t).getPredicate().hasURI(WEBAC_ACCESS_CONTROL_VALUE)) .filter(t -> t.getObject().isURI()) .forEachRemaining(t -> { acls.add(t.getObject().getURI()); }); if (!acls.isEmpty()) { if (acls.size() > 1) { LOGGER.warn("Found multiple ACLs defined for this node. Using: {}", acls.get(0)); } return Optional.of(Pair.of(URI.create(acls.get(0)), resource)); } else if (resource.getNode().getDepth() == 0) { LOGGER.debug("No ACLs defined on this node or in parent hierarchy"); return Optional.empty(); } else { LOGGER.trace("Checking parent resource for ACL. No ACL found at {}", resource.getPath()); return getEffectiveAcl(resource.getContainer()); } } catch (final RepositoryException ex) { LOGGER.debug("Exception finding effective ACL: {}", ex); return Optional.empty(); } }

Target:
private static Optional<Pair<URI, FedoraResource>> getEffectiveAcl(final FedoraResource resource) { try { final IdentifierConverter<Resource, FedoraResource> translator = new DefaultIdentifierTranslator(resource.getNode().getSession()); final List<String> acls = new ArrayList<>(); final Model model = createDefaultModel(); resource.getTriples(translator, PropertiesRdfContext.class) .filter(t -> model.asStatement(t).getPredicate().hasURI(WEBAC_ACCESS_CONTROL_VALUE)) .filter(t -> t.getObject().isURI()) .forEachRemaining(t -> { acls.add(t.getObject().getURI()); }); if (!acls.isEmpty()) { if (acls.size() > 1) { LOGGER.warn("Found multiple ACLs defined for this node. Using: {}", acls.get(0)); } return Optional.of(Pair.of(URI.create(acls.get(0)), resource)); } else if (resource.getNode().getDepth() == 0) { LOGGER.debug("No ACLs defined on this node or in parent hierarchy"); return Optional.empty(); } else { LOGGER.trace("Checking parent resource for ACL. No ACL found at {}", resource.getPath()); return getEffectiveAcl(resource.getContainer()); } } catch (final RepositoryException ex) { LOGGER.debug("Exception finding effective ACL: {}", ex.getMessage()); return Optional.empty(); } }
Source:
private void unzipUpdates(File updateFile) { try (ZipInputStream zis = new ZipInputStream(new FileInputStream(updateFile.getAbsolutePath()))) { String extractionFolder = getExtractionFolder(); File folder = new File(extractionFolder); if (!folder.exists()) { folder.mkdir(); } byte[] buffer = new byte[BUFFER_SIZE]; ZipEntry zipEntry; while ((zipEntry = zis.getNextEntry()) != null) { String fileName = zipEntry.getName(); if (zipEntry.isDirectory()) { continue; } File newFile = new File(extractionFolder + File.separator + fileName); new File(newFile.getParent()).mkdirs(); FileOutputStream fos = new FileOutputStream(newFile); int len; while ((len = zis.read(buffer)) > 0) { fos.write(buffer, 0, len); } fos.close(); zis.closeEntry(); } } catch (IOException ex) { ex.printStackTrace(); } }

Target:
private void unzipUpdates(File updateFile) { try (ZipInputStream zis = new ZipInputStream(new FileInputStream(updateFile.getAbsolutePath()))) { String extractionFolder = getExtractionFolder(); File folder = new File(extractionFolder); if (!folder.exists()) { if (!folder.mkdirs()) { throw new IOException("Cannot create plugins folder"); } } ZipEntry zipEntry; while ((zipEntry = zis.getNextEntry()) != null) { String fileName = zipEntry.getName(); if (zipEntry.isDirectory()) { continue; } File newFile = new File(extractionFolder + File.separator + fileName); File parent = newFile.getParentFile(); if (!parent.exists()) { if (!parent.mkdirs()) { throw new IOException("Cannot create plugins folder"); } } FileOutputStream fos = new FileOutputStream(newFile); ByteStreams.copy(zis, fos); fos.close(); zis.closeEntry(); } } catch (IOException ex) { GPLogger.log(ex); cancel(true); } }
Source:
private void testContent() throws Exception { ______TS("Awaiting session"); fq = BackDoor.getFeedbackQuestion("IFQSubmitUiT.CS2104", "Awaiting Session", 1); submitPage = loginToInstructorFeedbackQuestionSubmitPage("IFQSubmitUiT.instr", "Awaiting Session", fq.getId()); submitPage.verifyHtmlMainContent("/instructorFeedbackQuestionSubmitPageAwaiting.html"); ______TS("Open session"); fq = BackDoor.getFeedbackQuestion("IFQSubmitUiT.CS2104", "Open Session", 1); submitPage = loginToInstructorFeedbackQuestionSubmitPage("IFQSubmitUiT.instr", "Open Session", fq.getId()); submitPage.verifyHtmlMainContent("/instructorFeedbackQuestionSubmitPageOpen.html"); ______TS("Grace period session"); fq = BackDoor.getFeedbackQuestion("IFQSubmitUiT.CS2104", "Grace Period Session", 1); submitPage = loginToInstructorFeedbackQuestionSubmitPage("IFQSubmitUiT.instr", "Grace Period Session", fq.getId()); submitPage.verifyHtmlMainContent("/instructorFeedbackQuestionSubmitPageGracePeriod.html"); ______TS("Closed) session"); fq = BackDoor.getFeedbackQuestion("IFQSubmitUiT.CS2104", "Closed Session", 1); submitPage = loginToInstructorFeedbackQuestionSubmitPage("IFQSubmitUiT.instr", "Closed Session", fq.getId()); submitPage.verifyHtmlMainContent("/instructorFeedbackQuestionSubmitPageClosed.html"); ______TS("Private session"); fq = BackDoor.getFeedbackQuestion("IFQSubmitUiT.CS2104", "Private Session", 1); submitPage = loginToInstructorFeedbackQuestionSubmitPage("IFQSubmitUiT.instr", "Private Session", fq.getId()); submitPage.verifyHtmlMainContent("/instructorFeedbackQuestionSubmitPagePrivate.html"); }

Target:
private void testContent() throws Exception { ______TS("Awaiting session"); fq = BackDoor.getFeedbackQuestion("IFQSubmitUiT.CS2104", "Awaiting Session", 1); submitPage = loginToInstructorFeedbackQuestionSubmitPage("IFQSubmitUiT.instr", "Awaiting Session", fq.getId()); submitPage.verifyHtml("/instructorFeedbackQuestionSubmitPageAwaiting.html"); ______TS("Open session"); fq = BackDoor.getFeedbackQuestion("IFQSubmitUiT.CS2104", "Open Session", 1); submitPage = loginToInstructorFeedbackQuestionSubmitPage("IFQSubmitUiT.instr", "Open Session", fq.getId()); submitPage.verifyHtml("/instructorFeedbackQuestionSubmitPageOpen.html"); ______TS("Grace period session"); fq = BackDoor.getFeedbackQuestion("IFQSubmitUiT.CS2104", "Grace Period Session", 1); submitPage = loginToInstructorFeedbackQuestionSubmitPage("IFQSubmitUiT.instr", "Grace Period Session", fq.getId()); submitPage.verifyHtml("/instructorFeedbackQuestionSubmitPageGracePeriod.html"); ______TS("Closed) session"); fq = BackDoor.getFeedbackQuestion("IFQSubmitUiT.CS2104", "Closed Session", 1); submitPage = loginToInstructorFeedbackQuestionSubmitPage("IFQSubmitUiT.instr", "Closed Session", fq.getId()); submitPage.verifyHtml("/instructorFeedbackQuestionSubmitPageClosed.html"); ______TS("Private session"); fq = BackDoor.getFeedbackQuestion("IFQSubmitUiT.CS2104", "Private Session", 1); submitPage = loginToInstructorFeedbackQuestionSubmitPage("IFQSubmitUiT.instr", "Private Session", fq.getId()); submitPage.verifyHtml("/instructorFeedbackQuestionSubmitPagePrivate.html"); }
Source:
protected List<String> findStringsInFileCommon(String regexp, boolean stopOnFirst, int searchLimit, File fileToSearch) throws Exception { return findStringsInFileCommon(regexp, stopOnFirst, searchLimit, fileToSearch, Project.MSG_INFO); }

Target:
protected List<String> findStringsInFileCommon(String regexp, boolean stopOnFirst, int searchLimit, File fileToSearch) { return findStringsInFileCommon(regexp, stopOnFirst, searchLimit, fileToSearch, Project.MSG_INFO); }
Source:
public static <T> T createProxyWithFailover( MetricsManager metricsManager, ServerListConfig serverListConfig, Class<T> type, AuxiliaryRemotingParameters parameters) { return VersionSelectingClients.instrumentWithClientVersionTag( metricsManager.getTaggedRegistry(), ConjureJavaRuntimeTargetFactory.DEFAULT.createProxyWithFailover(serverListConfig, type, parameters), type); }

Target:
public static <T> T createProxyWithFailover( MetricsManager metricsManager, ServerListConfig serverListConfig, Class<T> type, AuxiliaryRemotingParameters parameters) { Supplier<T> clientFactory = () -> instrument( metricsManager.getTaggedRegistry(), ConjureJavaRuntimeTargetFactory.DEFAULT.createProxyWithFailover(serverListConfig, type, parameters), type); return SelfRefreshingProxy.create(clientFactory, type); }
Source:
public void onStartup(ServletContext sc) throws ServletException { AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext(); context.register(WebAppConfig.class); sc.addListener(new ContextLoaderListener(context)); DispatcherServlet dispatcherServlet = new DispatcherServlet(context); ServletRegistration.Dynamic dispatcher = sc.addServlet("dispatcher", dispatcherServlet); dispatcher.setLoadOnStartup(1); dispatcher.addMapping("/"); FilterRegistration.Dynamic filter = sc.addFilter("stormpathFilter", new DelegatingFilterProxy()); EnumSet<DispatcherType> types = EnumSet.of(DispatcherType.ERROR, DispatcherType.FORWARD, DispatcherType.INCLUDE, DispatcherType.REQUEST); filter.addMappingForUrlPatterns(types, false, "/*"); }

Target:
public void onStartup(ServletContext sc) throws ServletException { AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext(); context.register(WebAppConfig.class); sc.addListener(new ContextLoaderListener(context)); DispatcherServlet dispatcherServlet = new DispatcherServlet(context); ServletRegistration.Dynamic dispatcher = sc.addServlet("dispatcher", dispatcherServlet); dispatcher.setLoadOnStartup(1); dispatcher.addMapping("/"); FilterRegistration.Dynamic stormpathFilter = sc.addFilter(StormpathFilter.DEFAULT_FILTER_NAME, DelegatingFilterProxy.class); EnumSet<DispatcherType> types = EnumSet.of(DispatcherType.ERROR, DispatcherType.FORWARD, DispatcherType.INCLUDE, DispatcherType.REQUEST); stormpathFilter.addMappingForUrlPatterns(types, false, "/*"); }
Source:
public GatewayConfigmapLabels( @Named("che.infra.kubernetes.singlehost.gateway.configmap_labels") String labelsProperty) throws InfrastructureException { if (labelsProperty == null || labelsProperty.isEmpty()) { throw new InfrastructureException( "for gateway single-host, 'che.infra.kubernetes.singlehost.gateway.configmap_labels' property must be defined"); } try { this.labels = Splitter.on(",").trimResults().withKeyValueSeparator("=").split(labelsProperty); } catch (IllegalArgumentException iae) { throw new InfrastructureException( "'che.infra.kubernetes.singlehost.gateway.configmap_labels' is set to invalid value. It must be in format `name1=value1,name2=value2`. Check the documentation for further details.", iae); } }

Target:
public GatewayConfigmapLabels( @Named("che.infra.kubernetes.singlehost.gateway.configmap_labels") String labelsProperty) { if (isNullOrEmpty(labelsProperty)) { throw new ConfigurationException( "for gateway single-host, 'che.infra.kubernetes.singlehost.gateway.configmap_labels' property must be defined"); } try { this.labels = Splitter.on(",").trimResults().withKeyValueSeparator("=").split(labelsProperty); } catch (IllegalArgumentException iae) { throw new ConfigurationException( "'che.infra.kubernetes.singlehost.gateway.configmap_labels' is set to invalid value. It must be in format `name1=value1,name2=value2`. Check the documentation for further details.", iae); } }
Source:
public Result invoke(Invocation inv) throws RpcException { if (destroyed.get()) { logger.warn("Invoker for service " + this + " on consumer " + NetUtils.getLocalHost() + " is destroyed, " + ", dubbo version is " + Version.getVersion() + ", this invoker should not be used any longer"); } RpcInvocation invocation = (RpcInvocation) inv; invocation.setInvoker(this); Map<String, String> contextAttachments = RpcContext.getContext().getAttachments(); if (contextAttachments != null && contextAttachments.size() != 0) { invocation.addAttachments(contextAttachments); } if (getUrl().getMethodParameter(invocation.getMethodName(), Constants.ASYNC_KEY, false)) { invocation.setAttachment(Constants.ASYNC_KEY, Boolean.TRUE.toString()); } RpcUtils.attachInvocationIdIfAsync(getUrl(), invocation); if (attachment != null && attachment.size() > 0) { invocation.addAttachments(attachment); } try { return doInvoke(invocation); } catch (InvocationTargetException e) { Throwable te = e.getTargetException(); if (te == null) { return new RpcResult(e); } else { if (te instanceof RpcException) { ((RpcException) te).setCode(RpcException.BIZ_EXCEPTION); } return new RpcResult(te); } } catch (RpcException e) { if (e.isBiz()) { return new RpcResult(e); } else { throw e; } } catch (Throwable e) { return new RpcResult(e); } }

Target:
public Result invoke(Invocation inv) throws RpcException { if (destroyed.get()) { logger.warn("Invoker for service " + this + " on consumer " + NetUtils.getLocalHost() + " is destroyed, " + ", dubbo version is " + Version.getVersion() + ", this invoker should not be used any longer"); } RpcInvocation invocation = (RpcInvocation) inv; invocation.setInvoker(this); if (attachment != null && attachment.size() > 0) { invocation.addAttachmentsIfAbsent(attachment); } Map<String, String> contextAttachments = RpcContext.getContext().getAttachments(); if (contextAttachments != null && contextAttachments.size() != 0) { invocation.addAttachments(contextAttachments); } if (getUrl().getMethodParameter(invocation.getMethodName(), Constants.ASYNC_KEY, false)) { invocation.setAttachment(Constants.ASYNC_KEY, Boolean.TRUE.toString()); } RpcUtils.attachInvocationIdIfAsync(getUrl(), invocation); try { return doInvoke(invocation); } catch (InvocationTargetException e) { Throwable te = e.getTargetException(); if (te == null) { return new RpcResult(e); } else { if (te instanceof RpcException) { ((RpcException) te).setCode(RpcException.BIZ_EXCEPTION); } return new RpcResult(te); } } catch (RpcException e) { if (e.isBiz()) { return new RpcResult(e); } else { throw e; } } catch (Throwable e) { return new RpcResult(e); } }
Source:
EMFCompareDiffTreeRuler(Composite parent, int style, WrappableTreeViewer treeViewer, DependencyData dependencyData, ICompareColor compareColor) { super(parent, style); fTreeViewer = treeViewer; this.dependencyData = dependencyData; updateColors(compareColor); annotationsData = Maps.newHashMap(); paintListener = new PaintListener() { public void paintControl(PaintEvent e) { handlePaintEvent(e); } }; addPaintListener(paintListener); mouseClickListener = new MouseListener() { public void mouseUp(MouseEvent e) { handleMouseClickEvent(e); } public void mouseDown(MouseEvent e) { } public void mouseDoubleClick(MouseEvent e) { } }; addMouseListener(mouseClickListener); mouseMoveListener = new MouseMoveListener() { public void mouseMove(MouseEvent e) { handleMouveMoveEvent(e); } }; addMouseMoveListener(mouseMoveListener); mouseTrackListener = new MouseTrackListener() { public void mouseHover(MouseEvent e) { handleMouseHoverEvent(e); } public void mouseExit(MouseEvent e) { } public void mouseEnter(MouseEvent e) { } }; addMouseTrackListener(mouseTrackListener); }

Target:
EMFCompareDiffTreeRuler(Composite parent, int style, WrappableTreeViewer treeViewer, DependencyData dependencyData, ICompareColor compareColor) { super(parent, style); fTreeViewer = treeViewer; this.dependencyData = dependencyData; this.compareColor = compareColor; annotationsData = Maps.newHashMap(); paintListener = new PaintListener() { public void paintControl(PaintEvent e) { handlePaintEvent(e); } }; addPaintListener(paintListener); mouseClickListener = new MouseListener() { public void mouseUp(MouseEvent e) { handleMouseClickEvent(e); } public void mouseDown(MouseEvent e) { } public void mouseDoubleClick(MouseEvent e) { } }; addMouseListener(mouseClickListener); mouseMoveListener = new MouseMoveListener() { public void mouseMove(MouseEvent e) { handleMouveMoveEvent(e); } }; addMouseMoveListener(mouseMoveListener); mouseTrackListener = new MouseTrackListener() { public void mouseHover(MouseEvent e) { handleMouseHoverEvent(e); } public void mouseExit(MouseEvent e) { } public void mouseEnter(MouseEvent e) { } }; addMouseTrackListener(mouseTrackListener); }
Source:
public String[] getProbeVariableCompletions(String probe, String prefix){ TreeNode node = TapsetLibrary.getProbes(); node = node.getChildByName(getTapset(probe)); if (node == null ) return NO_MATCHES; node = node.getChildByName(probe); if (node == null ) return NO_MATCHES; String[] matchingChildren = getMatchingChildren(node, prefix); if(matchingChildren.length == 0) return NO_MATCHES; return matchingChildren; }

Target:
public String[] getProbeVariableCompletions(String probe, String prefix){ TreeNode node = TapsetLibrary.getProbes(); node = node.getChildByName(getTapset(probe)); if (node == null ) return NO_MATCHES; node = node.getChildByName(probe); if (node == null ) return NO_MATCHES; return getMatchingChildren(node, prefix); }
Source:
public void receiveResponse(@ExchangeType int exchangeType, List<IkePayload> payloadList) { if (!isAwaitingCreateResp()) { sendMessage( CMD_HANDLE_RECEIVED_RESPONSE, new ReceivedResponse(exchangeType, payloadList)); } IkeSaPayload saPayload = IkePayload.getPayloadForTypeInProvidedList( PAYLOAD_TYPE_SA, IkeSaPayload.class, payloadList); if (saPayload != null) { int spi = registerProvisionalChildAndGetSpi(saPayload); sendMessage( CMD_HANDLE_RECEIVED_RESPONSE, new ReceivedCreateResponse(exchangeType, payloadList, spi)); } else { sendMessage( CMD_HANDLE_RECEIVED_RESPONSE, new ReceivedCreateResponse(exchangeType, payloadList)); } }

Target:
public void receiveResponse(@ExchangeType int exchangeType, List<IkePayload> payloadList) { if (!isAwaitingCreateResp()) { sendMessage( CMD_HANDLE_RECEIVED_RESPONSE, new ReceivedResponse(exchangeType, payloadList)); } int spi = registerProvisionalChildAndGetSpi(payloadList); sendMessage( CMD_HANDLE_RECEIVED_RESPONSE, new ReceivedCreateResponse(exchangeType, payloadList, spi)); }
Source:
public static String parsePackageName(String namespace, String defaultPackageName) { return (defaultPackageName != null && !defaultPackageName.isEmpty()) ? defaultPackageName : getPackageNameByNameSpaceURI(namespace); }

Target:
public static String parsePackageName(String namespace, String defaultPackageName) { return (defaultPackageName != null && !defaultPackageName.trim().isEmpty()) ? defaultPackageName : getPackageNameByNameSpaceURI(namespace.trim()); }
Source:
public Optional<WetData> build(DataView container) throws InvalidDataException { if (container.contains(Keys.IS_WET.getQuery())) { Optional<Boolean> isWet = container.getBoolean(Keys.IS_WET.getQuery()); if (isWet.isPresent()) { return Optional.<WetData>of(new SpongeWetData(isWet.get())); } } return Optional.absent(); }

Target:
public Optional<WetData> build(DataView container) throws InvalidDataException { Boolean isWet = DataUtil.getData(container, Keys.IS_WET); return Optional.<WetData>of(new SpongeWetData(isWet)); }