auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private Guid getQuotaIdForDisk(DiskImage diskImage) { if (getParameters().getDiskInfoDestinationMap() != null && getParameters().getDiskInfoDestinationMap().get(diskImage.getId()) != null) { return getParameters().getDiskInfoDestinationMap().get(diskImage.getId()).getQuotaId(); <START> } else { <END> return diskImage.getQuotaId(); } }</code><technical_language>consider removing else clause</technical_language>

Target:
private Guid getQuotaIdForDisk(DiskImage diskImage) { if (getParameters().getDiskInfoDestinationMap() != null && getParameters().getDiskInfoDestinationMap().get(diskImage.getId()) != null) { return getParameters().getDiskInfoDestinationMap().get(diskImage.getId()).getQuotaId(); } return diskImage.getQuotaId(); }
Source:
<code>private void validateCommandHandlers() { List<List<MessageHandlingMember<? super T>>> handlers = new ArrayList<>(allCommandHandlers.values()); for (int i = 0; i < handlers.size() - 1; i++) { List<CommandMessageHandlingMember<? super T>> factoryCommands1 = factoryCommands(handlers.get(i)); List<CommandMessageHandlingMember<? super T>> factoryCommands2 = factoryCommands(handlers.get(i + 1)); for (CommandMessageHandlingMember<? super T> handler1 : factoryCommands1) { for (CommandMessageHandlingMember<? super T> handler2 : factoryCommands2) { <START> Class<?> declaringClass1 = handler1.unwrap(Executable.class).get().getDeclaringClass(); END> Class<?> declaringClass2 = handler2.unwrap(Executable.class).get().getDeclaringClass(); String commandName1 = handler1.commandName(); String commandName2 = handler2.commandName(); if (commandName1.equals(commandName2) && !declaringClass1.equals(declaringClass2)) { throw new AggregateModellingException(format( "Aggregates %s and %s have the same creation @CommandHandler %s", declaringClass1, declaringClass2, commandName1)); } } } } }</code><technical_language>Is this TODO present in subsequent commits? If so, resolve this prior merging</technical_language>

Target:
private void validateCommandHandlers() { List<List<MessageHandlingMember<? super T>>> handlers = new ArrayList<>(allCommandHandlers.values()); for (int i = 0; i < handlers.size() - 1; i++) { List<CommandMessageHandlingMember<? super T>> factoryCommands1 = factoryCommands(handlers.get(i)); List<CommandMessageHandlingMember<? super T>> factoryCommands2 = factoryCommands(handlers.get(i + 1)); for (CommandMessageHandlingMember<? super T> handler1 : factoryCommands1) { for (CommandMessageHandlingMember<? super T> handler2 : factoryCommands2) { String commandName1 = handler1.commandName(); String commandName2 = handler2.commandName(); if (commandName1.equals(commandName2)) { Class<?> declaringClass1 = handler1.declaringClass(); Class<?> declaringClass2 = handler2.declaringClass(); if (!declaringClass1.equals(declaringClass2)) { throw new AggregateModellingException(format( "Aggregates %s and %s have the same creation @CommandHandler %s", declaringClass1, declaringClass2, commandName1)); } } } } } }
Source:
<code>public void createSemanticTagAgentEntity() throws IOException, JsonParseException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { Annotation storedAnno = createTag(SEMANTICTAG_AGENT_ENTITY, false, true); log.info(storedAnno.getBody().getInternalType()); assertTrue(storedAnno.getMotivation().equals(MotivationTypes.TAGGING.name().toLowerCase())); assertEquals(storedAnno.getBody().getInternalType(), BodyInternalTypes.AGENT.name()); <START> EdmAgent agentBody = (EdmAgent) ((EdmAgentBody) storedAnno.getBody()).getAgent(); <END> assertNotNull(agentBody.getPrefLabel()); }</code><technical_language>Do support fields example? compare body of input body of stored annotation similar validateOutputAgainstInput(Annotation storedAnno, Annotation inputAnno)</technical_language>

Target:
public void createSemanticTagAgentEntity() throws IOException, JsonParseException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { Annotation storedAnno = createTag(SEMANTICTAG_AGENT_ENTITY, false, true); log.info(storedAnno.getBody().getInternalType()); assertTrue(storedAnno.getMotivation().equals(MotivationTypes.TAGGING.name().toLowerCase())); assertEquals(storedAnno.getBody().getInternalType(), BodyInternalTypes.AGENT.name()); EdmAgent agentBody = (EdmAgent) ((EdmAgentBody) storedAnno.getBody()).getAgent(); assertNotNull(agentBody.getPrefLabel()); assertTrue(agentBody.getPrefLabel().size() == 43); assertNotNull(agentBody.getDateOfBirth()); assertNotNull(agentBody.getDateOfDeath()); }
Source:
<code>private void clickStaticItem(OptionsMenuItem optionsMenuItem) { <START> ViewInteraction materialTextView = onView( <END> allOf(withId(R.id.title), withText(optionsMenuItem.getMenuText()), childAtPosition( childAtPosition( withId(R.id.content), 0), 0), isDisplayed())) .perform(click()); }</code><technical_language>Crawling view hierarchy childAtPosition fragile - is a more resilient find items</technical_language>

Target:
private void clickStaticItem(OptionsMenuItem optionsMenuItem) { onView(allOf(withId(ITEM_TITLE), withText(optionsMenuItem.getMenuText()))).perform(click()); }
Source:
<code>public List<String> getPubsubPrefixes() { final List<String> pubsubPrefixes = options.getList(pubsubTopicPrefixArg.getDest()); <START> return pubsubPrefixes.isEmpty() ? null : pubsubPrefixes; <END> }</code><technical_language>i this is existing pattern feels weird this returns null empty list, especially provider.senders() method logic return empty list is enabled</technical_language>

Target:
public List<String> getPubsubPrefixes() { return options.getList(pubsubTopicPrefixArg.getDest()); }
Source:
<code>public void attachServoControl(ServoControl servo) throws Exception { if (isAttached(servo)) { return; } int pin = getAddress(servo.getPin()); double targetOutput = servo.getTargetOutput(); <START> double velocity = servo.getSpeed(); <END> Integer deviceId = attachDevice(servo, new Object[] { pin, targetOutput, velocity }); int uS = degreeToMicroseconds(targetOutput); msg.servoAttach(deviceId, pin, uS, (int) velocity, servo.getName()); servo.attach(this); }</code><technical_language>velocity</technical_language>

