auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public SqlTypeName getSqlTypeName() { <START> Class clz = clazz; <END> if (List.class.isAssignableFrom(clazz) || java.sql.Array.class.isAssignableFrom(clazz) || java.lang.reflect.Array.class.isAssignableFrom(clazz)) { clz = List.class; } else if (Map.class.isAssignableFrom(clazz)) { clz = Map.class; } final SqlTypeName typeName = JavaToSqlTypeConversionRules.instance().lookup(clz); if (typeName == null) { return SqlTypeName.OTHER; } return typeName; }</code><technical_language>I this logic more JavaToSqlTypeConversionRules</technical_language>

Target:
public SqlTypeName getSqlTypeName() { final SqlTypeName typeName = JavaToSqlTypeConversionRules.instance().lookup(clazz); if (typeName == null) { return SqlTypeName.OTHER; } return typeName; }
Source:
<code>private FunctionRegistry createFunctionRegistry(TypeRegistry typeManager) { BlockEncodingManager blockEncodingManager = new BlockEncodingManager(typeManager); FeaturesConfig featuresConfig = new FeaturesConfig(); FunctionManager functionManager = new FunctionManager(typeManager, blockEncodingManager, featuresConfig); <START> return new FunctionRegistry(typeManager, blockEncodingManager, new FeaturesConfig(), functionManager); <END> }</code><technical_language>create multiple FeaturesConfigs in this method (another is created L299)</technical_language>

Target:
private FunctionRegistry createFunctionRegistry(TypeRegistry typeManager) { BlockEncodingManager blockEncodingManager = new BlockEncodingManager(typeManager); FeaturesConfig featuresConfig = new FeaturesConfig(); FunctionManager functionManager = new FunctionManager(typeManager, blockEncodingManager, featuresConfig); return new FunctionRegistry(typeManager, blockEncodingManager, featuresConfig, functionManager); }
Source:
<code>public void simplePhenotypeSearchExternalIdentifier() throws AvroRemoteException { SearchGenotypePhenotypeRequest request = SearchGenotypePhenotypeRequest.newBuilder().build(); ExternalIdentifier id = new ExternalIdentifier() ; id.setDatabase("<LINK_0>"); id.setIdentifier("606764"); id.setVersion("*"); List<ExternalIdentifier> ids = new ArrayList<ExternalIdentifier>() ; ids.add(id) ; ExternalIdentifierQuery phenotype = new ExternalIdentifierQuery(); phenotype.setIds(ids); request.setPhenotype(phenotype); SearchGenotypePhenotypeResponse response = client.genotypePhenotype.searchGenotypePhenotype(request); assertThat(response).isNotNull(); assertThat(response.getAssociations()).isNotNull() ; assertThat(response.getAssociations().get(0)).isNotNull() ; <START> <END> }</code><technical_language>Whitespace</technical_language>

Target:
public void simplePhenotypeSearchExternalIdentifier() throws AvroRemoteException { SearchGenotypePhenotypeRequest request = SearchGenotypePhenotypeRequest.newBuilder().build(); ExternalIdentifier id = new ExternalIdentifier() ; id.setDatabase(TestData.PHENOTYPE_DB); id.setIdentifier(TestData.PHENOTYPE_DB_ID); id.setVersion(TestData.PHENOTYPE_DB_VERSION); List<ExternalIdentifier> ids = new ArrayList<>() ; ids.add(id) ; ExternalIdentifierQuery phenotype = new ExternalIdentifierQuery(); phenotype.setIds(ids); request.setPhenotype(phenotype); SearchGenotypePhenotypeResponse response = client.genotypePhenotype.searchGenotypePhenotype(request); assertThat(response.getAssociations()).isNotNull() ; assertThat(response.getAssociations()).isNotEmpty() ; }
Source:
<code>Collection<String> getAvailableItems(Context context) throws IOException { Connection connection = context.getConnection(); <START> return context.getConnection().getAvailableServers(connection.getActiveContainer().getName()); <END> }</code><technical_language>suggestion return connection.getAvailableServers(connection.getActiveContainer().getName());</technical_language>

Target:
Collection<String> getAvailableItems(Context context) throws IOException { Connection connection = context.getConnection(); return connection.getAvailableServers(connection.getActiveContainer().getName()); }
Source:
<code>public View getCustomView(int position, View convertView, ViewGroup parent) { RowViewHolder rowViewHolder; if (convertView == null) { rowViewHolder = new RowViewHolder(); convertView = mInflater.inflate(R.layout.spinner_item_layout, parent, false); rowViewHolder.rowItemText = (TextView) convertView.findViewById(R.id.spinner_item_text); <START> if (getItem(position) == -1) { <END> rowViewHolder.rowItemText.setText(NO_ANIMATION_TEXT); } else if (getItem(position) == 1000) { rowViewHolder.rowItemText.setText(ONE_SECOND); } else { rowViewHolder.rowItemText.setText(getItem(position).toString() + MS); } } else { rowViewHolder = (RowViewHolder) convertView.getTag(); } convertView.setTag(rowViewHolder); return convertView; }</code><technical_language>need update rowViewHolder text if null correct</technical_language>

Target:
public View getCustomView(int position, View convertView, ViewGroup parent) { RowViewHolder rowViewHolder; if (convertView == null) { rowViewHolder = new RowViewHolder(); convertView = mInflater.inflate(R.layout.spinner_item_layout, parent, false); rowViewHolder.rowItemText = (TextView) convertView.findViewById(R.id.spinner_item_text); } else { rowViewHolder = (RowViewHolder) convertView.getTag(); } if (getItem(position) == -1) { rowViewHolder.rowItemText.setText(NO_ANIMATION_TEXT); } else if (getItem(position) == 1000) { rowViewHolder.rowItemText.setText(ONE_SECOND); } else { rowViewHolder.rowItemText.setText(getItem(position).toString() + MS); } convertView.setTag(rowViewHolder); return convertView; }
Source:
<code>public void testDeletingComponent() { CourseGroupDAO newCourseGroup = courseDao.newCourseGroup("id", "Title", "Department", "Subunit"); newCourseGroup.setSource("source"); courseDao.save(newCourseGroup); CourseComponentDAO newCourseComponent1 = courseDao.newCourseComponent("test1"); newCourseComponent1.getGroups().add(newCourseGroup); newCourseComponent1.setSource("source"); courseDao.save(newCourseComponent1); CourseComponentDAO newCourseComponent2 = courseDao.newCourseComponent("test2"); newCourseComponent2.getGroups().add(newCourseGroup); newCourseComponent2.setSource("source"); newCourseComponent2.setDeleted(true); courseDao.save(newCourseComponent2); CourseSignupDAO newSignup = courseDao.newSignup("userId", "supervisorId"); newSignup.setGroup(newCourseGroup); newSignup.getComponents().add(newCourseComponent1); courseDao.save(newSignup); <START> courseDao.deleteSelectedCourseComponents("source"); <END> }</code><technical_language>hoping for a HibernateException for this test fail? Do want this explicit</technical_language>

