auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void zeroMissingIndexes() { List<Map<String, Object>> result = jdbcTemplate.queryForList(missingIndexesQuery); String statements = result.stream() .flatMap(m -> m.entrySet() .stream() .filter(e -> e.getKey().equals("ddl")) .map(e -> e.getValue().toString())) .collect(Collectors.joining(";\n")); assertThat(result.size()) .withFailMessage("Found missing indexes. Crete them using these statements:\n\n%s", statements) .isZero(); }

Target:
public void zeroMissingIndexes() { List<Map<String, Object>> result = jdbcTemplate.queryForList(missingIndexesQuery); String statements = result.stream() .flatMap(m -> m.entrySet() .stream() .filter(e -> e.getKey().equals("ddl")) .map(e -> e.getValue().toString())) .collect(Collectors.joining(";\n")); assertThat(result.size()) .withFailMessage("Found missing indexes. Create them using these statements:\n\n%s", statements) .isZero(); }
Source:
public void validatesXmlForSchemaValidity() throws Exception { final int zero = 0; final int ten = 10; final int hundred = 100; final int fifty = 50; final Random rand = new SecureRandom(); 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' type='xs:integer'", " minOccurs='0' maxOccurs='unbounded'/>", "</xs:sequence></xs:complexType></xs:element>", "</xs:schema>" ) ); final Callable<Void> callable = new Callable<Void>() { @Override public Void call() throws Exception { final int cnt = rand.nextInt(hundred); MatcherAssert.assertThat( xsd.validate( new DOMSource( new XMLDocument( StringUtils.join( "<r>", StringUtils.repeat("<x>hey</x>", cnt), "</r>" ) ).node() ) ), Matchers.hasSize(cnt << 1) ); 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(); }

Target:
public void validatesXmlForSchemaValidity() throws Exception { final int timeout = 10; final int random = 100; final int loop = 50; final Random rand = new SecureRandom(); 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' type='xs:integer'", " minOccurs='0' maxOccurs='unbounded'/>", "</xs:sequence></xs:complexType></xs:element>", "</xs:schema>" ) ); final Callable<Void> callable = new Callable<Void>() { @Override public Void call() throws Exception { final int cnt = rand.nextInt(random); MatcherAssert.assertThat( xsd.validate( new DOMSource( new XMLDocument( StringUtils.join( "<r>", StringUtils.repeat("<x>hey</x>", cnt), "</r>" ) ).node() ) ), Matchers.hasSize(cnt << 1) ); 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(); }
Source:
private static void createFile(List<String> args) { if (isHelp(args, true)) { out(""); out("Usage: seqware create file [--help]"); out(" seqware create file --interactive"); out(" seqware create file <fields>"); out(""); out("Required fields:"); out(" --file <val>"); out(" --meta-type <val>"); out(" --parent-accession <val>"); out(""); out("Optional fields:"); out(" --description <val>"); out(""); } else { String file = reqVal(args, "--file"); String meta = reqVal(args, "--meta-type"); String parentId = reqVal(args, "--parent-accession"); String description = optVal(args, "--description", ""); extras(args, "create file"); String concat = String.format("%s::%s::%s::%s", "ManualProvisionFile", meta, file, description); run("--plugin", "net.sourceforge.seqware.pipeline.plugins.Metadata", "--", "--parent-accession", parentId, "--create", "--table", "file", "--file", concat); } }

Target:
private static void createFile(List<String> args) { if (isHelp(args, true)) { out(""); out("Usage: seqware create file [--help]"); out(" seqware create file --interactive"); out(" seqware create file <fields>"); out(""); out("Required fields:"); out(" --file <val>"); out(" --meta-type <val>"); out(" --parent-accession <val>"); out(""); out("Optional fields:"); out(" --description <val>"); out(""); } else { String file = reqVal(args, "--file"); String meta = reqVal(args, "--meta-type"); String parentId = reqVal(args, "--parent-accession"); String type = optVal(args, "--type", ""); String description = optVal(args, "--description", ""); extras(args, "create file"); String concat = String.format("%s::%s::%s::%s", type, meta, file, description); run("--plugin", "net.sourceforge.seqware.pipeline.plugins.Metadata", "--", "--parent-accession", parentId, "--create", "--table", "file", "--field","algorithm::ManualProvisionFile", "--file", concat); } }
Source:
public void testFindAllUsers() { List<User> findAllUsers = userRepository.findAllUsers(); assertNotNull(findAllUsers); assertEquals(2, findAllUsers.size()); assertEquals(2, findAllUsers.iterator().next().getRoles().size()); assertEquals(2, findAllUsers.iterator().next().getRoles().size()); }

Target:
public void testFindAllUsers() { List<User> findAllUsers = userRepository.findAllUsers(); assertNotNull(findAllUsers); assertEquals(2, findAllUsers.size()); assertEquals(3, findAllUsers.iterator().next().getRoles().size()); assertEquals(3, findAllUsers.iterator().next().getRoles().size()); }
Source:
private String evaluateXPath(String metadata, XPathExpression xPathExpression) { StringReader metadataReader = new StringReader(metadata); InputSource inputXml = new InputSource(metadataReader); String text = null; try { Node result = (Node) xPathExpression.evaluate(inputXml, XPathConstants.NODE); if (result != null && result.getTextContent() != null) { text = result.getTextContent().trim(); } } catch (XPathExpressionException e) { LOGGER.error("Error evaluating xpath"); } return text; }

Target:
private String evaluateXPath(String metadata, XPathExpression xPathExpression) { InputSource inputXml = new InputSource(new StringReader(metadata)); String text = null; try { Node result = (Node) xPathExpression.evaluate(inputXml, XPathConstants.NODE); if (result != null && result.getTextContent() != null) { text = result.getTextContent().trim(); } } catch (XPathExpressionException e) { LOGGER.warn("Could not evaluate xpath"); } return text; }
Source:
private void formFieldsShouldNotBeGeneratedForPersistenceId(List<FieldDefinition> formModelFields) { assertTrue(dataObject.getProperty("id") != null); int EXPECTED_FORM_FIELD_COUNT = finderService.getDataObjectProperties(formModel.getClassName(), path).size() - 1; assertEquals("Form field should be generated for every data field except of persistence id", EXPECTED_FORM_FIELD_COUNT, formModelFields.size()); }

Target:
private void formFieldsShouldNotBeGeneratedForPersistenceId(List<FieldDefinition> formModelFields) { assertNotNull(dataObject.getProperty("id")); int EXPECTED_FORM_FIELD_COUNT = finderService.getDataObjectProperties(formModel.getClassName(), path).size() - 1; assertEquals("Form field should be generated for every data field except of persistence id", EXPECTED_FORM_FIELD_COUNT, formModelFields.size()); }
Source:
public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable { this.methodName = method.getName(); return null; }

Target:
public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable { this.methodName = method.getName(); if (objects != null && objects.length > 1) { arguments = new ArrayList<>(Arrays.asList(objects)); arguments.remove(objects.length - 1); } return null; }
Source:
public Tuple getNext() throws IOException { if (reader == null) { return null; } if ("true".equals(jobConf.get("jsonLoader.nestedLoad.disabled"))) isNestedLoadDisabled = true; try { while (reader.nextKeyValue()) { Text value = (Text) reader.getCurrentValue(); incrCounter(JsonLoaderCounters.LinesRead, 1L); Tuple t = parseStringToTuple(value.toString()); if (t != null) { incrCounter(JsonLoaderCounters.LinesJsonDecoded, 1L); return t; } } return null; } catch (InterruptedException e) { int errCode = 6018; String errMsg = "Error while reading input"; throw new ExecException(errMsg, errCode, PigException.REMOTE_ENVIRONMENT, e); } }

Target:
public Tuple getNext() throws IOException { if (reader == null) { return null; } if ("true".equals(jobConf.get(NESTED_LOAD_KEY))) isNestedLoadEnabled = true; try { while (reader.nextKeyValue()) { Text value = (Text) reader.getCurrentValue(); incrCounter(JsonLoaderCounters.LinesRead, 1L); Tuple t = parseStringToTuple(value.toString()); if (t != null) { incrCounter(JsonLoaderCounters.LinesJsonDecoded, 1L); return t; } } return null; } catch (InterruptedException e) { int errCode = 6018; String errMsg = "Error while reading input"; throw new ExecException(errMsg, errCode, PigException.REMOTE_ENVIRONMENT, e); } }
Source:
public void setVolume(String sinkId, float volume) { AudioSink sink = null; if (sinkId == null) { sink = getSink(); } else { sink = audioSinks.get(sinkId); } if (sink != null) { try { sink.setVolume(volume); } catch (IOException e) { logger.error("An exception occured while setting the volume of sink : '{}'", sink.getId(), e.getMessage()); } } }

Target:
public void setVolume(String sinkId, float volume) { AudioSink sink = getSink(sinkId); if (sink != null) { try { sink.setVolume(volume); } catch (IOException e) { logger.error("An exception occured while setting the volume of sink : '{}'", sink.getId(), e.getMessage()); } } }
Source:
private static boolean isVarArg(HaxeParameterModel model) { if (model.getType().getType() instanceof SpecificHaxeClassReference) { SpecificHaxeClassReference classType = (SpecificHaxeClassReference)model.getType().getType(); if(classType != null && classType.getHaxeClass() != null) { String typeName = classType.getHaxeClass().getQualifiedName(); ResultHolder[] specifics = classType.getSpecifics(); if (specifics.length == 1) { SpecificHaxeClassReference specificType = (SpecificHaxeClassReference)specifics[0].getType(); if (specificType != null && specificType.getHaxeClass() != null) { if (typeName.equals("Array") && specificType.getHaxeClass().getQualifiedName().equals("haxe.macro.Expr")) { return true; } if (typeName.equals("haxe.extern.Rest")) { return true; } } } } } return false; }

Target:
private static boolean isVarArg(HaxeParameterModel model) { if (model.getType().getType() instanceof SpecificHaxeClassReference) { SpecificHaxeClassReference classType = (SpecificHaxeClassReference)model.getType().getType(); if(classType.getHaxeClass() != null) { ResultHolder[] specifics = classType.getSpecifics(); if (specifics.length == 1) { SpecificHaxeClassReference specificType = (SpecificHaxeClassReference)specifics[0].getType(); if (specificType.getHaxeClass() != null) { if (classType.isArray() && specificType.isExpr() ) { return true; } if (classType.isRest()) { return true; } } } } } return false; }
Source:
public String toString() { String res = new String(); res += responseString + ","; res += responseUUID + ","; res += responseBoolean + ","; res += responseInteger + ","; res += responseManaType + ","; res += responseManaTypePlayerId; return res; }

Target:
public String toString() { return new StringBuilder(responseString) .append(',') .append(responseUUID) .append(',') .append(responseBoolean) .append(',') .append(responseInteger) .append(',') .append(responseManaType) .append(',') .append(responseManaTypePlayerId).toString(); }
Source:
DruidBrokerPageSource( GeneratedDql brokerDql, List<ColumnHandle> columnHandles, DruidClient druidClient) { requireNonNull(brokerDql, "broker is null"); this.columnHandles = ImmutableList.copyOf(requireNonNull(columnHandles, "columnHandles is null")); requireNonNull(druidClient, "druid client is null"); this.responseStream = new BufferedReader(new InputStreamReader(druidClient.getData(brokerDql.getDql()))); List<DruidColumnHandle> handles = columnHandles.stream() .map(column -> (DruidColumnHandle) column) .collect(toImmutableList()); this.columnTypes = handles.stream() .map(DruidColumnHandle::getColumnType) .collect(toImmutableList()); this.pageBuilder = new PageBuilder(this.columnTypes); }

Target:
public DruidBrokerPageSource( GeneratedDql brokerDql, List<ColumnHandle> columnHandles, DruidClient druidClient) { requireNonNull(brokerDql, "broker is null"); this.columnHandles = ImmutableList.copyOf(requireNonNull(columnHandles, "columnHandles is null")); requireNonNull(druidClient, "druid client is null"); this.responseStream = new BufferedReader(new InputStreamReader(druidClient.getData(brokerDql.getDql()))); List<DruidColumnHandle> handles = columnHandles.stream() .map(column -> (DruidColumnHandle) column) .collect(toImmutableList()); this.columnTypes = handles.stream() .map(DruidColumnHandle::getColumnType) .collect(toImmutableList()); this.pageBuilder = new PageBuilder(this.columnTypes); }
Source:
public void print(final OutputStream output) throws IOException { try { output.write(this.bytes.value()); } finally { output.flush(); } }

Target:
public void print(final OutputStream output) throws IOException { final byte[] buf = new byte[4096]; final InputStream body = this.response.body(); try { while (true) { final int bts = body.read(buf); if (bts < 0) { break; } output.write(buf, 0, bts); } } finally { output.flush(); } }
Source:
public void addAndRemoveLabelTest() { ListPanelCell listPanelCell = find("#dummy/dummy_col0_9"); assertEquals(1, listPanelCell.getIssueLabels().size()); Platform.runLater(stage::hide); UI.events.triggerEvent(new ShowLabelPickerEvent(listPanelCell.getIssue())); sleep(EVENT_DELAY); TextField labelPickerTextField = find("#labelPickerTextField"); click(labelPickerTextField); type("2 "); push(KeyCode.ENTER); sleep(EVENT_DELAY); assertEquals(0, listPanelCell.getIssueLabels().size()); sleep(Notification.DEFAULT_NOTIFICATION_PANE_VISIBLE_PERIOD * 1000); Platform.runLater(stage::hide); UI.events.triggerEvent(new ShowLabelPickerEvent(listPanelCell.getIssue())); sleep(EVENT_DELAY); labelPickerTextField = find("#labelPickerTextField"); click(labelPickerTextField); type("2 "); push(KeyCode.ENTER); sleep(EVENT_DELAY); assertEquals(1, listPanelCell.getIssueLabels().size()); }

Target:
public void addAndRemoveLabelTest() { ListPanelCell listPanelCell = find("#dummy/dummy_col0_9"); assertEquals(1, listPanelCell.getIssueLabels().size()); Platform.runLater(stage::hide); UI.events.triggerEvent(new ShowLabelPickerEvent(listPanelCell.getIssue())); waitUntilNodeAppears("#labelPickerTextField"); TextField labelPickerTextField = find("#labelPickerTextField"); click(labelPickerTextField); type("2 "); push(KeyCode.ENTER); waitUntilNodeDisappears("#labelPickerTextField"); assertEquals(0, listPanelCell.getIssueLabels().size()); NotificationPane notificationPane = find("#notificationPane"); while (notificationPane.isShowing()) { PlatformEx.waitOnFxThread(); sleep(100); } Platform.runLater(stage::hide); UI.events.triggerEvent(new ShowLabelPickerEvent(listPanelCell.getIssue())); waitUntilNodeAppears("#labelPickerTextField"); labelPickerTextField = find("#labelPickerTextField"); click(labelPickerTextField); type("2 "); push(KeyCode.ENTER); waitUntilNodeDisappears("#labelPickerTextField"); assertEquals(1, listPanelCell.getIssueLabels().size()); }
Source:
public Set<String> findSagas(Class<?> sagaType, AssociationValue associationValue) { return managedSagas.entrySet() .stream() .filter(avEntry -> sagaType.isAssignableFrom(avEntry.getValue().saga().getClass())) .filter(avEntry -> avEntry.getValue().associationValues().contains(associationValue)) .map(Map.Entry::getKey) .collect(Collectors.toSet()); }

Target:
public Set<String> findSagas(Class<?> sagaType, AssociationValue associationValue) { return managedSagas.entrySet() .stream() .filter(avEntry -> sagaType.isInstance(avEntry.getValue().saga())) .filter(avEntry -> avEntry.getValue().associationValues().contains(associationValue)) .map(Map.Entry::getKey) .collect(Collectors.toSet()); }
Source:
public void testGetUserSelectResolverNotSet() { MockEnabledModelResolver resolver1 = new MockEnabledModelResolver(); manager.add(resolver1, resolver1.getClass().getName() + "1", "", ""); MockEnabledModelResolver resolver2 = new MockEnabledModelResolver(); manager.add(resolver2, resolver2.getClass().getName() + "2", "", ""); MockEnabledModelResolver resolver3 = new MockEnabledModelResolver(); String resolver3Id = resolver3.getClass().getName() + "3"; manager.add(resolver3, resolver3Id, "", ""); assertEquals(manager.getUserSelectedResolver(), null); }

Target:
public void testGetUserSelectResolverNotSet() { MockEnabledModelResolver resolver1 = new MockEnabledModelResolver(); manager.add(resolver1, resolver1.getClass().getName() + "1", "", ""); MockEnabledModelResolver resolver2 = new MockEnabledModelResolver(); manager.add(resolver2, resolver2.getClass().getName() + "2", "", ""); MockEnabledModelResolver resolver3 = new MockEnabledModelResolver(); String resolver3Id = resolver3.getClass().getName() + "3"; manager.add(resolver3, resolver3Id, "", ""); assertNull(manager.getUserSelectedResolver()); }
Source:
private ITmfTrace put(String path, String name, String typeID) throws TmfTraceException, TmfTraceImportException, InstantiationException, IllegalAccessException, CoreException { List<TraceTypeHelper> traceTypes = TmfTraceType.selectTraceType(path, typeID); if (traceTypes.isEmpty()) { return null; } IResource resource = getResource(path); if (resource == null) { return null; } TraceTypeHelper helper = traceTypes.get(0); ITmfTrace trace = helper.getTraceClass().newInstance(); trace.initTrace(resource, path, ITmfEvent.class, name, typeID); trace.indexTrace(false); TmfSignalManager.dispatchSignal(new TmfTraceOpenedSignal(this, trace, null)); return trace; }

Target:
private ITmfTrace put(String path, String name, String typeID) throws TmfTraceException, TmfTraceImportException, InstantiationException, IllegalAccessException, CoreException { List<TraceTypeHelper> traceTypes = TmfTraceType.selectTraceType(path, typeID); if (traceTypes.isEmpty()) { return null; } IResource resource = getResource(path); TraceTypeHelper helper = traceTypes.get(0); ITmfTrace trace = helper.getTraceClass().newInstance(); trace.initTrace(resource, path, ITmfEvent.class, name, typeID); trace.indexTrace(false); TmfSignalManager.dispatchSignal(new TmfTraceOpenedSignal(this, trace, null)); return trace; }
Source:
private void storeChildTuple(final int childIndex, final TupleBatch tb) { List<Column<?>> inputColumns = tb.getDataColumns(); for (int row = 0; row < tb.numTuples(); ++row) { for (int column = 0; column < tb.numColumns(); column++) { tables[childIndex].put(column, inputColumns.get(column), row); if (isIndexed(new JoinField(childIndex, column))) { int thisRow = tables[childIndex].numTuples(); if (column == tb.numColumns() - 1) { thisRow = tables[childIndex].numTuples() - 1; } int lastRow = thisRow - 1; if (lastRow == -1 || TupleUtils.cellCompare(tables[childIndex], column, lastRow, tb, column, row) != 0) { firstVarIndices[childIndex].add(thisRow); } } } } }

Target:
private void storeChildTuple(final int childIndex, final TupleBatch tb) { List<Column<?>> inputColumns = tb.getDataColumns(); for (int row = 0; row < tb.numTuples(); ++row) { for (int column = 0; column < tb.numColumns(); column++) { tables[childIndex].put(column, inputColumns.get(column), row); if (isIndexed(new JoinField(childIndex, column))) { int thisRow = tables[childIndex].numTuples(); if (column == tb.numColumns() - 1) { thisRow--; } int lastRow = thisRow - 1; if (lastRow == -1 || TupleUtils.cellCompare(tables[childIndex], column, lastRow, tb, column, row) != 0) { firstVarIndices[childIndex].add(thisRow); } } } } }
Source:
public static AEColor getColor( ItemStack item ) { final NBTTagCompound c = item.getTagCompound(); if( c != null && c.hasKey( "color" ) ) { String color = c.getString( "color" ); if( color != null ) { try { return AEColor.valueOf( color ); } catch( final Exception e ) { } } } return null; }

Target:
public static AEColor getColor( ItemStack item ) { final NBTTagCompound c = item.getTagCompound(); if( c != null && c.hasKey( "color" ) ) { final String color = c.getString( "color" ); if( color != null ) { try { return AEColor.valueOf( color ); } catch( final Exception e ) { } } } return null; }
Source:
private void initProfiles(Injector injector) { LOGGER.info("Initializing Profiles"); ServiceProfileManager profileManager = injector.getInstance(ServiceProfileManager.class); Map<String, Map<String, String>> profiles = injector.getInstance(MyriadConfiguration.class).getProfiles(); TaskUtils taskUtils = injector.getInstance(TaskUtils.class); OfferUtils.setVcoreRatio(taskUtils.getNodeManagerVcoreRatio()); if (MapUtils.isNotEmpty(profiles)) { for (Map.Entry<String, Map<String, String>> profile : profiles.entrySet()) { Map<String, String> profileResourceMap = profile.getValue(); if (MapUtils.isNotEmpty(profiles) && (profileResourceMap.containsKey("vcore") || profileResourceMap.containsKey("cpu")) && profileResourceMap.containsKey("mem")) { Long vcore = profileResourceMap.containsKey("vcore") ? Long.parseLong(profileResourceMap.get("vcore")) : Long.parseLong(profileResourceMap.get("cpu")); Long mem = Long.parseLong(profileResourceMap.get("mem")); ServiceResourceProfile serviceProfile = new ExtendedResourceProfile(new NMProfile(profile.getKey(), vcore, mem, taskUtils.getNodeManagerVcoreRatio()), taskUtils.getNodeManagerCpus(), taskUtils.getNodeManagerMemory(), taskUtils.getNodeManagerPorts()); profileManager.add(serviceProfile); } else { LOGGER.error("Invalid definition for profile: " + profile.getKey()); } } } }

Target:
private void initProfiles(Injector injector) { LOGGER.info("Initializing Profiles"); ServiceProfileManager profileManager = injector.getInstance(ServiceProfileManager.class); Map<String, Map<String, String>> profiles = injector.getInstance(MyriadConfiguration.class).getProfiles(); TaskUtils taskUtils = injector.getInstance(TaskUtils.class); OfferUtils.setVcoreRatio(taskUtils.getNodeManagerVcoreRatio()); if (MapUtils.isNotEmpty(profiles)) { for (Map.Entry<String, Map<String, String>> profile : profiles.entrySet()) { Map<String, String> profileResourceMap = profile.getValue(); if (MapUtils.isNotEmpty(profiles) && (profileResourceMap.containsKey("vcore") || profileResourceMap.containsKey("cpu")) && profileResourceMap.containsKey("mem")) { Long vcore = profileResourceMap.containsKey("vcore") ? Long.parseLong(profileResourceMap.get("vcore")) : Long.parseLong(profileResourceMap.get("cpu")); if (profileResourceMap.containsKey("cpu")) { LOGGER.warn("Deprecated parameter 'cpu' in profiles, please use 'vcore' instead!"); } Long mem = Long.parseLong(profileResourceMap.get("mem")); ServiceResourceProfile serviceProfile = new ExtendedResourceProfile(new NMProfile(profile.getKey(), vcore, mem, taskUtils.getNodeManagerVcoreRatio()), taskUtils.getNodeManagerCpus(), taskUtils.getNodeManagerMemory(), taskUtils.getNodeManagerPorts()); profileManager.add(serviceProfile); } else { LOGGER.error("Invalid definition for profile: " + profile.getKey()); } } } }
Source:
protected void testExecute_notEnoughParameters_shouldFail() { loginAsStudent(student1InCourse1.getGoogleId()); ______TS("Not enough parameters"); verifyHttpParameterFailure(); verifyHttpParameterFailure(Const.ParamsNames.FEEDBACK_QUESTION_ID, qn1InSession1InCourse1.getId()); verifyHttpParameterFailure(Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString()); }

Target:
protected void testExecute_notEnoughParameters_shouldFail() { loginAsStudent(student1InCourse1.getGoogleId()); verifyHttpParameterFailure(); verifyHttpParameterFailure(Const.ParamsNames.FEEDBACK_QUESTION_ID, qn1InSession1InCourse1.getId()); verifyHttpParameterFailure(Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString()); }
Source:
public TranscriptConsequence resolve(VariantAnnotation variantAnnotation) { List<TranscriptConsequence> transcripts = new ArrayList<>(); if (variantAnnotation.getTranscriptConsequences() != null) { for (TranscriptConsequence transcript : variantAnnotation.getTranscriptConsequences()) { if (transcript.getTranscriptId() != null && transcript.getCanonical() != null && transcript.getCanonical().equals("1")) { transcripts.add(transcript); } } } if (transcripts.size() == 1) { return transcripts.iterator().next(); } else if (transcripts.size() > 1) { return this.consequencePrioritizer.transcriptWithMostSevereConsequence( transcripts, variantAnnotation.getMostSevereConsequence()); } else { return this.consequencePrioritizer.transcriptWithMostSevereConsequence( variantAnnotation.getTranscriptConsequences(), variantAnnotation.getMostSevereConsequence()); } }

Target:
public TranscriptConsequence resolve(VariantAnnotation variantAnnotation) { List<TranscriptConsequence> transcripts = new ArrayList<>(); List<TranscriptConsequence> transcriptConsequences = variantAnnotation.getTranscriptConsequences(); if (transcriptConsequences != null) { for (TranscriptConsequence transcript : transcriptConsequences) { if (transcript.getTranscriptId() != null && transcript.getCanonical() != null && transcript.getCanonical().equals("1")) { transcripts.add(transcript); } } } if (transcripts.size() == 1) { return transcripts.iterator().next(); } else if (transcripts.size() > 1) { return this.consequencePrioritizer.transcriptWithMostSevereConsequence( transcripts, variantAnnotation.getMostSevereConsequence()); } else { return this.consequencePrioritizer.transcriptWithMostSevereConsequence( variantAnnotation.getTranscriptConsequences(), variantAnnotation.getMostSevereConsequence()); } }
Source:
public PatchSet getBasePatchSet(ChangeEdit edit, RevCommit commit) throws IOException, InvalidChangeOperationException { if (commit.getParentCount() != 1) { throw new InvalidChangeOperationException( "change edit commit hase multiple parents"); } RevCommit parentCommit = commit.getParent(0); ObjectId rev = parentCommit.getId(); RevId parentRev = new RevId(ObjectId.toString(rev)); try { List<PatchSet> r = db.get().patchSets().byRevision(parentRev).toList(); if (r.isEmpty()) { throw new InvalidChangeOperationException(String.format( "patch set %s change edit is based on doesn't exist", rev.abbreviate(8))); } if (r.size() > 1) { throw new InvalidChangeOperationException(String.format( "multiple parents patch sets %s exist for change edit", rev.abbreviate(8))); } PatchSet parentPatchSet = Iterables.getOnlyElement(r); if (!edit.getChange().getId().equals( parentPatchSet.getId().getParentKey())) { throw new InvalidChangeOperationException(String.format( "different change edit ID %d and its parent patch set %d", edit.getChange().getId().get(), parentPatchSet.getId().getParentKey().get())); } return parentPatchSet; } catch (OrmException e) { throw new IOException(e); } }

Target:
public PatchSet getBasePatchSet(ChangeEdit edit, RevCommit commit) throws IOException, InvalidChangeOperationException { if (commit.getParentCount() != 1) { throw new InvalidChangeOperationException( "change edit commit has multiple parents"); } RevCommit parentCommit = commit.getParent(0); ObjectId rev = parentCommit.getId(); RevId parentRev = new RevId(ObjectId.toString(rev)); try { List<PatchSet> r = db.get().patchSets().byRevision(parentRev).toList(); if (r.isEmpty()) { throw new InvalidChangeOperationException(String.format( "patch set %s change edit is based on doesn't exist", rev.abbreviate(8))); } if (r.size() > 1) { throw new InvalidChangeOperationException(String.format( "multiple patch sets for change edit parent %s", rev.abbreviate(8))); } PatchSet parentPatchSet = Iterables.getOnlyElement(r); if (!edit.getChange().getId().equals( parentPatchSet.getId().getParentKey())) { throw new InvalidChangeOperationException(String.format( "different change edit ID %d and its parent patch set %d", edit.getChange().getId().get(), parentPatchSet.getId().getParentKey().get())); } return parentPatchSet; } catch (OrmException e) { throw new IOException(e); } }
Source:
public void migrateEntitlementQuantityFail() { ConsumerType ct = TestUtil.createConsumerType(); ct.setManifest(true); Entitlement e = TestUtil.createEntitlement(); Consumer sourceConsumer = new Consumer("source-consumer", "bill", owner, ct); Consumer destConsumer = new Consumer("destination-consumer", "bill", owner, ct); e.setConsumer(sourceConsumer); e.setQuantity(25); when(entitlementCurator.find(eq(e.getId()))).thenReturn(e); when(consumerCurator.verifyAndLookupConsumer(eq(sourceConsumer.getUuid()))) .thenReturn(sourceConsumer); when(consumerCurator.verifyAndLookupConsumer(eq(destConsumer.getUuid()))) .thenReturn(destConsumer); try { Response response = entResource.migrateEntitlement(e.getId(), destConsumer.getUuid(), 30); } catch (BadRequestException bre) { assertEquals(bre.getMessage(), i18n.tr("The quantity specified must be greater than zero " + "and less than or equal to the total for this entitlement")); throw bre; } }

Target:
public void migrateEntitlementQuantityFail() { ConsumerType ct = TestUtil.createConsumerType(); ct.setManifest(true); Entitlement e = TestUtil.createEntitlement(); Consumer sourceConsumer = new Consumer("source-consumer", "bill", owner, ct); Consumer destConsumer = new Consumer("destination-consumer", "bill", owner, ct); e.setConsumer(sourceConsumer); e.setQuantity(25); when(entitlementCurator.find(eq(e.getId()))).thenReturn(e); when(consumerCurator.verifyAndLookupConsumer(eq(destConsumer.getUuid()))) .thenReturn(destConsumer); try { entResource.migrateEntitlement(e.getId(), destConsumer.getUuid(), 30); fail("Should have thrown BadRequestException"); } catch (BadRequestException bre) { assertEquals(bre.headers().get(BadRequestException.ROOTCAUSE), CauseEnum.QUANTITY.toString()); } }
Source:
public SortedSet<GeoServerRole> getRolesForUser(final String username) throws IOException { final SortedSet<GeoServerRole> roles = new TreeSet<GeoServerRole>(); final Set<String> userDn = new HashSet<String>(); userDn.add(username); if (lookupUserForDn && isNotEmpty(userFilter)) { authenticateIfNeeded(new AuthenticatedLdapEntryContextCallback() { @Override public void executeWithContext(DirContext ctx, LdapEntryIdentification ldapEntryIdentification) { try { String dn = LDAPUtils .getLdapTemplateInContext(ctx, template) .searchForSingleEntry("", userFilter, new String[] { username }).getNameInNamespace() .toString(); userDn.clear(); userDn.add(dn); } catch (Exception e) { } } }); } authenticateIfNeeded(new AuthenticatedLdapEntryContextCallback() { @Override public void executeWithContext(DirContext ctx, LdapEntryIdentification ldapEntryIdentification) { fillRolesForUser(ctx, username, userDn.iterator().next(), roles); } }); return Collections.unmodifiableSortedSet(roles); }

Target:
public SortedSet<GeoServerRole> getRolesForUser(final String username) throws IOException { final SortedSet<GeoServerRole> roles = new TreeSet<GeoServerRole>(); final Set<String> userDn = new HashSet<String>(); userDn.add(username); if (lookupUserForDn && isNotEmpty(userFilter)) { authenticateIfNeeded(new AuthenticatedLdapEntryContextCallback() { @Override public void executeWithContext(DirContext ctx, LdapEntryIdentification ldapEntryIdentification) { try { String dn = LDAPUtils .getLdapTemplateInContext(ctx, template) .searchForSingleEntry("", userFilter, new String[] { username }).getDn() .toString(); userDn.clear(); userDn.add(dn); } catch (Exception e) { } } }); } authenticateIfNeeded(new AuthenticatedLdapEntryContextCallback() { @Override public void executeWithContext(DirContext ctx, LdapEntryIdentification ldapEntryIdentification) { fillRolesForUser(ctx, username, userDn.iterator().next(), roles); } }); return Collections.unmodifiableSortedSet(roles); }
Source:
public RelNode go(RelNode replacement_) { this.RULE_MAP.clear(); return super.go(replacement_); }

Target:
public RelNode go(RelNode replacement_) { return super.go(replacement_); }
Source:
private OAuth2AccessToken eagerFetchOAuth2AccessToken() { CompletableFuture<OAuth2AccessToken> completableFuture = CompletableFuture.supplyAsync(() -> { OAuth2AccessToken accessToken; try { accessToken = accessTokenRetrieverService.getOAuth2AccessToken(); } catch (IOException | InvalidKeyException e) { throw new IllegalArgumentException(e); } catch (HttpException e) { throw e; } return accessToken; }); OAuth2AccessToken oAuth2AccessTokenResult; try { oAuth2AccessTokenResult = completableFuture.get(); } catch (InterruptedException | ExecutionException e) { throw new IllegalStateException(e); } return oAuth2AccessTokenResult; }

Target:
private OAuth2AccessToken eagerFetchOAuth2AccessToken() { OAuth2AccessToken accessToken; try { accessToken = accessTokenRetrieverService.getOAuth2AccessToken(); } catch (IOException | InvalidKeyException e) { throw new OAuth2TokenRetrieverException("Failed to fetch OAuth2 access token eagerly", e); } if (accessToken == null) { throw new OAuth2TokenRetrieverException("Failed to fetch OAuth2 access token eagerly"); } return accessToken; }
Source:
public Snapshot complete() { checkNotNull(file.temporaryFile(), "no temporary snapshot file to read from"); Buffer buffer = FileBuffer.allocate(file.temporaryFile(), SnapshotDescriptor.BYTES); try (SnapshotDescriptor descriptor = new SnapshotDescriptor(buffer)) { descriptor.lock(); } try { Files.move(file.temporaryFile().toPath(), file.file().toPath()); } catch (FileAlreadyExistsException e) { LOGGER.debug("Snapshot was already previously completed", this); } catch (IOException e) { throw new AtomixIOException(e); } file.clearTemporaryFile(); return super.complete(); }

Target:
public Snapshot complete() { checkNotNull(file.temporaryFile(), "no temporary snapshot file to read from"); Buffer buffer = FileBuffer.allocate(file.temporaryFile(), SnapshotDescriptor.BYTES); try (SnapshotDescriptor descriptor = new SnapshotDescriptor(buffer)) { descriptor.lock(); } try { persistTemporaryFile(); } catch (IOException e) { throw new AtomixIOException(e); } file.clearTemporaryFile(); return super.complete(); }
Source:
public void nothingIsIncludedInAnEmptyArray() { List<Integer> emptyList = Collections.unmodifiableList(new ArrayList<Integer>(0)); BinarySearch<Integer> sut = new BinarySearch<>(emptyList); assertEquals(-1, sut.indexOf(1)); }

Target:
public void nothingIsIncludedInAnEmptyArray() { List<Integer> emptyList = Collections.emptyList(); BinarySearch<Integer> sut = new BinarySearch<>(emptyList); assertEquals(-1, sut.indexOf(1)); }
Source:
public Set<I> dispatchEvent(EventEnvelope event) { checkNotNull(event); Set<I> targets = route(event); for (I target : targets) { inbox.send(event).toReactor(target); } return targets; }

Target:
public Set<I> dispatchEvent(EventEnvelope event) { checkNotNull(event); Set<I> targets = route(event); targets.forEach((id) -> inbox.send(event).toReactor(id)); return targets; }
Source:
public void setLoggerSearchRequest(final LoggerSearchRequest loggerSearchRequest) { this.loggerSearchRequest.setValue(loggerSearchRequest); }

Target:
public void setLoggerSearchRequest(final LoggerSearchRequest loggerSearchRequest) { Assert.requireNonNull(loggerSearchRequest, "loggerSearchRequest"); this.loggerSearchRequest.setValue(loggerSearchRequest); }
Source:
public static IOException createIOException(OperationStatus[] batchOperationStatus) { IOException retriableException = null; for (int i = 0; i < batchOperationStatus.length; i++) { OperationStatus status = batchOperationStatus[i]; switch (status.getOperationStatusCode()) { case SUCCESS: break; case BAD_FAMILY: return new NoSuchColumnFamilyException(status.getExceptionMsg()); case SANITY_CHECK_FAILURE: return new FailedSanityCheckException(status.getExceptionMsg()); case STORE_TOO_BUSY: retriableException = new RegionTooBusyException(status.getExceptionMsg()); break; default: return new DoNotRetryIOException(status.getExceptionMsg()); } } return retriableException; }

Target:
public static IOException createIOException(OperationStatus[] batchOperationStatus) { IOException retriableException = null; for (int i = 0; i < batchOperationStatus.length; i++) { OperationStatus status = batchOperationStatus[i]; switch (status.getOperationStatusCode()) { case SUCCESS: break; case BAD_FAMILY: return new NoSuchColumnFamilyException(status.getExceptionMsg()); case SANITY_CHECK_FAILURE: return new FailedSanityCheckException(status.getExceptionMsg()); case STORE_TOO_BUSY: retriableException = new RegionTooBusyException(status.getExceptionMsg()); break; case NOT_RUN: retriableException = new RetryImmediatelyException(status.getExceptionMsg()); break; default: return new DoNotRetryIOException(status.getExceptionMsg()); } } return retriableException; }
Source:
public void testScrutinyOnRowsBeyondMaxLookBack() throws Exception { schema = generateUniqueName(); dataTableName = generateUniqueName(); indexTableName = generateUniqueName(); dataTableFullName = SchemaUtil.getTableName(schema, dataTableName); isViewIndex = false; String dataTableDDL = "CREATE TABLE %s (ID INTEGER NOT NULL PRIMARY KEY, NAME VARCHAR, " + "ZIP INTEGER) COLUMN_ENCODED_BYTES=0, VERSIONS=1"; String indexTableDDL = "CREATE INDEX %s ON %s (NAME) INCLUDE (ZIP)"; testClock = new ManualEnvironmentEdge(); try (Connection conn = DriverManager.getConnection(getUrl(), PropertiesUtil.deepCopy(TEST_PROPERTIES))) { conn.createStatement().execute(String.format(dataTableDDL, dataTableFullName)); conn.createStatement().execute(String.format(indexTableDDL, indexTableName, dataTableFullName)); conn.commit(); } upsertDataAndScrutinize(dataTableName, dataTableFullName, testClock); }

Target:
public void testScrutinyOnRowsBeyondMaxLookBack() throws Exception { setupTables(); upsertDataAndScrutinize(dataTableName, dataTableFullName, testClock); assertBeyondMaxLookbackOutput(dataTableFullName, indexTableFullName); }
Source:
public void parseFrom(String stringValue) { context.getApplicationInfo(); }

Target:
public void parseFrom(String stringValue) { BaseApplication app = BaseApplication.getApp(context); EnumDataStore<E> store = app.getEnumDataStore(getValueClass()); if (store != null) { setValue(store.lookupByName(stringValue)); } }
Source:
protected boolean canPerformNicHotPlug() { return osRepository.hasNicHotplugSupport(getVm().getOs(), getVm().getVdsGroupCompatibilityVersion()); }

Target:
protected boolean canPerformNicHotPlug() { return isHotPlugSupported() && osRepository.hasNicHotplugSupport(getVm().getOs(), getVm().getVdsGroupCompatibilityVersion()); }
Source:
private static List<String> getModulePaths(List<ErlangFileDescriptor> buildOrder) { return ContainerUtil.mapNotNull(buildOrder, new Function<ErlangFileDescriptor, String>() { @Override public String fun(ErlangFileDescriptor erlangDependencyTreeNode) { return erlangDependencyTreeNode.myPath; } }); }

Target:
private static List<String> getModulePaths(List<ErlangFileDescriptor> buildOrder) { return ContainerUtil.mapNotNull(buildOrder, new Function<ErlangFileDescriptor, String>() { @Override public String fun(ErlangFileDescriptor erlangFileDescriptor) { return erlangFileDescriptor.myPath; } }); }
Source:
public void completePluginConfigurationUpdate(PluginConfigurationUpdate update) { ConfigurationUpdateResponse response = configurationManager.executePluginConfigurationUpdate(update); Resource resource = update.getResource(); resource.setAgentSynchronizationNeeded(); Configuration oldPluginConfig = resource.getPluginConfiguration(); resource.setPluginConfiguration(update.getConfiguration()); if (response.getStatus() == ConfigurationUpdateStatus.SUCCESS) { update.setStatus(ConfigurationUpdateStatus.SUCCESS); resource.setConnected(true); removeAnyExistingInvalidPluginConfigurationErrors(resource); entityManager.flush(); entityManager.merge(update); entityManager.remove(oldPluginConfig); } else { handlePluginConfiguratonUpdateRemoteException(resource, response.getStatus().toString(), response.getErrorMessage()); update.setStatus(response.getStatus()); update.setErrorMessage(response.getErrorMessage()); } }

Target:
public void completePluginConfigurationUpdate(PluginConfigurationUpdate update) { ConfigurationUpdateResponse response = configurationManager.executePluginConfigurationUpdate(update); Resource resource = update.getResource(); resource.setAgentSynchronizationNeeded(); entityManager.remove(resource.getPluginConfiguration()); resource.setPluginConfiguration(update.getConfiguration().deepCopyWithoutProxies()); if (response.getStatus() == ConfigurationUpdateStatus.SUCCESS) { update.setStatus(ConfigurationUpdateStatus.SUCCESS); resource.setConnected(true); removeAnyExistingInvalidPluginConfigurationErrors(resource); entityManager.flush(); entityManager.merge(update); } else { handlePluginConfiguratonUpdateRemoteException(resource, response.getStatus().toString(), response.getErrorMessage()); update.setStatus(response.getStatus()); update.setErrorMessage(response.getErrorMessage()); } }
Source:
public ChargeEntity updateChargeAndEmitEventPostAuthorisation(String chargeExternalId, ChargeStatus status, AuthCardDetails authCardDetails, Optional<String> transactionId, Optional<Auth3dsDetailsEntity> auth3dsDetails, Optional<String> sessionIdentifier, Optional<WalletType> walletType, Optional<String> emailAddress) { ChargeEntity chargeEntity = updateChargePostAuthorisation(chargeExternalId, status, authCardDetails, transactionId, auth3dsDetails, sessionIdentifier, walletType, emailAddress); emitEvent(PaymentDetailsEnteredEvent.from(chargeEntity)); return chargeEntity; }

Target:
private ChargeEntity updateChargeAndEmitEventPostAuthorisation(String chargeExternalId, ChargeStatus status, AuthCardDetails authCardDetails, Optional<String> transactionId, Optional<Auth3dsDetailsEntity> auth3dsDetails, Optional<String> sessionIdentifier, Optional<WalletType> walletType, Optional<String> emailAddress) { ChargeEntity chargeEntity = updateChargePostAuthorisation(chargeExternalId, status, authCardDetails, transactionId, auth3dsDetails, sessionIdentifier, walletType, emailAddress); emitEvent(PaymentDetailsEnteredEvent.from(chargeEntity)); return chargeEntity; }
Source:
public void alertWhenMalformedRefererContainsSensitiveInfo() throws HttpMalformedHeaderException, URIException { String testReferer = "<LINK_0>passWord=whatsup&hl=en"; HttpMessage msg = createHttpMessageWithRespBody(testReferer); rule.scanHttpRequestSend(msg, -1); assertEquals(1, alertsRaised.size()); }

Target:
public void alertWhenMalformedRefererContainsSensitiveInfo() throws HttpMalformedHeaderException, URIException { String sensitiveParamName = "passWord"; String sensitiveValue = "whatsup"; String testReferer = "<LINK_0>" + sensitiveParamName + "=" + sensitiveValue + "&hl=en"; HttpMessage msg = createHttpMessageWithRespBody(testReferer); rule.scanHttpRequestSend(msg, -1); assertEquals(1, alertsRaised.size()); assertEquals(sensitiveParamName, alertsRaised.get(0).getEvidence()); assertEquals( Constant.messages.getString( InformationDisclosureReferrerScanner.MESSAGE_PREFIX + "otherinfo.sensitiveinfo"), alertsRaised.get(0).getOtherInfo()); }
Source:
public Condition saveCondition(Condition condition) { Condition existingCondition = getConditionByUuid(condition.getUuid()); if (condition.equals(existingCondition)) { return existingCondition; } if (existingCondition == null) { return conditionDAO.saveCondition(condition); } condition.setPreviousVersion(existingCondition); if (existingCondition.getClinicalStatus().equals(condition.getClinicalStatus())) { existingCondition.setVoided(true); conditionDAO.saveCondition(existingCondition); return conditionDAO.saveCondition(condition); } Date onSetDate = condition.getOnsetDate() != null ? condition.getOnsetDate() : new Date(); existingCondition.setEndDate(onSetDate); conditionDAO.saveCondition(existingCondition); condition.setOnsetDate(onSetDate); return conditionDAO.saveCondition(condition); }

Target:
public Condition saveCondition(Condition condition) { Date endDate = condition.getEndDate() != null ? condition.getEndDate() : new Date(); if (condition.getEndReason() != null) { condition.setEndDate(endDate); } Condition existingCondition = getConditionByUuid(condition.getUuid()); if (condition.equals(existingCondition)) { return existingCondition; } if (existingCondition == null) { return conditionDAO.saveCondition(condition); } condition = Condition.newInstance(condition); condition.setPreviousVersion(existingCondition); if (existingCondition.getClinicalStatus().equals(condition.getClinicalStatus())) { existingCondition.setVoided(true); conditionDAO.saveCondition(existingCondition); return conditionDAO.saveCondition(condition); } Date onSetDate = condition.getOnsetDate() != null ? condition.getOnsetDate() : new Date(); existingCondition.setEndDate(onSetDate); conditionDAO.saveCondition(existingCondition); condition.setOnsetDate(onSetDate); return conditionDAO.saveCondition(condition); }
Source:
public void testCreateContentWithCats_AnonymousUser_RESTAPICONTENTALLOWFRONTENDSAVINGfalse_shouldFail403() throws DotSecurityException, DotDataException, JSONException { final String REST_API_CONTENT_ALLOW_FRONT_END_SAVING = "REST_API_CONTENT_ALLOW_FRONT_END_SAVING"; boolean restAPIContentAllowFrontEndSavingValue = Config.getBooleanProperty(REST_API_CONTENT_ALLOW_FRONT_END_SAVING); try { long time = System.currentTimeMillis(); final String TITLE_FIELD_VARIABLE = "title"+time; final String CAT_FIELD_VARIABLE = "eventType"+time; ContentType type = createContentTypeWithCatAndTextField(TITLE_FIELD_VARIABLE, CAT_FIELD_VARIABLE); Config.setProperty(REST_API_CONTENT_ALLOW_FRONT_END_SAVING, false); Response response = webTarget.path("/save/1/").request() .put(Entity.entity(new JSONObject() .put("stInode", type.id()) .put("languageId", 1) .put(TITLE_FIELD_VARIABLE, "Test content from ContentResourceTest") .put(CAT_FIELD_VARIABLE, "seminars") .toString(), MediaType.APPLICATION_JSON_TYPE)); assertTrue(response.getStatus() == Response.Status.FORBIDDEN.getStatusCode()); } finally { Config.setProperty("REST_API_CONTENT_ALLOW_FRONT_END_SAVING", restAPIContentAllowFrontEndSavingValue); } }

Target:
public void testCreateContentWithCats_AnonymousUser_RESTAPICONTENTALLOWFRONTENDSAVINGfalse_shouldFail403() throws DotSecurityException, DotDataException, JSONException { final boolean restAPIContentAllowFrontEndSavingValue = Config.getBooleanProperty(REST_API_CONTENT_ALLOW_FRONT_END_SAVING); try { final long time = System.currentTimeMillis(); final String TITLE_FIELD_VARIABLE = "title"+time; final String CAT_FIELD_VARIABLE = "eventType"+time; final ContentType type = createContentTypeWithCatAndTextField(TITLE_FIELD_VARIABLE, CAT_FIELD_VARIABLE); Config.setProperty(REST_API_CONTENT_ALLOW_FRONT_END_SAVING, false); final Response response = webTarget.path("/save/1/").request() .put(Entity.entity(new JSONObject() .put("stInode", type.id()) .put("languageId", 1) .put(TITLE_FIELD_VARIABLE, "Test content from ContentResourceTest") .put(CAT_FIELD_VARIABLE, "seminars") .toString(), MediaType.APPLICATION_JSON_TYPE)); assertTrue(response.getStatus() == Response.Status.FORBIDDEN.getStatusCode()); } finally { Config.setProperty(REST_API_CONTENT_ALLOW_FRONT_END_SAVING, restAPIContentAllowFrontEndSavingValue); } }
Source:
public Map<Long, BaseEntityRef> getEntityStore() { return entityStore; }

Target:
protected Map<Long, BaseEntityRef> getEntityStore() { return Collections.unmodifiableMap(entityStore); }
Source:
public void close() { final MappedByteBuffer cncByteBuffer = this.cncByteBuffer; this.cncByteBuffer = null; AeronCloseHelper.close(errorHandler, () -> IoUtil.unmap(cncByteBuffer)); AeronCloseHelper.close(errorHandler, super::close); }

Target:
public void close() { final MappedByteBuffer cncByteBuffer = this.cncByteBuffer; this.cncByteBuffer = null; IoUtil.unmap(cncByteBuffer); super.close(); }
Source:
ServerStoreImpl(ServerStoreConfiguration storeConfiguration, PageSource pageSource) { this.storeConfiguration = storeConfiguration; this.pageSource = pageSource; this.store = new OffHeapServerStore(pageSource, 16); }

Target:
ServerStoreImpl(ServerStoreConfiguration storeConfiguration, PageSource pageSource) { this.storeConfiguration = storeConfiguration; this.pageSource = pageSource; this.store = new OffHeapServerStore(pageSource, OFFHEAP_CHAIN_SEGMENTS); }