Target:
public void attachServoControl(ServoControl servo) throws Exception { if (isAttached(servo)) { return; } int pin = getAddress(servo.getPin()); double targetOutput = servo.getTargetOutput(); double velocity = (servo.getSpeed() == null)?-1:servo.getSpeed(); Integer deviceId = attachDevice(servo, new Object[] { pin, targetOutput, velocity }); int uS = degreeToMicroseconds(targetOutput); msg.servoAttach(deviceId, pin, uS, (int) velocity, servo.getName()); servo.attach(this); }
Source:
<code>public void visit(NodeTraversal t, Node n, Node parent) { JSDocInfo bestJSDocInfo = null; switch (n.getToken()) { case FUNCTION: bestJSDocInfo = NodeUtil.getBestJSDocInfo(n); if (bestJSDocInfo != null && (bestJSDocInfo.isConstructor() || bestJSDocInfo.isInterface())) { convertConstructorToClass(n, bestJSDocInfo); } break; case CALL: if ("goog.defineClass".equals(n.getFirstChild().getQualifiedName())) { convertDefineClassToClass(n); } break; case GETPROP: bestJSDocInfo = NodeUtil.getBestJSDocInfo(n); if (bestJSDocInfo != null && bestJSDocInfo.hasTypedefType()) { Node typedefNode = bestJSDocInfo.getTypedefType().getRoot(); if (containsSimpleTypes(typedefNode)) { <START> createTypeAlias(n, parent); <END> } else { String interfaceName = n.getSecondChild().getString(); Node interfaceMember = Node.newString(Token.INTERFACE_MEMBERS, interfaceName); typesToRename.put(n.getQualifiedName(), interfaceName); typesToFilename.put(n.getQualifiedName(), n.getSourceFileName()); types.put(interfaceName, interfaceMember); interfaceMember.setJSDocInfo(bestJSDocInfo); Node interfaceNode = new Node(Token.INTERFACE, IR.empty(), IR.empty(), interfaceMember); Node nameNode = Node.newString(Token.NAME, interfaceName); nameNode.addChildToBack(interfaceNode); Node exportNode = new Node(Token.EXPORT, new Node(Token.CONST, nameNode)); replaceExpressionOrAssignment(n, parent, exportNode); } } break; case NAME: case VAR: case LET: case CONST: createTypeAlias(n, parent); break; default: break; } }</code><technical_language>break return this, instead of indented else</technical_language>

Target:
public void visit(NodeTraversal t, Node n, Node parent) { JSDocInfo bestJSDocInfo = null; switch (n.getToken()) { case FUNCTION: bestJSDocInfo = NodeUtil.getBestJSDocInfo(n); if (bestJSDocInfo != null && (bestJSDocInfo.isConstructor() || bestJSDocInfo.isInterface())) { convertConstructorToClass(n, bestJSDocInfo); } break; case CALL: if ("goog.defineClass".equals(n.getFirstChild().getQualifiedName())) { convertDefineClassToClass(n); } break; case GETPROP: bestJSDocInfo = NodeUtil.getBestJSDocInfo(n); if (bestJSDocInfo == null || !bestJSDocInfo.hasTypedefType()) { break; } Node typedefNode = bestJSDocInfo.getTypedefType().getRoot(); if (containsObject(typedefNode)) { String interfaceName = n.getSecondChild().getString(); Node interfaceMember = Node.newString(Token.INTERFACE_MEMBERS, interfaceName); typesToRename.put(n.getQualifiedName(), interfaceName); typesToFilename.put(n.getQualifiedName(), n.getSourceFileName()); types.put(interfaceName, interfaceMember); interfaceMember.setJSDocInfo(bestJSDocInfo); Node interfaceNode = new Node(Token.INTERFACE, IR.empty(), IR.empty(), interfaceMember); Node nameNode = Node.newString(Token.NAME, interfaceName); nameNode.addChildToBack(interfaceNode); Node exportNode = new Node(Token.EXPORT, new Node(Token.CONST, nameNode)); replaceExpressionOrAssignment(n, parent, exportNode); break; } createTypeAlias(n, parent); break; case NAME: case VAR: case LET: case CONST: createTypeAlias(n, parent); break; default: break; } }
Source:
<code>public void aggregationLimit() throws Exception { final QueryResult result = query("sum(10ms) by *", builder -> { <START> builder.options(Optional.of(QueryOptions.builder().failOnLimits(true).aggregationLimit(1L).build())); <END> }); System.out.println(result); assertEquals(2, result.getErrors().size()); for (final RequestError e : result.getErrors()) { System.out.println(e); assertTrue((e instanceof QueryError)); final QueryError q = (QueryError) e; assertThat(q.getError(), containsString("Query exceeded quota")); } assertEquals(ResultLimits.of(ResultLimit.AGGREGATION), result.getLimits()); }</code><technical_language>failOnLimits needed here</technical_language>

Target:
public void aggregationLimit() throws Exception { final QueryResult result = query("sum(10ms) by *", builder -> { builder.options(Optional.of(QueryOptions.builder().aggregationLimit(1L).build())); }); assertEquals(2, result.getErrors().size()); for (final RequestError e : result.getErrors()) { assertTrue((e instanceof QueryError)); final QueryError q = (QueryError) e; assertThat(q.getError(), containsString("Query exceeded quota")); } assertEquals(ResultLimits.of(ResultLimit.AGGREGATION), result.getLimits()); }
Source:
<code><START> public int hashCode() { <END> final int prime = 31; int result = 1; result = prime * result + ((id == null) ? 0 : id.hashCode()); result = prime * result + ((diskAlias == null) ? 0 : diskAlias.hashCode()); result = prime * result + ((diskDescription == null) ? 0 : diskDescription.hashCode()); result = prime * result + ((diskInterface == null) ? 0 : diskInterface.hashCode()); result = prime * result + ((propagateErrors == null) ? 0 : propagateErrors.hashCode()); result = prime * result + (shareable ? 1231 : 1237); result = prime * result + (isWipeAfterDelete() ? 1231 : 1237); result = prime * result + (boot ? 1231 : 1237); result = prime * result + ((sgio == null) ? 0 : sgio.hashCode()); return result; }</code><technical_language>part of hashcode && equals</technical_language>