Target:
public void testDeletingComponent() { CourseGroupDAO newCourseGroup = courseDao.newCourseGroup("id", "Title", "Department", "Subunit"); newCourseGroup.setSource("source"); courseDao.save(newCourseGroup); CourseComponentDAO newCourseComponent1 = courseDao.newCourseComponent("test1"); newCourseComponent1.getGroups().add(newCourseGroup); newCourseComponent1.setSource("source"); courseDao.save(newCourseComponent1); CourseComponentDAO newCourseComponent2 = courseDao.newCourseComponent("test2"); newCourseComponent2.getGroups().add(newCourseGroup); newCourseComponent2.setSource("source"); newCourseComponent2.setDeleted(true); courseDao.save(newCourseComponent2); CourseSignupDAO newSignup = courseDao.newSignup("userId", "supervisorId"); newSignup.setGroup(newCourseGroup); newSignup.getComponents().add(newCourseComponent1); courseDao.save(newSignup); try { courseDao.deleteSelectedCourseComponents("source"); } catch (RuntimeException re) { throw re; } }
Source:
<code>public long unread() throws IOException { try { final Item item = this.region.table(DyFriends.TBL) .frame() .through( new QueryValve() .withLimit(1) .withAttributesToGet(DyFriends.ATTR_UNREAD) ) .where(DyFriends.HASH, Conditions.equalTo(this.bout)) .where(DyFriends.RANGE, Conditions.equalTo(this.self)) <START> .iterator().next(); <END> final long unread; if (item.has(DyFriends.ATTR_UNREAD)) { unread = Long.parseLong(item.get(DyFriends.ATTR_UNREAD).getN()); } else { unread = 0L; } return unread; } catch (final NoSuchElementException ex) { throw new RsFailure(ex); } }</code><technical_language>@2686747 problem is next() throws exception, problem is calling more elements in iterator. iterator defines hasNext(), avoid making erroneous next() call instead of making suppressing error</technical_language>

Target:
public long unread() throws IOException { final Iterator<Item> iterator = this.region.table(DyFriends.TBL) .frame() .through( new QueryValve() .withLimit(1) .withAttributesToGet(DyFriends.ATTR_UNREAD) ) .where(DyFriends.HASH, Conditions.equalTo(this.bout)) .where(DyFriends.RANGE, Conditions.equalTo(this.self)) .iterator(); if (!iterator.hasNext()) { throw new HttpException( HttpURLConnection.HTTP_NOT_FOUND, new Inbox.BoutNotFoundException(this.bout) ); } final Item item = iterator.next(); final long unread; if (item.has(DyFriends.ATTR_UNREAD)) { unread = Long.parseLong(item.get(DyFriends.ATTR_UNREAD).getN()); } else { unread = 0L; } return unread; }
Source:
<code>public LookupExtractor get() { final Map<String, String> map = Preconditions.checkNotNull(mapRef.get(), "Not started"); final long startCount = doubleEventCount.get(); <START> return new MapLookupExtractor(map, false) <END> { @Override public byte[] getCacheKey() { final byte[] idutf8 = StringUtils.toUtf8(factoryId); if (startCount == doubleEventCount.get()) { return ByteBuffer .allocate(idutf8.length + 1 + Longs.BYTES) .put(idutf8) .put((byte) 0xFF) .putLong(startCount) .array(); } else { final byte[] scrambler = StringUtils.toUtf8(UUID.randomUUID().toString()); return ByteBuffer .allocate(idutf8.length + 1 + scrambler.length + 1) .put(idutf8) .put((byte) 0xFF) .put(scrambler) .put((byte) 0xFF) .array(); } } }; }</code><technical_language>wanna allow user select if is</technical_language>

Target:
public LookupExtractor get() { final Map<String, String> map = Preconditions.checkNotNull(mapRef.get(), "Not started"); final long startCount = doubleEventCount.get(); return new MapLookupExtractor(map, isOneToOne()) { @Override public byte[] getCacheKey() { final byte[] idutf8 = StringUtils.toUtf8(factoryId); if (startCount == doubleEventCount.get()) { return ByteBuffer .allocate(idutf8.length + 1 + Longs.BYTES) .put(idutf8) .put((byte) 0xFF) .putLong(startCount) .array(); } else { final byte[] scrambler = StringUtils.toUtf8(UUID.randomUUID().toString()); return ByteBuffer .allocate(idutf8.length + 1 + scrambler.length + 1) .put(idutf8) .put((byte) 0xFF) .put(scrambler) .put((byte) 0xFF) .array(); } } }; }
Source:
<code>public CommandCallback getCallback() { <START> return new ConcurrentChildCommandsExecutionCallback(); <END> }</code><technical_language>I worth adding a field template is sealed</technical_language>

Target:
public CommandCallback getCallback() { return new SysprepVmTemplateJobCallback(); }
Source:
<code>public static void calculateAllSpeeds() { for (Entry<InetAddress, RendererConfiguration> key : addressAssociation.entrySet()) { InetAddress sa = key.getKey(); if (sa.isLoopbackAddress() || sa.isAnyLocalAddress()) { continue; } <START> RendererConfiguration r = key.getValue(); <END> if (!r.isOffline()) { SpeedStats.getInstance().getSpeedInMBits(sa, r.getRendererName()); } } }</code><technical_language>confusing entry is called "key"</technical_language>

Target:
public static void calculateAllSpeeds() { for (Entry<InetAddress, RendererConfiguration> entry : addressAssociation.entrySet()) { InetAddress sa = entry.getKey(); if (sa.isLoopbackAddress() || sa.isAnyLocalAddress()) { continue; } RendererConfiguration r = entry.getValue(); if (!r.isOffline()) { SpeedStats.getInstance().getSpeedInMBits(sa, r.getRendererName()); } } }
Source:
<code>public PeriodicQueryMetadata(String nodeId, VariableOrder varOrder, String parentNodeId, String childNodeId, long windowSize, long period, TimeUnit unit, String temporalVariable) { super(nodeId, varOrder); Preconditions.checkNotNull(parentNodeId); Preconditions.checkNotNull(childNodeId); Preconditions.checkNotNull(temporalVariable); Preconditions.checkNotNull(unit); <START> Preconditions.checkNotNull(period > 0); <END> Preconditions.checkArgument(windowSize >= period); this.parentNodeId = parentNodeId; this.childNodeId = childNodeId; this.temporalVariable = temporalVariable; this.windowSize = windowSize; this.period = period; this.unit = unit; }</code><technical_language>= checkNotNull</technical_language>