Target:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((id == null) ? 0 : id.hashCode()); result = prime * result + ((diskAlias == null) ? 0 : diskAlias.hashCode()); result = prime * result + ((diskDescription == null) ? 0 : diskDescription.hashCode()); result = prime * result + ((diskInterface == null) ? 0 : diskInterface.hashCode()); result = prime * result + ((propagateErrors == null) ? 0 : propagateErrors.hashCode()); result = prime * result + (shareable ? 1231 : 1237); result = prime * result + (isWipeAfterDelete() ? 1231 : 1237); result = prime * result + (boot ? 1231 : 1237); result = prime * result + ((sgio == null) ? 0 : sgio.hashCode()); result = prime * result + ((cinderVolumeType == null) ? 0 : cinderVolumeType.hashCode()); return result; }
Source:
<code>protected void check() throws IOException, ServletException { String exe = fixEmpty(request.getParameter("value")); if(exe==null) { ok(); return; } if(exe.indexOf(File.separatorChar)>=0) { File f = new File(exe); if(f.exists()) { checkExecutable(f); return; } File fexe = new File(exe+".exe"); if(fexe.exists()) { checkExecutable(fexe); return; } error("There's no such file: "+exe); } else { String path = EnvVars.masterEnvVars.get("PATH"); String tokenizedPath; String delimiter = null; if(path!=null) { StringBuilder tokenizedPathBuilder = new StringBuilder(); for (String _dir : Util.tokenize(path.replace("\\", "\\\\"),File.pathSeparator)) { if (delimiter == null) { delimiter = ", "; } else { tokenizedPathBuilder.append(delimiter); } tokenizedPathBuilder.append(_dir.replace('\\', '/')); File dir = new File(_dir); File f = new File(dir,exe); if(f.exists()) { checkExecutable(f); return; } File fexe = new File(dir,exe+".exe"); if(fexe.exists()) { checkExecutable(fexe); return; } } tokenizedPath = tokenizedPathBuilder.toString(); <START> <END> tokenizedPath += "."; } else { tokenizedPath = "unavailable."; } error("There's no such executable "+exe+" in PATH: "+tokenizedPath); } }</code><technical_language>add append StringBuilder well</technical_language>

Target:
protected void check() throws IOException, ServletException { String exe = fixEmpty(request.getParameter("value")); if(exe==null) { ok(); return; } if(exe.indexOf(File.separatorChar)>=0) { File f = new File(exe); if(f.exists()) { checkExecutable(f); return; } File fexe = new File(exe+".exe"); if(fexe.exists()) { checkExecutable(fexe); return; } error("There's no such file: "+exe); } else { String path = EnvVars.masterEnvVars.get("PATH"); String tokenizedPath; String delimiter = null; if(path!=null) { StringBuilder tokenizedPathBuilder = new StringBuilder(); for (String _dir : Util.tokenize(path.replace("\\", "\\\\"),File.pathSeparator)) { if (delimiter == null) { delimiter = ", "; } else { tokenizedPathBuilder.append(delimiter); } tokenizedPathBuilder.append(_dir.replace('\\', '/')); File dir = new File(_dir); File f = new File(dir,exe); if(f.exists()) { checkExecutable(f); return; } File fexe = new File(dir,exe+".exe"); if(fexe.exists()) { checkExecutable(fexe); return; } } tokenizedPathBuilder.append('.'); tokenizedPath = tokenizedPathBuilder.toString(); } else { tokenizedPath = "unavailable."; } error("There's no such executable "+exe+" in PATH: "+tokenizedPath); } }
Source:
<code>public static synchronized @NonNull SymbolProviderManager getInstance() { if (INSTANCE == null) { List<@NonNull SymbolProviderFactoryWrapper> providers = new ArrayList<>(); IConfigurationElement[] configElements = Platform.getExtensionRegistry().getConfigurationElementsFor(EXTENSION_POINT_ID); for (IConfigurationElement element : configElements) { if (ELEM_NAME_PROVIDER.equals(element.getName())) { try { Object extension = element.createExecutableExtension(ATTR_CLASS); int priority = 0; try { priority = Integer.parseInt(element.getAttribute(ATTR_PRIORITY)); } catch (NumberFormatException e) { } providers.add(new SymbolProviderFactoryWrapper((ISymbolProviderFactory) extension, priority)); } catch (CoreException | ClassCastException e) { Activator.getDefault().logError("Exception while loading extensions", e); } } } <START> providers.sort(Comparator.comparingLong(o -> o.priority)); <END> INSTANCE = new SymbolProviderManager(Lists.reverse(providers)); } return INSTANCE; }</code><technical_language>define right comparator directly, need do additional Lists.reverse() afterwards: fProviders.sort(Comparator.<SymbolProviderFactoryWrapper> comparingLong(o -> o.priority).reversed()); extract Comparator a separate variable if find long</technical_language>

Target:
public static synchronized @NonNull SymbolProviderManager getInstance() { if (INSTANCE == null) { List<@NonNull SymbolProviderFactoryWrapper> providers = new ArrayList<>(); IConfigurationElement[] configElements = Platform.getExtensionRegistry().getConfigurationElementsFor(EXTENSION_POINT_ID); for (IConfigurationElement element : configElements) { if (ELEM_NAME_PROVIDER.equals(element.getName())) { try { Object extension = element.createExecutableExtension(ATTR_CLASS); int priority = 0; try { priority = Integer.parseInt(element.getAttribute(ATTR_PRIORITY)); } catch (NumberFormatException e) { } providers.add(new SymbolProviderFactoryWrapper((ISymbolProviderFactory) extension, priority)); } catch (CoreException | ClassCastException e) { Activator.getDefault().logError("Exception while loading extensions", e); } } } providers.sort(Comparator.<SymbolProviderFactoryWrapper> comparingLong(o -> o.priority).reversed()); } return INSTANCE; }
Source:
<code>private Tag next() throws LimitExceededException{ <START> boolean shouldContinue; END> if (iterator != null) { while (iterator.hasNext()) { final Tag tag = iterator.next(); if (Verbs.isVerb(tag)) { shouldContinue=validation(tag); if (current != null && current.hasChildren() && shouldContinue) { final List<Tag> children = current.children(); if (children.contains(tag)) { continue; } } if (tag.name().equals(Verbs.gather) && tag.hasAttribute(GatherAttributes.ATTRIBUTE_HINTS) && !StringUtils.isEmpty(tag.attribute(GatherAttributes.ATTRIBUTE_HINTS).value())) { String hotWords = tag.attribute(GatherAttributes.ATTRIBUTE_HINTS).value(); List<String> hintList = Arrays.asList(hotWords.split(",")); if (hintList.size() > 50) { throw new LimitExceededException("HotWords limit exceeded. There are more than 50 phrases"); } for (String hint : hintList) { if (hint.length() > 100) { throw new LimitExceededException("HotWords limit exceeded. Hint with more than 100 characters found"); } } } current = tag; return current; } } } else { if(logger.isInfoEnabled()){ logger.info("iterator is null"); } } return null; }</code><technical_language>rename var "attsValidated" means attrbiutes correctly validated</technical_language>

Target:
private Tag next() throws LimitExceededException{ boolean AttributteValidator; if (iterator != null) { while (iterator.hasNext()) { final Tag tag = iterator.next(); if (Verbs.isVerb(tag)) { AttributteValidator=validation(tag); if (current != null && current.hasChildren()) { final List<Tag> children = current.children(); if (children.contains(tag)) { continue; } } if (tag.name().equals(Verbs.gather) && tag.hasAttribute(GatherAttributes.ATTRIBUTE_HINTS) && !StringUtils.isEmpty(tag.attribute(GatherAttributes.ATTRIBUTE_HINTS).value())) { String hotWords = tag.attribute(GatherAttributes.ATTRIBUTE_HINTS).value(); List<String> hintList = Arrays.asList(hotWords.split(",")); if (hintList.size() > 50) { throw new LimitExceededException("HotWords limit exceeded. There are more than 50 phrases"); } for (String hint : hintList) { if (hint.length() > 100) { throw new LimitExceededException("HotWords limit exceeded. Hint with more than 100 characters found"); } } } current = tag; return current; } } } else { if(logger.isInfoEnabled()){ logger.info("iterator is null"); } } return null; }
Source:
<code>public void process(Element element, JCodeModel codeModel, EBeanHolder holder) { CustomTitle annotation = element.getAnnotation(CustomTitle.class); JFieldRef customTitleFeature = holder.classes().WINDOW.staticRef("FEATURE_CUSTOM_TITLE"); holder.init.body().invoke("requestWindowFeature").arg(customTitleFeature); <START> holder.afterSetContentView.body().add(holder.contextRef.invoke("getWindow").invoke("setFeatureInt").arg(customTitleFeature).arg(lit(annotation.value()))); <END> }</code><technical_language>lit(annotation.value()) output int directly. Instead want output R field, R.layout.component in example. @EActivity call setContentView(), please check EActivityProcessor</technical_language>

Target:
public void process(Element element, JCodeModel codeModel, EBeanHolder holder) { JFieldRef customTitleFeature = holder.classes().WINDOW.staticRef("FEATURE_CUSTOM_TITLE"); holder.init.body().invoke("requestWindowFeature").arg(customTitleFeature); JFieldRef contentViewId = annotationHelper.extractAnnotationFieldRefs(holder, element, CustomTitle.class, rClass.get(Res.LAYOUT), false).get(0); holder.afterSetContentView.body().add(holder.contextRef.invoke("getWindow").invoke("setFeatureInt").arg(customTitleFeature).arg(contentViewId)); }
Source:
<code>protected IMicroblockContainerTile getMicroblockTile(IBlockAccess world, BlockPos pos) <START> { <END> TileEntity tile = world.getTileEntity(pos); return tile instanceof IMicroblockContainerTile ? (IMicroblockContainerTile) tile : null; }</code><technical_language>Instanceof nightmare</technical_language>

Target:
protected IMicroblockContainerTile getMicroblockTile(IBlockAccess world, BlockPos pos) { TileEntity tile = world.getTileEntity(pos); if (tile == null) { return null; } return getMicroblockTile(tile); }
Source:
<code>public void close() { try { reader.close(); } catch (IOException e) { <START> throw new RuntimeException(e); <END> } }</code><technical_language>I of UncheckedIOException earlier. here</technical_language>

Target:
public void close() { try { reader.close(); } catch (IOException e) { throw new UncheckedIOException(e); } }
Source:
<code>public void testUninstanciableLocalClass001() throws Exception { File outDir = AbstractTestTools.createTempDir(); <START> IToolchain toolchain <END> = AbstractTestTools.getCandidateToolchain(); ByteArrayOutputStream out = new ByteArrayOutputStream(); ByteArrayOutputStream err = new ByteArrayOutputStream(); toolchain.setOutputStream(out); toolchain.setErrorStream(err); toolchain.addToClasspath(toolchain.getDefaultBootClasspath()) .srcToLib( outDir, false, AbstractTestTools.getTestRootDir("com.android.jack.frontend.test004.jack")); Assert.assertEquals(0, out.size()); String errString = err.toString(); int warnIndex = errString.indexOf("WARNING:"); Assert.assertTrue(warnIndex != -1); Assert.assertTrue(errString.indexOf("WARNING:", warnIndex + 1) != -1); }</code><technical_language>nit: JackBasedToolchain, check a specific error message</technical_language>

Target:
public void testUninstanciableLocalClass001() throws Exception { File outDir = AbstractTestTools.createTempDir(); IToolchain toolchain = AbstractTestTools.getCandidateToolchain(); ByteArrayOutputStream out = new ByteArrayOutputStream(); ByteArrayOutputStream err = new ByteArrayOutputStream(); toolchain.setOutputStream(out); toolchain.setErrorStream(err); toolchain.addToClasspath(toolchain.getDefaultBootClasspath()) .srcToLib( outDir, false, AbstractTestTools.getTestRootDir("com.android.jack.frontend.test004.jack")); Assert.assertEquals(0, out.size()); String errString = err.toString(); int warnIndex = errString.indexOf("WARNING:"); Assert.assertTrue(warnIndex != -1); warnIndex = errString.indexOf("WARNING:", warnIndex + 1); Assert.assertTrue(warnIndex != -1); Assert.assertTrue(errString.indexOf("WARNING:", warnIndex + 1) == -1); }
Source:
<code>public void test() { SensorContextTester context = SensorContextTester.create(MODULE_BASE_DIR); <START> HashMap<InputFile, Set<Integer>> projectLinesOfCode = new HashMap<>(); <END> saveMetrics(context, projectLinesOfCode, false); assertThat(context.measure(COMPONENT_KEY, CoreMetrics.FUNCTIONS).value()).isEqualTo(1); assertThat(context.measure(COMPONENT_KEY, CoreMetrics.STATEMENTS).value()).isEqualTo(1); assertThat(context.measure(COMPONENT_KEY, CoreMetrics.CLASSES).value()).isEqualTo(0); assertThat(projectLinesOfCode).hasSize(1); Set<Integer> linesOfCode = projectLinesOfCode.get(INPUT_FILE); assertThat(linesOfCode).containsOnly(2, 3, 4); }</code><technical_language>@vilchik-elena Map HashMap</technical_language>