Target:
public PeriodicQueryMetadata(String nodeId, VariableOrder varOrder, String parentNodeId, String childNodeId, long windowSize, long period, TimeUnit unit, String temporalVariable) { super(nodeId, varOrder); this.parentNodeId = Preconditions.checkNotNull(parentNodeId); this.childNodeId = Preconditions.checkNotNull(childNodeId); this.temporalVariable = Preconditions.checkNotNull(temporalVariable); this.unit = Preconditions.checkNotNull(unit); Preconditions.checkArgument(period > 0); Preconditions.checkArgument(windowSize >= period); this.windowSize = windowSize; this.period = period; }
Source:
<code>public InMemoryMap(Map<String,Set<ByteSequence>> lggroups, boolean useNativeMap, String memDumpDir) { this.memDumpDir = memDumpDir; this.lggroups = lggroups; if (lggroups.size() == 0) { map = newMap(useNativeMap); <START> mapType = useNativeMap ? "NativeMapWrapper" : "DefaultMap"; <END> } else { map = new LocalityGroupMap(lggroups, useNativeMap); mapType = useNativeMap ? "LocalityGroupMap with native" : "LocalityGroupMap"; } }</code><technical_language>constants nice (and re-used in test)</technical_language>

Target:
public InMemoryMap(Map<String,Set<ByteSequence>> lggroups, boolean useNativeMap, String memDumpDir) { this.memDumpDir = memDumpDir; this.lggroups = lggroups; if (lggroups.size() == 0) { map = newMap(useNativeMap); mapType = useNativeMap ? TYPE_NATIVE_MAP_WRAPPER : TYPE_DEFAULT_MAP; } else { map = new LocalityGroupMap(lggroups, useNativeMap); mapType = useNativeMap ? TYPE_LOCALITY_GROUP_MAP : TYPE_LOCALITY_GROUP_MAP_NATIVE; } }
Source:
<code>public CqlQueryResponse executeCqlQuery(CqlRequest cqlRequest) throws UnsupportedQueryException, SourceUnavailableException, FederationException { QueryRequest request = cqlRequest.createQueryRequest( <START> catalogFramework.getId(), filterBuilder, cqlRequest.getFacets()); <END> Stopwatch stopwatch = Stopwatch.createStarted(); List<QueryResponse> responses = Collections.synchronizedList(new ArrayList<>()); List<Result> results; if (cqlRequest.getCount() == 0) { results = retrieveHitCount(request, responses); } else { results = retrieveResults(cqlRequest, request, responses); } QueryResponse response = new QueryResponseImpl( request, results, true, responses .stream() .filter(Objects::nonNull) .map(QueryResponse::getHits) .findFirst() .orElse(-1L), responses .stream() .filter(Objects::nonNull) .map(QueryResponse::getProperties) .findFirst() .orElse(Collections.emptyMap())); stopwatch.stop(); return new CqlQueryResponse( cqlRequest.getId(), request, response, cqlRequest.getSource(), stopwatch.elapsed(TimeUnit.MILLISECONDS), cqlRequest.isNormalize(), filterAdapter, actionRegistry); }</code><technical_language>remove Set<String> facets function definition facets contained in cqlRequest object</technical_language>

Target:
public CqlQueryResponse executeCqlQuery(CqlRequest cqlRequest) throws UnsupportedQueryException, SourceUnavailableException, FederationException { QueryRequest request = cqlRequest.createQueryRequest(catalogFramework.getId(), filterBuilder); Stopwatch stopwatch = Stopwatch.createStarted(); List<QueryResponse> responses = Collections.synchronizedList(new ArrayList<>()); List<Result> results; if (cqlRequest.getCount() == 0) { results = retrieveHitCount(request, responses); } else { results = retrieveResults(cqlRequest, request, responses); } QueryResponse response = new QueryResponseImpl( request, results, true, responses .stream() .filter(Objects::nonNull) .map(QueryResponse::getHits) .findFirst() .orElse(-1L), responses .stream() .filter(Objects::nonNull) .map(QueryResponse::getProperties) .findFirst() .orElse(Collections.emptyMap())); stopwatch.stop(); return new CqlQueryResponse( cqlRequest.getId(), request, response, cqlRequest.getSourceResponseString(), stopwatch.elapsed(TimeUnit.MILLISECONDS), cqlRequest.isNormalize(), filterAdapter, actionRegistry); }
Source:
<code>public void awaitPopulation() throws IOException { <START> applier.writeBarrier().await(); <END> }</code><technical_language>enough simpler a map of indexes statuses (2 indexes)</technical_language>

Target:
public void awaitPopulation() throws IOException { applier.writeBarrier().awaitCompletion(); }
Source:
<code>private RevCommit parse(final String msg) { final StringBuilder buf = new StringBuilder(); buf.append("tree " + ObjectId.zeroId().name() + "\n"); buf.append("author A. U. Thor <a@example.com> 1 +0000\n"); buf.append("committer A. U. Thor <a@example.com> 1 +0000\n"); buf.append("\n"); buf.append(msg); final RevWalk walk = new RevWalk(db); walk.setRetainBody(true); final RevCommit c = new RevCommit(ObjectId.zeroId()); try { c.parseCanonical(walk, Constants.encode(buf.toString())); } <START> catch (IOException ex) { <END> fail(); } return c; }</code><technical_language>Cuddle catch closing curly prior line</technical_language>

Target:
private RevCommit parse(final String msg) throws IOException { final StringBuilder buf = new StringBuilder(); buf.append("tree " + ObjectId.zeroId().name() + "\n"); buf.append("author A. U. Thor <a@example.com> 1 +0000\n"); buf.append("committer A. U. Thor <a@example.com> 1 +0000\n"); buf.append("\n"); buf.append(msg); final RevWalk walk = new RevWalk(db); walk.setRetainBody(true); final RevCommit c = new RevCommit(ObjectId.zeroId()); c.parseCanonical(walk, Constants.encode(buf.toString())); return c; }
Source:
<code>private static void addClassesForPackage(String packageName, ArrayList<Class<?>> classes, File directory) { assert directory != null; File[] files = directory.listFiles(); if ( files == null ) { return; } for ( File file : files ) { if ( file.getAbsolutePath().endsWith( ".class" ) ) { String className = file.getPath().substring( 0, file.getPath().length() - 6 ); <START> className = className.substring( className.lastIndexOf(File.separator) ); <END> try { Class<?> clazz = Class.forName( className ); classes.add( clazz ); } catch( ClassNotFoundException e ) { } } else if ( file.isDirectory() ) { addClassesForPackage( packageName, classes, file ); } } }</code><technical_language>Good catch. I replace File.separator a .</technical_language>