Target:
public void test() { SensorContextTester context = SensorContextTester.create(MODULE_BASE_DIR); MetricsVisitor metricsVisitor = saveMetrics(context, false); assertThat(context.measure(COMPONENT_KEY, CoreMetrics.FUNCTIONS).value()).isEqualTo(1); assertThat(context.measure(COMPONENT_KEY, CoreMetrics.STATEMENTS).value()).isEqualTo(1); assertThat(context.measure(COMPONENT_KEY, CoreMetrics.CLASSES).value()).isEqualTo(0); assertThat(metricsVisitor.linesOfCode().get(INPUT_FILE)).containsOnly(2, 3, 4); }
Source:
<code>private static void convertAndAdd(Map<String, Object> config, CheckpointManagerConfigKey key, Object value) { if (key != null) { switch (key.getType()) { case INTEGER: config.put(key.value(), TypeUtils.getInteger(value)); break; case LONG: config.put(key.value(), TypeUtils.getLong(value)); break; case STRING: config.put(key.value(), value); break; <START> case OBJECT: <END> config.put(key.value(), value); break; default: throw new IllegalArgumentException(String.format( "config key %s is of type %s which is not yet supported", key, key.getType())); } } }</code><technical_language>support generic OBJECT? idea is support specific types</technical_language>

Target:
private static void convertAndAdd(Map<String, Object> config, CheckpointManagerConfigKey key, Object value) { if (key != null) { switch (key.getType()) { case INTEGER: config.put(key.value(), TypeUtils.getInteger(value)); break; case LONG: config.put(key.value(), TypeUtils.getLong(value)); break; case STRING: config.put(key.value(), value); break; case MAP: config.put(key.value(), value); break; default: throw new IllegalArgumentException(String.format( "config key %s is of type %s which is not yet supported", key, key.getType())); } } }
Source:
<code>public boolean validateHostIsTrusted(VDS vds) { List<String> hosts = new ArrayList<String>(); <START> hosts.add(vds.gethost_name()); <END> List<AttestationValue> valueList = attestHosts(hosts); return valueList.get(0).getTrustLevel() == AttestationResultEnum.TRUSTED; }</code><technical_language>please rebased. this method renamed Feb 11</technical_language>

Target:
public boolean validateHostIsTrusted(VDS vds) { List<String> hosts = new ArrayList<String>(); hosts.add(vds.getHostName()); List<AttestationValue> valueList = attestHosts(hosts); return valueList.get(0).getTrustLevel() == AttestationResultEnum.TRUSTED; }
Source:
<code>public Iterable<RowKey> getKeys() { if ( currentState.isEmpty() ) { if ( cleared ) { return Collections.emptyList(); } else { return snapshot.getRowKeys(); } } else { <START> Set<RowKey> keys = new LinkedHashSet<RowKey>( cleared ? currentState.size() : snapshot.size() + currentState.size() ); <END> if ( !cleared ) { for ( RowKey rowKey : snapshot.getRowKeys() ) { keys.add( rowKey ); } } for ( Map.Entry<RowKey,AssociationOperation> op : currentState.entrySet() ) { switch ( op.getValue().getType() ) { case PUT: keys.add( op.getKey() ); break; case REMOVE: keys.remove( op.getKey() ); break; } } return keys; } }</code><technical_language>here. create a newLinkedHashSet method in CollectionHelper optimize it</technical_language>

Target:
public Iterable<RowKey> getKeys() { if ( currentState.isEmpty() ) { if ( cleared ) { return Collections.emptyList(); } else { return snapshot.getRowKeys(); } } else { Set<RowKey> keys = CollectionHelper.newLinkedHashSet( cleared ? currentState.size() : snapshot.size() + currentState.size() ); if ( !cleared ) { for ( RowKey rowKey : snapshot.getRowKeys() ) { keys.add( rowKey ); } } for ( Map.Entry<RowKey,AssociationOperation> op : currentState.entrySet() ) { switch ( op.getValue().getType() ) { case PUT: keys.add( op.getKey() ); break; case REMOVE: keys.remove( op.getKey() ); break; } } return keys; } }
Source:
<code>public void onResume() { final Activity activity = getActivity(); if (activity instanceof QuranActivity) { boolean newValueOfShowSuraTranslatedName = quranSettings.isShowSuraTranslatedName(); if (this.showSuraTranslatedName != newValueOfShowSuraTranslatedName) { <START> showHideSuraTranslatedName(newValueOfShowSuraTranslatedName); this.showSuraTranslatedName = newValueOfShowSuraTranslatedName; <END> } disposable = ((QuranActivity) activity).getLatestPageObservable() .first(Constants.NO_PAGE) .observeOn(AndroidSchedulers.mainThread()) .subscribeWith(new DisposableSingleObserver<Integer>() { @Override public void onSuccess(Integer recentPage) { if (recentPage != Constants.NO_PAGE) { int sura = quranDisplayData.safelyGetSuraOnPage(recentPage); int juz = quranInfo.getJuzFromPage(recentPage); int position = sura + juz - 1; mRecyclerView.scrollToPosition(position); } } @Override public void onError(Throwable e) { } }); if (quranSettings.isArabicNames()) { updateScrollBarPositionHoneycomb(); } } super.onResume(); }</code><technical_language>i meant is replace 2 lines like: java final QuranRow[] updatedElements = getSuraList(); adapter.setElements(updatedElements); in onCreate, adapter in a variable call this setter it. expose setter adapter also. remove show/add methods added below</technical_language>

Target:
public void onResume() { final Activity activity = getActivity(); if (activity instanceof QuranActivity) { boolean newValueOfShowSuraTranslatedName = quranSettings.isShowSuraTranslatedName(); if (this.showSuraTranslatedName != newValueOfShowSuraTranslatedName) { showHideSuraTranslatedName(); this.showSuraTranslatedName = newValueOfShowSuraTranslatedName; } disposable = ((QuranActivity) activity).getLatestPageObservable() .first(Constants.NO_PAGE) .observeOn(AndroidSchedulers.mainThread()) .subscribeWith(new DisposableSingleObserver<Integer>() { @Override public void onSuccess(Integer recentPage) { if (recentPage != Constants.NO_PAGE) { int sura = quranDisplayData.safelyGetSuraOnPage(recentPage); int juz = quranInfo.getJuzFromPage(recentPage); int position = sura + juz - 1; mRecyclerView.scrollToPosition(position); } } @Override public void onError(Throwable e) { } }); if (quranSettings.isArabicNames()) { updateScrollBarPositionHoneycomb(); } } super.onResume(); }
Source:
<code>public void channelInactive(final ChannelHandlerContext context) throws Exception { super.channelInactive(context); if (this.apnsConnection.handshakeCompleted) { if (this.apnsConnection.listener != null) { this.apnsConnection.listener.handleConnectionClosure(this.apnsConnection); } } <START> if (this.apnsConnection.gracefulShutdownTimeoutFuture != null) { <END> this.apnsConnection.gracefulShutdownTimeoutFuture.cancel(false); } }</code><technical_language>minor: this shutdown is renamed disconnect</technical_language>

Target:
public void channelInactive(final ChannelHandlerContext context) throws Exception { super.channelInactive(context); if (this.apnsConnection.handshakeCompleted) { if (this.apnsConnection.listener != null) { this.apnsConnection.listener.handleConnectionClosure(this.apnsConnection); } } if (this.apnsConnection.gracefulDisconnectionTimeoutFuture != null) { this.apnsConnection.gracefulDisconnectionTimeoutFuture.cancel(false); } }
Source:
<code>public boolean next(StringValue target) { final char[] data = this.toTokenize.getCharArray(); final int limit = this.limit; int pos = this.pos; for (; pos < limit && Character.isWhitespace(data[pos]); pos++) { <START> ; <END> } if (pos >= limit) { this.pos = pos; return false; } final int start = pos; for (; pos < limit && !Character.isWhitespace(data[pos]); pos++) { ; } this.pos = pos; target.setValue(this.toTokenize, start, pos - start); return true; }</code><technical_language>this is problem before. I want code uglier checkstyle. Is a configure check enforces braces</technical_language>

Target:
public boolean next(StringValue target) { final char[] data = this.toTokenize.getCharArray(); final int limit = this.limit; int pos = this.pos; for (; pos < limit && Character.isWhitespace(data[pos]); pos++) { } if (pos >= limit) { this.pos = pos; return false; } final int start = pos; for (; pos < limit && !Character.isWhitespace(data[pos]); pos++) { } this.pos = pos; target.setValue(this.toTokenize, start, pos - start); return true; }
Source:
<code>public void edit(final VnicInstanceType model) { driver.edit(model); <START> String vnicName = model.getNetworkInterface().getName(); <END> profileEditor.addLabelStyleName(style.noDisplay()); profileEditor.addContentWidgetStyleName(style.contentStyle()); profileEditor.setElementId(ElementIdUtils.createElementId(elementId, vnicName)); syncSelectedItemWithNetworkInterface(model); model.getSelectedItemChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { syncSelectedItemWithNetworkInterface(model); ValueChangeEvent.fire(ProfileInstanceTypeEditor.this, model); } }); }</code><technical_language>This variable is once, removed inlined in line 78</technical_language>

Target:
public void edit(final VnicInstanceType model) { driver.edit(model); profileEditor.addLabelStyleName(style.noDisplay()); profileEditor.addContentWidgetStyleName(style.contentStyle()); profileEditor.setElementId(ElementIdUtils.createElementId(elementId, model.getNetworkInterface().getName())); syncSelectedItemWithNetworkInterface(model); model.getSelectedItemChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { syncSelectedItemWithNetworkInterface(model); ValueChangeEvent.fire(ProfileInstanceTypeEditor.this, model); } }); }
Source:
<code><START> private TimestampCreator getTimestampCreator() { <END> TsBoundPersisterConfiguration timestampBoundPersistence = install.timestampBoundPersistence(); if (PaxosTsBoundPersisterConfiguration.class.isInstance(timestampBoundPersistence)) { return getPaxosTimestampCreator(); } else if (DatabaseTsBoundPersisterConfiguration.class.isInstance(timestampBoundPersistence)) { return new DbBoundTimestampCreator( ((DatabaseTsBoundPersisterConfiguration) timestampBoundPersistence) .keyValueServiceConfig()); } else { throw new RuntimeException(String.format("Unknown TsBoundPersisterConfiguration found %s", timestampBoundPersistence.getClass())); } }</code><technical_language>a method TsBoundPersisterConfiguration class for this, do install.timestampBoundPersistence().getTimestampCreator() avoid nasty reflection</technical_language>

Target:
private TimestampCreator getTimestampCreator() { TsBoundPersisterConfiguration timestampBoundPersistence = install.timestampBoundPersistence(); if (PaxosTsBoundPersisterConfiguration.class.isInstance(timestampBoundPersistence)) { return getPaxosTimestampCreator(); } else if (DatabaseTsBoundPersisterConfiguration.class.isInstance(timestampBoundPersistence)) { return new DbBoundTimestampCreator( ((DatabaseTsBoundPersisterConfiguration) timestampBoundPersistence) .keyValueServiceConfig()); } throw new RuntimeException(String.format("Unknown TsBoundPersisterConfiguration found %s", timestampBoundPersistence.getClass())); }
Source:
<code>public void redraw() { if (!isDrawn()) { draw(); } else { try { beforeLoad(); beforeDataSetLookup(); dataSetHandler.lookupDataSet(new DataSetReadyCallback() { public void callback(DataSet result) { try { dataSet = result; afterDataSetLookup(result); updateVisualization(); afterRedraw(); } catch (Exception e) { showError(new ClientRuntimeError(e)); } } public void notFound() { String uuid = displayerSettings.getDataSetLookup().getDataSetUUID(); getView().errorDataSetNotFound(uuid); handleError("Data set not found: " + uuid); } @Override public boolean onError(final ClientRuntimeError error) { showError(error); <START> drawn = false; <END> return false; } }); } catch (Exception e) { showError(new ClientRuntimeError(e)); } } }</code><technical_language>this code is clear. please give some love</technical_language>