Target:
private static void addClassesForPackage(String packageName, ArrayList<Class<?>> classes, File directory) { assert directory != null; File[] files = directory.listFiles(); if ( files == null ) { return; } for ( File file : files ) { if ( file.getAbsolutePath().endsWith( ".class" ) ) { String className = file.getPath().substring( 0, file.getPath().length() - 6 ); className = className.replace( File.separator, "." ); className = className.substring( className.lastIndexOf(File.separator) ); try { Class<?> clazz = Class.forName( className ); classes.add( clazz ); } catch( ClassNotFoundException e ) { } } else if ( file.isDirectory() ) { addClassesForPackage( packageName, classes, file ); } } }
Source:
<code>private void testIssueCreation(InputFile.Type onType, int expectedIssues) throws IOException { MapSettings settings = new MapSettings(); NoSonarFilter noSonarFilter = mock(NoSonarFilter.class); SensorContextTester context = createContext(onType).setRuntime(SonarRuntimeImpl.forSonarLint(Version.create(6, 7))); DefaultFileSystem fs = context.fileSystem(); SonarComponents sonarComponents = createSonarComponentsMock(context); DefaultJavaResourceLocator javaResourceLocator = new DefaultJavaResourceLocator(fs, newJavaClasspath(settings.asConfig(), fs)); PostAnalysisIssueFilter postAnalysisIssueFilter = new PostAnalysisIssueFilter(fs); JavaSquidSensor jss = new JavaSquidSensor(sonarComponents, fs, javaResourceLocator, settings.asConfig(), noSonarFilter, postAnalysisIssueFilter); jss.execute(context); verify(noSonarFilter, times(1)).noSonarInFile(fs.inputFiles().iterator().next(), Sets.newHashSet(97)); verify(sonarComponents, times(expectedIssues)).reportIssue(any(AnalyzerMessage.class)); settings.setProperty(Java.SOURCE_VERSION, "wrongFormat"); jss.execute(context); settings.setProperty(Java.SOURCE_VERSION, "1.7"); jss.execute(context); <START> <END> }</code><technical_language>unecessary change</technical_language>

Target:
private void testIssueCreation(InputFile.Type onType, int expectedIssues) throws IOException { MapSettings settings = new MapSettings(); NoSonarFilter noSonarFilter = mock(NoSonarFilter.class); SensorContextTester context = createContext(onType).setRuntime(SonarRuntimeImpl.forSonarLint(Version.create(6, 7))); DefaultFileSystem fs = context.fileSystem(); SonarComponents sonarComponents = createSonarComponentsMock(context); DefaultJavaResourceLocator javaResourceLocator = new DefaultJavaResourceLocator(fs, new JavaClasspath(settings.asConfig(), fs)); PostAnalysisIssueFilter postAnalysisIssueFilter = new PostAnalysisIssueFilter(fs); JavaSquidSensor jss = new JavaSquidSensor(sonarComponents, fs, javaResourceLocator, settings.asConfig(), noSonarFilter, postAnalysisIssueFilter); jss.execute(context); verify(noSonarFilter, times(1)).noSonarInFile(fs.inputFiles().iterator().next(), Sets.newHashSet(96)); verify(sonarComponents, times(expectedIssues)).reportIssue(any(AnalyzerMessage.class)); settings.setProperty(Java.SOURCE_VERSION, "wrongFormat"); jss.execute(context); settings.setProperty(Java.SOURCE_VERSION, "1.7"); jss.execute(context); }
Source:
<code>public void transform(StructuredRecord input, Emitter<KeyValue<Text, NullWritable>> emitter) throws Exception { List<String> dataArray = new ArrayList<>(); for (Schema.Field field : input.getSchema().getFields()) { String data = (input.get(field.getName()) != null) ? input.get(field.getName()).toString() : ""; <START> dataArray.add(data); <END> } emitter.emit(new KeyValue<>(new Text(Joiner.on(",").join(dataArray)), NullWritable.get())); }</code><technical_language>add null instead of ""? end difference? adding all</technical_language>

Target:
public void transform(StructuredRecord input, Emitter<KeyValue<Text, NullWritable>> emitter) throws Exception { List<String> dataArray = new ArrayList<>(); for (Schema.Field field : input.getSchema().getFields()) { Object fieldValue = input.get(field.getName()); String data = (fieldValue != null) ? fieldValue.toString() : NULL_STRING; dataArray.add(data); } emitter.emit(new KeyValue<>(new Text(Joiner.on(",").join(dataArray)), NullWritable.get())); }
Source:
<code>public void testScreenConfiguration() { WindowManager windowManager = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE); Display display = windowManager.getDefaultDisplay(); DisplayMetrics metrics = new DisplayMetrics(); display.getMetrics(metrics); double xInches = (double) metrics.widthPixels / metrics.xdpi; double yInches = (double) metrics.heightPixels / metrics.ydpi; double diagonalInches = Math.sqrt(Math.pow(xInches, 2) + Math.pow(yInches, 2)); assertTrue("Screen diagonal must be at least 2.5 inches: " + diagonalInches, diagonalInches >= 2.5d); double density = 160.0d * metrics.density; assertTrue("Screen density must be at least 100 dpi: " + density, density >= 100.0d); double aspectRatio = (double) Math.max(metrics.widthPixels, metrics.heightPixels) / (double) Math.min(metrics.widthPixels, metrics.heightPixels); <START> assertTrue("Aspect ratio should be between 1.333 (4:3) and 1.779 (16:9): " + aspectRatio, <END> aspectRatio >= 1.333d && aspectRatio <= 1.779d); }</code><technical_language>s/should/must/ Language match language in CDD I suppose</technical_language>