Target:
public void redraw() { if (!isDrawn()) { draw(); } else { try { beforeLoad(); beforeDataSetLookup(); dataSetHandler.lookupDataSet(new DataSetReadyCallback() { public void callback(DataSet result) { try { dataSet = result; afterDataSetLookup(result); updateVisualization(); afterRedraw(); } catch (Exception e) { showError(new ClientRuntimeError(e)); } } public void notFound() { String uuid = displayerSettings.getDataSetLookup().getDataSetUUID(); getView().errorDataSetNotFound(uuid); handleError("Data set not found: " + uuid); } @Override public boolean onError(final ClientRuntimeError error) { showError(error); requestDraw(); return false; } }); } catch (Exception e) { showError(new ClientRuntimeError(e)); } } }
Source:
<code>public DataSink<T> writeAsCsv(String filePath, String rowDelimiter, String fieldDelimiter) { <START> return internalWriteAsCsv(new Path(filePath), rowDelimiter, fieldDelimiter, FileOutputFormat.getDefaultWriteMode()); <END> }</code><technical_language>sure, if do this way. If write mode is explicitly specified, system default write mode used. If decide introduce a client option set write mode for a session, this overwritten system default. internalWriteAsCsv methods, explicit write mode without</technical_language>

Target:
public DataSink<T> writeAsCsv(String filePath, String rowDelimiter, String fieldDelimiter) { return internalWriteAsCsv(new Path(filePath), rowDelimiter, fieldDelimiter, null); }
Source:
<code>public static void assertSingleton(final Class azkabanClass, final Injector injector) { <START> final Object azkabanObj1 = requireNonNull(injector.getInstance(azkabanClass)); <END> final Object azkabanObj2 = requireNonNull(injector.getInstance(azkabanClass)); assertTrue(azkabanObj1 == azkabanObj2); }</code><technical_language>Change requireNonNull another assertion</technical_language>

Target:
public static void assertSingleton(final Class azkabanClass, final Injector injector) { final Object azkabanObj1 = injector.getInstance(azkabanClass); final Object azkabanObj2 = injector.getInstance(azkabanClass); assertThat(azkabanObj1).isSameAs(azkabanObj2).isNotNull(); }
Source:
<code>public CachingInputStream( FSDataInputStream inputStream, CacheManager cacheManager, Path path, boolean cacheValidationEnabled) { super(inputStream); this.inputStream = requireNonNull(inputStream, "inputStream is null"); <START> this.cacheManager = requireNonNull(cacheManager, "cachingFileSystem is null"); <END> this.path = requireNonNull(path, "path is null"); this.cacheValidationEnabled = cacheValidationEnabled; }</code><technical_language>nit: cacheManager is null</technical_language>

Target:
public CachingInputStream( FSDataInputStream inputStream, CacheManager cacheManager, Path path, boolean cacheValidationEnabled) { super(inputStream); this.inputStream = requireNonNull(inputStream, "inputStream is null"); this.cacheManager = requireNonNull(cacheManager, "cacheManager is null"); this.path = requireNonNull(path, "path is null"); this.cacheValidationEnabled = cacheValidationEnabled; }
Source:
<code>public Object apply(ProjectResource resource) { ConfigInfo result = new ConfigInfo(); RefControl refConfig = resource.getControl() .controlForRef(GitRepositoryManager.REF_CONFIG); if (refConfig.isVisible()) { <START> if (want("use_contributor_agreements")) { <END> result.useContributorAgreements = project.isUseContributorAgreements(); } if (want("use_content_merge")) { result.useContentMerge = project.isUseContentMerge(); } if (want("use_signed_off_by")) { result.useSignedOffBy = project.isUseSignedOffBy(); } if (want("require_change_id")) { result.requireChangeID = project.isRequireChangeID(); } } return result; }</code><technical_language>cheap evaluate. fields in RestApiServlet filtering method</technical_language>

Target:
public ConfigInfo apply(ProjectResource resource) { ConfigInfo result = new ConfigInfo(); RefControl refConfig = resource.getControl() .controlForRef(GitRepositoryManager.REF_CONFIG); ProjectState project = resource.getControl().getProjectState(); if (refConfig.isVisible()) { result.useContributorAgreements = project.isUseContributorAgreements(); result.useContentMerge = project.isUseContentMerge(); result.useSignedOffBy = project.isUseSignedOffBy(); result.requireChangeId = project.isRequireChangeID(); } return result; }
Source:
<code>protected Object handleRequestMessage(Message<?> message) { Object value = message; if (this.extractPayload) { value = message.getPayload(); } if (!(value instanceof byte[])) { if (value instanceof String && !serializerExplicitlySet) { value = stringSerializer.serialize((String) value); } else { value = ((RedisSerializer<Object>) serializer).serialize(value); } } String uuid = defaultIdGenerator.generateId().toString(); byte[] uuidByte; if (!serializerExplicitlySet) { uuidByte = stringSerializer.serialize(uuid); } else { uuidByte = ((RedisSerializer<Object>) serializer).serialize(uuid); } this.template.boundListOps(this.queueName).leftPush(uuidByte); this.template.boundListOps(uuid).leftPush(value); <START> this.boundListOperations = template.boundListOps(uuid + QUEUE_NAME_SUFFIX); <END> byte[] reply = (byte[]) this.boundListOperations.rightPop(this.receiveTimeout, TimeUnit.MILLISECONDS); if(reply != null && reply.length > 0) { Object replyMessage = this.serializer.deserialize(reply); if (replyMessage == null) { return null; } return this.getMessageBuilderFactory().withPayload(replyMessage).build(); } return null; }</code><technical_language>This is bug. local var, of uuid + QUEUE_NAME_SUFFIX</technical_language>

Target:
protected Object handleRequestMessage(Message<?> message) { Object value = message; if (this.extractPayload) { value = message.getPayload(); } if (!(value instanceof byte[])) { if (value instanceof String && !serializerExplicitlySet) { value = stringSerializer.serialize((String) value); } else { value = ((RedisSerializer<Object>) serializer).serialize(value); } } String uuid = defaultIdGenerator.generateId().toString(); byte[] uuidByte = uuid.getBytes(); this.boundListOps.leftPush(uuidByte); this.template.boundListOps(uuid).leftPush(value); BoundListOperations<String, Object> boundListOperations = template.boundListOps(uuid + QUEUE_NAME_SUFFIX); byte[] reply = (byte[]) boundListOperations.rightPop(this.receiveTimeout, TimeUnit.MILLISECONDS); if(reply != null && reply.length > 0) { Object replyMessage = this.serializer.deserialize(reply); if (replyMessage == null) { return null; } if (this.extractPayload) { return this.getMessageBuilderFactory().withPayload(replyMessage).build(); } else { return replyMessage; } } return null; }
Source:
<code>public void removeAll() throws TckRepositoryException { uow.begin(); final EntityManager manager = managerProvider.get(); manager.getTransaction().begin(); try { <START> manager.createQuery(format("SELECT e FROM %s e", getEntityName(entityClass)), entityClass) <END> .getResultList() .forEach(manager::remove); manager.getTransaction().commit(); } catch (RuntimeException x) { if (manager.getTransaction().isActive()) { manager.getTransaction().rollback(); } throw new TckRepositoryException(x.getLocalizedMessage(), x); } finally { uow.end(); } }</code><technical_language>DELETE \*</technical_language>

Target:
public void removeAll() throws TckRepositoryException { uow.begin(); final EntityManager manager = managerProvider.get(); try { manager.getTransaction().begin(); manager.createQuery(format("SELECT e FROM %s e", getEntityName(entityClass)), entityClass) .getResultList() .forEach(manager::remove); manager.getTransaction().commit(); } catch (RuntimeException x) { if (manager.getTransaction().isActive()) { manager.getTransaction().rollback(); } throw new TckRepositoryException(x.getLocalizedMessage(), x); } finally { uow.end(); } }
Source:
<code>public boolean kill() { if (status.isKilled()) { return false; } status = SchedulerStatus.KILLED; pinger.interrupt(); schedulingThread.interrupt(); logger.info("Killing all running task processes..."); for (RunningTaskData taskData : jobs.getRunningTasks()) { NodeSet nodes = taskData.getTask().getExecuterInformation().getNodes(); try { taskData.getLauncher().kill(); } catch (Throwable t) { logger.error("Failed to terminate launcher", t); } try { infrastructure.getRMProxiesManager().getUserRMProxy(taskData.getUser(), taskData.getCredentials()) <START> .releaseNodes(nodes, taskData.getTask().getCleaningScript(), null,null,null); <END> } catch (Throwable t) { logger.error("Failed to release nodes", t); } } listenJobLogsSupport.shutdown(); infrastructure.shutdown(); listener.schedulerStateUpdated(SchedulerEvent.KILLED); return true; }</code><technical_language>Is correct pass null null null? 2 separate methods wrap nulls in a single object? more 3 parameters in a method difficult understand</technical_language>

Target:
public boolean kill() { if (status.isKilled()) { return false; } status = SchedulerStatus.KILLED; pinger.interrupt(); schedulingThread.interrupt(); logger.info("Killing all running task processes..."); for (RunningTaskData taskData : jobs.getRunningTasks()) { NodeSet nodes = taskData.getTask().getExecuterInformation().getNodes(); try { taskData.getLauncher().kill(); } catch (Throwable t) { logger.error("Failed to terminate launcher", t); } try { infrastructure.getRMProxiesManager().getUserRMProxy(taskData.getUser(), taskData.getCredentials()) .releaseNodes(nodes, taskData.getTask().getCleaningScript()); } catch (Throwable t) { logger.error("Failed to release nodes", t); } } listenJobLogsSupport.shutdown(); infrastructure.shutdown(); listener.schedulerStateUpdated(SchedulerEvent.KILLED); return true; }
Source:
<code>public void open_withCapabilitiesInInitialResponse_shouldNotIssuePreAuthCapabilitiesCommand() throws Exception { settings.setAuthType(AuthType.PLAIN); MockImapServer server = new MockImapServer(); server.output("* OK [CAPABILITY IMAP4 IMAP4REV1 AUTH=PLAIN]"); server.expect("1 AUTHENTICATE PLAIN"); server.output("+"); server.expect(ByteString.encodeUtf8("\000" + USERNAME + "\000" + PASSWORD).base64()); server.output("1 OK Success"); <START> simplePostAuthenticationDialog(server, true, 2); <END> ImapConnection imapConnection = startServerAndCreateImapConnection(server); imapConnection.open(); server.verifyConnectionStillOpen(); server.verifyInteractionCompleted(); }</code><technical_language>reading this line I idea argument for. methods for of boolean argument. include integer argument in method name, e.g. simplePostAuthenticationDialogStartingWithTag()</technical_language>

Target:
public void open_withCapabilitiesInInitialResponse_shouldNotIssuePreAuthCapabilitiesCommand() throws Exception { settings.setAuthType(AuthType.PLAIN); MockImapServer server = new MockImapServer(); server.output("* OK [CAPABILITY IMAP4 IMAP4REV1 AUTH=PLAIN]"); server.expect("1 AUTHENTICATE PLAIN"); server.output("+"); server.expect(ByteString.encodeUtf8("\000" + USERNAME + "\000" + PASSWORD).base64()); server.output("1 OK Success"); postAuthenticationDialogRequestingCapabilities(server, 2); ImapConnection imapConnection = startServerAndCreateImapConnection(server); imapConnection.open(); server.verifyConnectionStillOpen(); server.verifyInteractionCompleted(); }
Source:
<code><START> public BiFunction<String, Source, K> getProgramParser(KExceptionManager kem) { <END> ParseInModule parseInModule = getParserModule(kompiledDefinition.mainSyntaxModule()); return getParser(parseInModule, programStartSymbol, kem); }</code><technical_language>if getParser method's signature same, getGroundParser is longer a method needs exist</technical_language>

Target:
public BiFunction<String, Source, K> getProgramParser(KExceptionManager kem) { return getParser(kompiledDefinition.mainSyntaxModule(), programStartSymbol, kem); }
Source:
<code>public UserProperty newInstance(User user) { <START> return new DisplayTimezoneProperty( false, TIMEZONES.get(0) ); END> }</code><technical_language>default system timezone - means if save this making changes behavior is consistent</technical_language>

Target:
public UserProperty newInstance(User user) { return new DisplayTimezoneProperty( false, TimeZone.getDefault().getID() ); }
Source:
<code>public synchronized boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { long now = System.nanoTime(); long end = now + unit.toNanos(timeout); while (!isTerminated() && (end - now) > 0L) { <START> wait((end - now) / 1000L); <END> now = System.nanoTime(); } return isTerminated(); }</code><technical_language>1ms=10^6ns</technical_language>

Target:
public synchronized boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { long now = System.nanoTime(); long end = now + unit.toNanos(timeout); while (!isTerminated() && (end - now) > 0L) { wait(TimeUnit.NANOSECONDS.toMillis(end - now)); now = System.nanoTime(); } return isTerminated(); }