Target:
public void testScreenConfiguration() { WindowManager windowManager = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE); Display display = windowManager.getDefaultDisplay(); DisplayMetrics metrics = new DisplayMetrics(); display.getMetrics(metrics); double xInches = (double) metrics.widthPixels / metrics.xdpi; double yInches = (double) metrics.heightPixels / metrics.ydpi; double diagonalInches = Math.sqrt(Math.pow(xInches, 2) + Math.pow(yInches, 2)); assertTrue("Screen diagonal must be at least 2.5 inches: " + diagonalInches, diagonalInches >= 2.5d); double density = 160.0d * metrics.density; assertTrue("Screen density must be at least 100 dpi: " + density, density >= 100.0d); double aspectRatio = (double) Math.max(metrics.widthPixels, metrics.heightPixels) / (double) Math.min(metrics.widthPixels, metrics.heightPixels); assertTrue("Aspect ratio must be between 1.333 (4:3) and 1.779 (16:9): " + aspectRatio, aspectRatio >= 1.333d && aspectRatio <= 1.779d); }
Source:
<code>protected Text createFilterText(Composite parent) { filterText = new Text(parent, SWT.NONE); Dialog.applyDialogFont(filterText); GridData data = new GridData(GridData.FILL_HORIZONTAL); data.horizontalAlignment = GridData.FILL; data.verticalAlignment = GridData.CENTER; filterText.setLayoutData(data); filterText.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { if (e.keyCode == SWT.CR) { gotoSelectedElement(); dispose(); } else if (e.keyCode == SWT.ARROW_DOWN) { delegate.getTreeViewer().getTree().setFocus(); } else if (e.character == SWT.ESC) { dispose(); } } }); filterText.setText(""); filterText.addModifyListener(e -> { AtomicBoolean firstMatchFound = new AtomicBoolean(false); TreeViewer viewer = delegate.getTreeViewer(); try { viewer.getControl().setRedraw(false); String text = filterText.getText(); Pattern pattern = Pattern.compile( ".*" + text.replace('?', '.').replaceAll("\\*", "\\.\\*") + ".*", <START> Pattern.CASE_INSENSITIVE); <END> viewer.setFilters(new ViewerFilter() { @Override public boolean select(Viewer v, Object parentElement, Object element) { boolean result = isMatch(text, pattern, element); if (result && element instanceof FileDiffRegion && !firstMatchFound.getAndSet(true)) { viewer.setSelection( new StructuredSelection(element)); } return result; } }); viewer.expandAll(); } finally { viewer.getControl().setRedraw(true); } }); return filterText; }</code><technical_language>This do. logs PatternSyntaxExceptions. enter [ \g</technical_language>

Target:
protected Text createFilterText(Composite parent) { filterText = new Text(parent, SWT.NONE); Dialog.applyDialogFont(filterText); GridData data = new GridData(GridData.FILL_HORIZONTAL); data.horizontalAlignment = GridData.FILL; data.verticalAlignment = GridData.CENTER; filterText.setLayoutData(data); filterText.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { if (e.keyCode == SWT.CR) { gotoSelectedElement(); dispose(); } else if (e.keyCode == SWT.ARROW_DOWN) { delegate.getTreeViewer().getTree().setFocus(); } else if (e.character == SWT.ESC) { dispose(); } } }); filterText.setText(""); filterText.addModifyListener(e -> { AtomicBoolean firstMatchFound = new AtomicBoolean(false); TreeViewer viewer = delegate.getTreeViewer(); try { viewer.getControl().setRedraw(false); String text = filterText.getText(); if (StringUtils.isEmptyOrNull(text)) { viewer.setFilters(); } else { final SearchPattern pattern = new SearchPattern(); pattern.setPattern(text); viewer.setFilters(new ViewerFilter() { @Override public boolean select(Viewer v, Object parentElement, Object element) { boolean result = isMatch(pattern, element); if (result && element instanceof FileDiffRegion && !firstMatchFound.getAndSet(true)) { viewer.setSelection( new StructuredSelection(element)); } return result; } }); } viewer.expandAll(); } finally { viewer.getControl().setRedraw(true); } }); return filterText; }
Source:
<code>public Obs getRevisionObs(Obs initialObs) { return (Obs) sessionFactory.getCurrentSession() .createQuery("from Obs o where o.previousVersion = :id") <START> .setString("id",initialObs.getId().toString()) <END> .uniqueResult(); }</code><technical_language>Do need get id? Hibernate able work Obs object id, avoid a potential NullPointerException</technical_language>

Target:
public Obs getRevisionObs(Obs initialObs) { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(Obs.class, "obs"); criteria.add(Restrictions.eq("previousVersion", initialObs)); return (Obs) criteria.uniqueResult(); }
Source:
<code>private RequiresHttpAction handleInvalidCredentials(final WebContext context, final String username, String message, String errorMessage, int errorCode) throws RequiresHttpAction { if (getAjaxRequestResolver().isAjax(context)) { logger.info("AJAX request detected -> returning " + errorCode); <START> return RequiresHttpAction.configurable("AJAX request -> " + errorCode, errorCode, context); <END> } else { String redirectionUrl = CommonHelper.addParameter(this.loginUrl, this.usernameParameter, username); redirectionUrl = CommonHelper.addParameter(redirectionUrl, ERROR_PARAMETER, errorMessage); logger.debug("redirectionUrl: {}", redirectionUrl); logger.debug(message); return RequiresHttpAction.redirect(message, context, redirectionUrl); } }</code><technical_language>I clear explicit unauthorized here. I handleInvalidCredentials method longer errorCode parameter</technical_language>

Target:
private RequiresHttpAction handleInvalidCredentials(final WebContext context, final String username, String message, String errorMessage, int errorCode) throws RequiresHttpAction { if (getAjaxRequestResolver().isAjax(context)) { logger.info("AJAX request detected -> returning " + errorCode); return RequiresHttpAction.status("AJAX request -> " + errorCode, errorCode, context); } else { String redirectionUrl = CommonHelper.addParameter(this.loginUrl, this.usernameParameter, username); redirectionUrl = CommonHelper.addParameter(redirectionUrl, ERROR_PARAMETER, errorMessage); logger.debug("redirectionUrl: {}", redirectionUrl); logger.debug(message); return RequiresHttpAction.redirect(message, context, redirectionUrl); } }
Source:
<code>public AsyncFileAlterationObserver(File fileToObserve, ObjectPersistentStore serializer) { <START> if (fileToObserve == null || serializer == null) { <END> throw new IllegalArgumentException(); } this.serializer = serializer; rootFile = new AsyncFileEntry(fileToObserve); }</code><technical_language>this constructor private clients load() method instead? This provide a single, common of creating this class allow remove null checks here</technical_language>

Target:
public AsyncFileAlterationObserver(File fileToObserve, ObjectPersistentStore serializer) { if (fileToObserve == null || serializer == null) { throw new IllegalArgumentException("Arguments can not be null"); } this.serializer = serializer; rootFile = new AsyncFileEntry(fileToObserve); }
Source:
<code>public void register(ExtensionBuilder builder) { <START> if (Validate.classExists("javax.ejb.EJB")) { <END> builder.service(TestEnricher.class, EJBInjectionEnricher.class); } }</code><technical_language>suggestion if (Validate.classExists("jakarta.ejb.EJB")) {</technical_language>

Target:
public void register(ExtensionBuilder builder) { if (Validate.classExists("jakarta.ejb.EJB")) { builder.service(TestEnricher.class, EJBInjectionEnricher.class); } }
Source:
<code>public PythonEggParser(IFile file) throws IOException, CoreException { setupOptions = new HashMap<String, String>(); variables = new HashMap<String, String>(); <START> if (file.getContents().available() <= 0) <END> return; this.file = file; parse(); }</code><technical_language>Common code style in Linux tools is if statements. Please fix everywhere</technical_language>

Target:
public PythonEggParser(IFile file) throws IOException, CoreException { setupOptions = new HashMap<String, String>(); variables = new HashMap<String, String>(); if (file.getContents().available() <= 0) { return; } this.file = file; parse(); }
Source:
<code>public synchronized boolean setRoutingData(Map<String, List<String>> routingData) { if (_leaderElection.isLeader()) { if (_zkClient.isClosed()) { throw new IllegalStateException("ZkClient is closed!"); } if (routingData == null) { throw new IllegalArgumentException("routingData given is null!"); } for (String zkRealm : _zkClient .getChildren(MetadataStoreRoutingConstants.ROUTING_DATA_PATH)) { if (!_zkClient.delete(MetadataStoreRoutingConstants.ROUTING_DATA_PATH + "/" + zkRealm)) { LOG.error( "Failed to delete existing routing data in setRoutingData()! Namespace: {}, Realm: {}", _namespace, zkRealm); return false; } } for (Map.Entry<String, List<String>> routingDataEntry : routingData.entrySet()) { String zkRealm = routingDataEntry.getKey(); List<String> shardingKeyList = routingDataEntry.getValue(); ZNRecord znRecord = new ZNRecord(zkRealm); znRecord .setListField(MetadataStoreRoutingConstants.ZNRECORD_LIST_FIELD_KEY, shardingKeyList); try { <START> if (!_zkClient.exists(MetadataStoreRoutingConstants.ROUTING_DATA_PATH + "/" + zkRealm)) { <END> _zkClient .createPersistent(MetadataStoreRoutingConstants.ROUTING_DATA_PATH + "/" + zkRealm); } _zkClient .writeData(MetadataStoreRoutingConstants.ROUTING_DATA_PATH + "/" + zkRealm, znRecord); } catch (Exception e) { LOG.error("Failed to write data in setRoutingData()! Namespace: {}, Realm: {}", _namespace, zkRealm, e); return false; } } return true; } return true; }</code><technical_language>try catch need check if path exists</technical_language>

Target:
public synchronized boolean setRoutingData(Map<String, List<String>> routingData) { if (_leaderElection.isLeader()) { if (_zkClient.isClosed()) { throw new IllegalStateException("ZkClient is closed!"); } if (routingData == null) { throw new IllegalArgumentException("routingData given is null!"); } for (String zkRealm : _zkClient .getChildren(MetadataStoreRoutingConstants.ROUTING_DATA_PATH)) { if (!_zkClient.delete(MetadataStoreRoutingConstants.ROUTING_DATA_PATH + "/" + zkRealm)) { LOG.error( "Failed to delete existing routing data in setRoutingData()! Namespace: {}, Realm: {}", _namespace, zkRealm); return false; } } for (Map.Entry<String, List<String>> routingDataEntry : routingData.entrySet()) { String zkRealm = routingDataEntry.getKey(); List<String> shardingKeyList = routingDataEntry.getValue(); ZNRecord znRecord = new ZNRecord(zkRealm); znRecord .setListField(MetadataStoreRoutingConstants.ZNRECORD_LIST_FIELD_KEY, shardingKeyList); String realmPath = MetadataStoreRoutingConstants.ROUTING_DATA_PATH + "/" + zkRealm; try { if (!_zkClient.exists(realmPath)) { _zkClient.createPersistent(realmPath); } _zkClient.writeData(realmPath, znRecord); } catch (Exception e) { LOG.error("Failed to write data in setRoutingData()! Namespace: {}, Realm: {}", _namespace, zkRealm, e); return false; } } return true; } return true; }
Source:
<code>private <T extends Plugin> List<T> loadInternal(@NonNull Class<T> clazz, Predicate<T> shouldLoadPredicate) { List<T> plugins = new ArrayList<>(); final ServiceLoader<T> serviceLoader = ServiceLoader.load(clazz, getClass().getClassLoader()); <START> if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "ServicePluginLoader loading services from ServiceLoader : " + serviceLoader); <END> for (final Iterator<T> iterator = serviceLoader.iterator(); iterator.hasNext(); ) { try { final T plugin = iterator.next(); if (ACRA.DEV_LOGGING) ACRA.log.d(ACRA.LOG_TAG, "Found plugin : " + plugin); if (shouldLoadPredicate.apply(plugin)) { if (ACRA.DEV_LOGGING) ACRA.log.d(ACRA.LOG_TAG, "Loaded " + clazz.getSimpleName() + " of type " + plugin.getClass().getName()); plugins.add(plugin); } else { if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Ignoring disabled " + clazz.getSimpleName() + " of type " + plugin.getClass().getSimpleName()); } } catch (ServiceConfigurationError e) { ACRA.log.e(ACRA.LOG_TAG, "Unable to load " + clazz.getSimpleName(), e); } } if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Found services (" + plugins + ") for class : " + clazz); return plugins; }</code><technical_language>In case this print useful information</technical_language>

Target:
private <T extends Plugin> List<T> loadInternal(@NonNull Class<T> clazz, Predicate<T> shouldLoadPredicate) { List<T> plugins = new ArrayList<>(); final ServiceLoader<T> serviceLoader = ServiceLoader.load(clazz, getClass().getClassLoader()); if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "ServicePluginLoader loading services from ServiceLoader : " + serviceLoader); for (final Iterator<T> iterator = serviceLoader.iterator(); iterator.hasNext(); ) { try { final T plugin = iterator.next(); if (shouldLoadPredicate.apply(plugin)) { if (ACRA.DEV_LOGGING) ACRA.log.d(ACRA.LOG_TAG, "Loaded " + clazz.getSimpleName() + " of type " + plugin.getClass().getName()); plugins.add(plugin); } else { if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Ignoring disabled " + clazz.getSimpleName() + " of type " + plugin.getClass().getSimpleName()); } } catch (ServiceConfigurationError e) { ACRA.log.e(ACRA.LOG_TAG, "Unable to load " + clazz.getSimpleName(), e); } } if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Found services (" + plugins + ") for class : " + clazz); return plugins; }
Source:
<code>protected @NonNull ITmfStateProvider createStateProvider() { ITmfTrace trace = getTrace(); <START> if (!(trace instanceof LttngKernelTrace)) { <END> throw new IllegalStateException("LttngKernelStateSystemModule: trace should be of type LttngKernelTrace"); } return new LttngKernelStateProvider((LttngKernelTrace) trace); }</code><technical_language>This check moved setTrace() (overridden version calls super.setTrace()). getTrace() overridden in this class return a LttngKernelTrace</technical_language>

Target:
protected @NonNull ITmfStateProvider createStateProvider() { return new LttngKernelStateProvider(getTrace()); }
Source:
<code>public void writeRecord(E record) throws IOException { if (currentBuffer == null) { <START> this.currentBuffer = this.dispatcher.take(SortStage.READ); <END> if (!currentBuffer.getBuffer().isEmpty()) { throw new IOException("New buffer is not empty."); } } InMemorySorter<E> sorter = currentBuffer.getBuffer(); long occupancyPreWrite = sorter.getOccupancy(); if (!sorter.write(record)) { long recordSize = sorter.getCapacity() - occupancyPreWrite; signalSpillingIfNecessary(recordSize); boolean isLarge = occupancyPreWrite == 0; if (isLarge) { writeLarge(record, sorter); this.currentBuffer.getBuffer().reset(); } else { this.dispatcher.send(SortStage.SORT, currentBuffer); this.currentBuffer = null; writeRecord(record); } } else { long recordSize = sorter.getOccupancy() - occupancyPreWrite; signalSpillingIfNecessary(recordSize); } }</code><technical_language>concern infinite waiting for next buffer if spilling thread throws exception, current thread (I task main thread) get notified waiting here. In this case task able failover</technical_language>

Target:
public void writeRecord(E record) throws IOException, InterruptedException { if (currentBuffer == null) { this.currentBuffer = this.dispatcher.take(SortStage.READ); if (!currentBuffer.getBuffer().isEmpty()) { throw new IOException("New buffer is not empty."); } } InMemorySorter<E> sorter = currentBuffer.getBuffer(); long occupancyPreWrite = sorter.getOccupancy(); if (!sorter.write(record)) { long recordSize = sorter.getCapacity() - occupancyPreWrite; signalSpillingIfNecessary(recordSize); boolean isLarge = occupancyPreWrite == 0; if (isLarge) { writeLarge(record, sorter); this.currentBuffer.getBuffer().reset(); } else { this.dispatcher.send(SortStage.SORT, currentBuffer); this.currentBuffer = null; writeRecord(record); } } else { long recordSize = sorter.getOccupancy() - occupancyPreWrite; signalSpillingIfNecessary(recordSize); } }
Source:
<code>public InterfaceConfiguration getInterfaceConfig(String iface) { mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG); final InterfaceConfigurationParcel result; try { result = mNetdService.interfaceGetCfg(iface); } catch (RemoteException | ServiceSpecificException e) { throw new IllegalStateException(e); } InterfaceConfiguration cfg; try { <START> cfg = new InterfaceConfiguration(); cfg.setHardwareAddress(result.hwAddr); InetAddress addr = null; try { addr = NetworkUtils.numericToInetAddress(result.addr); } catch (IllegalArgumentException iae) { Slog.e(TAG, "Failed to parse ipaddr", iae); } cfg.setLinkAddress(new LinkAddress(addr, result.prefixLength)); for (String flag : result.flags) { cfg.setFlag(flag); } <END> } catch (NoSuchElementException nsee) { throw new IllegalStateException("Invalid response from binder"); } return cfg; }</code><technical_language>Instead of putting this code inline here, sense in a new fromParcel() fromInterfaceConfigurationParcel() method InterfaceConfiguration</technical_language>

Target:
public InterfaceConfiguration getInterfaceConfig(String iface) { mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG); final InterfaceConfigurationParcel result; try { result = mNetdService.interfaceGetCfg(iface); } catch (RemoteException | ServiceSpecificException e) { throw new IllegalStateException(e); } try { final InterfaceConfiguration cfg = InterfaceConfiguration.fromParcel(result); return cfg; } catch (IllegalArgumentException iae) { throw new IllegalStateException("Failed to parse ipaddr", iae); } }
Source:
<code>public void setFanSpeed(final int fanSpeed) { mDataStore.setFanSpeed(fanSpeed); final AsyncTask<Void, Void, Void> task = new AsyncTask<Void, Void, Void>() { int newFanSpeed; protected Void doInBackground(Void... unused) { if (mHvacManager != null) { int zone = SEAT_ALL; try { if (Log.isLoggable(TAG, Log.DEBUG)) { Log.d(TAG, "Setting fanspeed to: " + fanSpeed); } mHvacManager.setIntProperty( CarHvacManager.ID_ZONED_FAN_SPEED_SETPOINT, zone, fanSpeed); newFanSpeed = mHvacManager.getIntProperty( CarHvacManager.ID_ZONED_FAN_SPEED_SETPOINT, zone); } catch (android.car.CarNotConnectedException e) { Log.e(TAG, "Car not connected in setFanSpeed"); } catch (IllegalStateException e) { Log.e(TAG, "IllegalStateException: Car can not setFanSpeed in <START> current state: power off"); <END> } } return null; } @Override protected void onPostExecute(final Void result) { Log.e(TAG, "postExecute new fanSpeed: " + newFanSpeed); } }; task.execute(); }</code><technical_language>guarantee current state is "power off"? Is IllegalStateException thrown in status</technical_language>

Target:
public void setFanSpeed(final int fanSpeed) { mDataStore.setFanSpeed(fanSpeed); final AsyncTask<Void, Void, Void> task = new AsyncTask<Void, Void, Void>() { int newFanSpeed; protected Void doInBackground(Void... unused) { if (mHvacManager != null) { int zone = SEAT_ALL; try { if (Log.isLoggable(TAG, Log.DEBUG)) { Log.d(TAG, "Setting fanspeed to: " + fanSpeed); } mHvacManager.setIntProperty( CarHvacManager.ID_ZONED_FAN_SPEED_SETPOINT, zone, fanSpeed); newFanSpeed = mHvacManager.getIntProperty( CarHvacManager.ID_ZONED_FAN_SPEED_SETPOINT, zone); } catch (android.car.CarNotConnectedException e) { Log.e(TAG, "Car not connected in setFanSpeed"); } catch (IllegalStateException e) { Log.e(TAG, "Car is in illegal state when setFanSpeed"); } } return null; } @Override protected void onPostExecute(final Void result) { Log.e(TAG, "postExecute new fanSpeed: " + newFanSpeed); } }; task.execute(); }
Source:
<code>public ChallangeResponse getChallangeResponseFromHeader(final String challangeHeaderValue, <START> final String endpoint) throws UnsupportedEncodingException, UnexpectedServerResponseException { <END> ChallangeRequest request = getChallangeRequestFromHeader(challangeHeaderValue); request.mSubmitUrl = endpoint; return getDeviceCertResponse(request); }</code><technical_language>ResourceAuthenticationChallengeException thrown AuthenticationParameters class. class is parsing challenges resources. This class is parsing device auth challenges authentication server, resource</technical_language>

Target:
public ChallangeResponse getChallangeResponseFromHeader(final String challangeHeaderValue, final String endpoint) throws UnsupportedEncodingException, AuthenticationServerProtocolException { ChallangeRequest request = getChallangeRequestFromHeader(challangeHeaderValue); request.mSubmitUrl = endpoint; return getDeviceCertResponse(request); }
Source:
<code>Map<byte[], List<byte[]>> findRegionsToForceFlush() throws IOException { Map<byte[], List<byte[]>> regions = null; int logCount = getNumRolledLogFiles(); if (logCount > this.maxLogs && logCount > 0) { Map.Entry<Path, WalProps> firstWALEntry = this.walFile2Props.firstEntry(); regions = this.sequenceIdAccounting.findLower(firstWALEntry.getValue().encodedName2HighestSequenceId); } if (regions != null) { List<String> listForPrint = new ArrayList(); for (Map.Entry<byte[], List<byte[]>> r : regions.entrySet()) { <START> StringBuffer families = new StringBuffer(); <END> for (int i = 0; i < r.getValue().size(); i++) { if (i > 0) { families.append("|"); } families.append(Bytes.toString(r.getValue().get(i))); } listForPrint.add(Bytes.toStringBinary(r.getKey()) + "[" + families.toString() + "]"); } LOG.info("Too many WALs; count=" + logCount + ", max=" + this.maxLogs + "; forcing flush partial stores of " + regions.size() + " region(s): " + StringUtils.join(",", listForPrint)); } return regions; }</code><technical_language>StringBuilder</technical_language>

Target:
Map<byte[], List<byte[]>> findRegionsToForceFlush() throws IOException { Map<byte[], List<byte[]>> regions = null; int logCount = getNumRolledLogFiles(); if (logCount > this.maxLogs && logCount > 0) { Map.Entry<Path, WalProps> firstWALEntry = this.walFile2Props.firstEntry(); regions = this.sequenceIdAccounting.findLower(firstWALEntry.getValue().encodedName2HighestSequenceId); } if (regions != null) { List<String> listForPrint = new ArrayList(); for (Map.Entry<byte[], List<byte[]>> r : regions.entrySet()) { StringBuilder families = new StringBuilder(); for (int i = 0; i < r.getValue().size(); i++) { if (i > 0) { families.append(","); } families.append(Bytes.toString(r.getValue().get(i))); } listForPrint.add(Bytes.toStringBinary(r.getKey()) + "[" + families.toString() + "]"); } LOG.info("Too many WALs; count=" + logCount + ", max=" + this.maxLogs + "; forcing (partial) flush of " + regions.size() + " region(s): " + StringUtils.join(",", listForPrint)); } return regions; }
Source:
<code>public void deleteAuthorizationSuccessTest() throws Exception { short[] accountIds = {-1, Utils.getRandomShort(TestUtils.RANDOM), -1}; short[] containerIds = {-1, -1, Utils.getRandomShort(TestUtils.RANDOM)}; for (int i = 0; i < accountIds.length; i++) { MockId mockId = putSingleBlob(UtilsTest.getRandomString(10), accountIds[i], containerIds[i]); MessageInfo info = new MessageInfo(mockId, DELETE_RECORD_SIZE, Utils.getRandomShort(TestUtils.RANDOM), Utils.getRandomShort(TestUtils.RANDOM), System.currentTimeMillis()); MessageWriteSet writeSet = new MockMessageWriteSet(Collections.singletonList(info), Collections.singletonList(ByteBuffer.allocate(DELETE_RECORD_SIZE))); <START> store.delete(writeSet); <END> verifyDeleteFailure(mockId, StoreErrorCodes.ID_Deleted); } }</code><technical_language>changing account container ID in ID though, this test relevant (like do in equivalent test in GET)</technical_language>

Target:
public void deleteAuthorizationSuccessTest() throws Exception { short[] accountIds = {-1, Utils.getRandomShort(TestUtils.RANDOM), -1}; short[] containerIds = {-1, -1, Utils.getRandomShort(TestUtils.RANDOM)}; for (int i = 0; i < accountIds.length; i++) { MockId mockId = put(1, PUT_RECORD_SIZE, Utils.Infinite_Time, accountIds[i], containerIds[i]).get(0); delete( new MockId(mockId.getID(), Utils.getRandomShort(TestUtils.RANDOM), Utils.getRandomShort(TestUtils.RANDOM))); verifyDeleteFailure(mockId, StoreErrorCodes.ID_Deleted); } }
Source:
<code><START> public void insert(MUIElement toInsert, MUIElement relTo, <END> int swtSide, float ratio) { int pct = (int) (ratio * 10000); insert(toInsert, relTo, swtSide, pct); }</code><technical_language>check, this method declared private</technical_language>

Target:
private void insert(MUIElement toInsert, MUIElement relTo, int swtSide, float ratio) { int pct = (int) (ratio * 10000); insert(toInsert, relTo, swtSide, pct); }
Source:
<code>protected SamLocusIterator getLocusIterator(final SamReader in) { if(INTERVALS != null){ <START> IOUtil.assertFileIsReadable(INTERVALS); <END> return new SamLocusIterator(in, IntervalList.fromFile(INTERVALS)); } return new SamLocusIterator(in); }</code><technical_language>note spacing</technical_language>

Target:
protected SamLocusIterator getLocusIterator(final SamReader in) { return (INTERVALS != null) ? new SamLocusIterator(in, IntervalList.fromFile(INTERVALS)) : new SamLocusIterator(in); }